mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-11 20:27:47 +00:00
e UpdateMessageBuilder to generate data extraction message
This commit is contained in:
@@ -5,6 +5,7 @@ import org.session.libsession.R
|
||||
import org.session.libsession.messaging.MessagingConfiguration
|
||||
import org.session.libsession.utilities.ExpirationUtil
|
||||
import org.session.libsignal.service.api.messages.SignalServiceGroup
|
||||
import org.session.libsignal.service.internal.push.SignalServiceProtos
|
||||
|
||||
object UpdateMessageBuilder {
|
||||
|
||||
@@ -82,7 +83,7 @@ object UpdateMessageBuilder {
|
||||
if (!isOutgoing && sender == null) return ""
|
||||
val senderName: String? = if (!isOutgoing) {
|
||||
MessagingConfiguration.shared.storage.getDisplayNameForRecipient(sender!!) ?: sender
|
||||
} else { sender }
|
||||
} else { context.getString(R.string.MessageRecord_you) }
|
||||
return if (duration <= 0) {
|
||||
if (isOutgoing) context.getString(R.string.MessageRecord_you_disabled_disappearing_messages)
|
||||
else context.getString(R.string.MessageRecord_s_disabled_disappearing_messages, senderName)
|
||||
@@ -93,8 +94,13 @@ object UpdateMessageBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
//TODO do this when the current update is merged
|
||||
fun buildDataExtractionMessage(): String {
|
||||
return ""
|
||||
fun buildDataExtractionMessage(context: Context, kind: SignalServiceProtos.DataExtractionNotification.Type, sender: String? = null): String {
|
||||
val senderName = MessagingConfiguration.shared.storage.getDisplayNameForRecipient(sender!!) ?: sender
|
||||
return when (kind) {
|
||||
SignalServiceProtos.DataExtractionNotification.Type.SCREENSHOT ->
|
||||
context.getString(R.string.MessageRecord_s_took_a_screenshot, senderName)
|
||||
SignalServiceProtos.DataExtractionNotification.Type.MEDIA_SAVED ->
|
||||
context.getString(R.string.MessageRecord_media_saved_by_s, senderName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -509,6 +509,8 @@
|
||||
<string name="MessageRecord_s_disabled_disappearing_messages">%1$s disabled disappearing messages.</string>
|
||||
<string name="MessageRecord_you_set_disappearing_message_time_to_s">You set the disappearing message timer to %1$s</string>
|
||||
<string name="MessageRecord_s_set_disappearing_message_time_to_s">%1$s set the disappearing message timer to %2$s</string>
|
||||
<string name="MessageRecord_s_took_a_screenshot">%1$s took a screenshot.</string>
|
||||
<string name="MessageRecord_media_saved_by_s">Media saved by %1$s.</string>
|
||||
<string name="MessageRecord_your_safety_number_with_s_has_changed">Your safety number with %s has changed.</string>
|
||||
<string name="MessageRecord_you_marked_your_safety_number_with_s_verified">You marked your safety number with %s verified</string>
|
||||
<string name="MessageRecord_you_marked_your_safety_number_with_s_verified_from_another_device">You marked your safety number with %s verified from another device</string>
|
||||
|
Reference in New Issue
Block a user