mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-11 10:07:25 +00:00
Expiration message feedback
This commit is contained in:
@@ -15,7 +15,6 @@ import dagger.hilt.android.AndroidEntryPoint
|
|||||||
import network.loki.messenger.R
|
import network.loki.messenger.R
|
||||||
import network.loki.messenger.databinding.ViewConversationBinding
|
import network.loki.messenger.databinding.ViewConversationBinding
|
||||||
import org.session.libsession.utilities.ThemeUtil
|
import org.session.libsession.utilities.ThemeUtil
|
||||||
import org.session.libsession.utilities.getColorFromAttr
|
|
||||||
import org.session.libsession.utilities.recipients.Recipient
|
import org.session.libsession.utilities.recipients.Recipient
|
||||||
import org.thoughtcrime.securesms.conversation.v2.utilities.MentionUtilities.highlightMentions
|
import org.thoughtcrime.securesms.conversation.v2.utilities.MentionUtilities.highlightMentions
|
||||||
import org.thoughtcrime.securesms.database.RecipientDatabase.NOTIFY_TYPE_ALL
|
import org.thoughtcrime.securesms.database.RecipientDatabase.NOTIFY_TYPE_ALL
|
||||||
@@ -50,16 +49,6 @@ class ConversationView : LinearLayout {
|
|||||||
|
|
||||||
// region Updating
|
// region Updating
|
||||||
fun bind(thread: ThreadRecord, isTyping: Boolean) {
|
fun bind(thread: ThreadRecord, isTyping: Boolean) {
|
||||||
if (thread.isLeavingGroup) {
|
|
||||||
binding.conversationViewDisplayNameTextView.setTextColor(context.getColorFromAttr(android.R.attr.textColorSecondary))
|
|
||||||
binding.snippetTextView.setTextColor(context.getColorFromAttr(android.R.attr.textColorSecondary))
|
|
||||||
} else if (thread.isErrorLeavingGroup) {
|
|
||||||
binding.conversationViewDisplayNameTextView.setTextColor(context.getColorFromAttr(android.R.attr.textColorPrimary))
|
|
||||||
binding.snippetTextView.setTextColor(context.getColorFromAttr(R.attr.danger))
|
|
||||||
} else {
|
|
||||||
binding.conversationViewDisplayNameTextView.setTextColor(context.getColorFromAttr(android.R.attr.textColorPrimary))
|
|
||||||
binding.snippetTextView.setTextColor(context.getColorFromAttr(android.R.attr.textColorPrimary))
|
|
||||||
}
|
|
||||||
this.thread = thread
|
this.thread = thread
|
||||||
if (thread.isPinned) {
|
if (thread.isPinned) {
|
||||||
binding.conversationViewDisplayNameTextView.setCompoundDrawablesRelativeWithIntrinsicBounds(
|
binding.conversationViewDisplayNameTextView.setCompoundDrawablesRelativeWithIntrinsicBounds(
|
||||||
|
@@ -102,17 +102,9 @@ data class VisibleMessage(
|
|||||||
val pointers = attachments.mapNotNull { Attachment.createAttachmentPointer(it) }
|
val pointers = attachments.mapNotNull { Attachment.createAttachmentPointer(it) }
|
||||||
dataMessage.addAllAttachments(pointers)
|
dataMessage.addAllAttachments(pointers)
|
||||||
// TODO: Contact
|
// TODO: Contact
|
||||||
// Expiration timer
|
// Expiration timer on the message
|
||||||
proto.applyExpiryMode()
|
proto.applyExpiryMode()
|
||||||
// Group context
|
|
||||||
val storage = MessagingModuleConfiguration.shared.storage
|
|
||||||
val context = MessagingModuleConfiguration.shared.context
|
|
||||||
val expiration = if (storage.isLegacyClosedGroup(recipient!!)) {
|
|
||||||
Recipient.from(context, Address.fromSerialized(GroupUtil.doubleEncodeGroupID(recipient!!)), false).expireMessages
|
|
||||||
} else {
|
|
||||||
Recipient.from(context, Address.fromSerialized(recipient!!), false).expireMessages
|
|
||||||
}
|
|
||||||
dataMessage.expireTimer = expiration
|
|
||||||
// Community blocked message requests flag
|
// Community blocked message requests flag
|
||||||
dataMessage.blocksCommunityMessageRequests = blocksMessageRequests
|
dataMessage.blocksCommunityMessageRequests = blocksMessageRequests
|
||||||
// Sync target
|
// Sync target
|
||||||
|
Reference in New Issue
Block a user