|
|
|
@ -18,8 +18,6 @@ import org.session.libsession.utilities.recipients.Recipient
|
|
|
|
|
import org.session.libsession.utilities.truncateIdForDisplay
|
|
|
|
|
|
|
|
|
|
object UpdateMessageBuilder {
|
|
|
|
|
private val TAG = "UpdateMessageBuilder"
|
|
|
|
|
|
|
|
|
|
val storage = MessagingModuleConfiguration.shared.storage
|
|
|
|
|
|
|
|
|
|
private fun getSenderName(senderId: String) = storage.getContactWithSessionID(senderId)
|
|
|
|
@ -88,8 +86,6 @@ object UpdateMessageBuilder {
|
|
|
|
|
timestamp: Long,
|
|
|
|
|
expireStarted: Long
|
|
|
|
|
): String {
|
|
|
|
|
Log.d(TAG, "buildExpirationTimerMessage() called with: duration = $duration, senderId = $senderId, isOutgoing = $isOutgoing, timestamp = $timestamp, expireStarted = $expireStarted")
|
|
|
|
|
|
|
|
|
|
if (!isOutgoing && senderId == null) return ""
|
|
|
|
|
val senderName = if (isOutgoing) context.getString(R.string.MessageRecord_you) else getSenderName(senderId!!)
|
|
|
|
|
return if (duration <= 0) {
|
|
|
|
@ -103,7 +99,6 @@ object UpdateMessageBuilder {
|
|
|
|
|
} else {
|
|
|
|
|
val time = ExpirationUtil.getExpirationDisplayValue(context, duration.toInt())
|
|
|
|
|
val action = context.getExpirationTypeDisplayValue(timestamp == expireStarted)
|
|
|
|
|
Log.d(TAG, "action = $action because timestamp = $timestamp and expireStarted = $expireStarted equal = ${timestamp == expireStarted}")
|
|
|
|
|
if (isOutgoing) {
|
|
|
|
|
if (!isNewConfigEnabled) context.getString(R.string.MessageRecord_you_set_disappearing_message_time_to_s, time)
|
|
|
|
|
else context.getString(
|
|
|
|
@ -120,7 +115,7 @@ object UpdateMessageBuilder {
|
|
|
|
|
action
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}.also { Log.d(TAG, "display: $it") }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fun buildDataExtractionMessage(context: Context, kind: DataExtractionNotificationInfoMessage.Kind, senderId: String? = null): String {
|
|
|
|
|