Fix/groupsv2 fixes (#985)

* SES-3431 no emoji reaciton on control messages

* SES-3423 Quoted messages styling

* clean up
pull/1710/head
ThomasSession 1 month ago committed by GitHub
parent d7f697572e
commit 11a0ee9fbb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -40,6 +40,7 @@ import org.session.libsession.utilities.TextSecurePreferences
import org.session.libsession.utilities.TextSecurePreferences.Companion.getLocalNumber
import org.session.libsession.utilities.ThemeUtil
import org.session.libsession.utilities.recipients.Recipient
import org.session.libsignal.utilities.Log
import org.thoughtcrime.securesms.components.emoji.EmojiImageView
import org.thoughtcrime.securesms.components.emoji.RecentEmojiPageModel
import org.thoughtcrime.securesms.components.menu.ActionItem
@ -271,11 +272,6 @@ class ConversationReactionOverlay : FrameLayout {
(width - scrubberWidth - scrubberHorizontalMargin).toFloat()
}
val isDeprecatedLegacyGroup =
recipient?.isLegacyGroupRecipient == true &&
deprecationManager.isDeprecated
foregroundView.isVisible = !isDeprecatedLegacyGroup
backgroundView.isVisible = !isDeprecatedLegacyGroup
foregroundView.x = scrubberX
foregroundView.y = reactionBarBackgroundY + reactionBarHeight / 2f - foregroundView.height / 2f
backgroundView.x = scrubberX
@ -548,6 +544,7 @@ class ConversationReactionOverlay : FrameLayout {
// Prepare
val containsControlMessage = message.isControlMessage
val hasText = !message.body.isEmpty()
val openGroup = lokiThreadDatabase.getOpenGroupChat(message.threadId)
val userPublicKey = textSecurePreferences.getLocalNumber()!!
@ -631,8 +628,8 @@ class ConversationReactionOverlay : FrameLayout {
}
// deleted messages have no emoji reactions
backgroundView.isVisible = !isDeleteOnly
foregroundView.isVisible = !isDeleteOnly
backgroundView.isVisible = !isDeleteOnly && !isDeprecatedLegacyGroup
foregroundView.isVisible = !isDeleteOnly && !isDeprecatedLegacyGroup
return items
}

@ -79,7 +79,8 @@ class QuoteView @JvmOverloads constructor(context: Context, attrs: AttributeSet?
if (quoteIsLocalUser) context.getString(R.string.you)
else author?.displayName(Contact.contextForRecipient(thread)) ?: truncateIdForDisplay(authorPublicKey)
binding.quoteViewAuthorTextView.text = authorDisplayName
binding.quoteViewAuthorTextView.setTextColor(getTextColor(isOutgoingMessage))
val textColor = getTextColor(isOutgoingMessage)
binding.quoteViewAuthorTextView.setTextColor(textColor)
// Body
binding.quoteViewBodyTextView.text = if (isOpenGroupInvitation)
resources.getString(R.string.communityInvitation)
@ -90,7 +91,7 @@ class QuoteView @JvmOverloads constructor(context: Context, attrs: AttributeSet?
threadID = threadID,
context = context
)
binding.quoteViewBodyTextView.setTextColor(getTextColor(isOutgoingMessage))
binding.quoteViewBodyTextView.setTextColor(textColor)
// Accent line / attachment preview
val hasAttachments = (attachments != null && attachments.asAttachments().isNotEmpty()) && !isOriginalMissing
binding.quoteViewAccentLine.isVisible = !hasAttachments
@ -98,9 +99,7 @@ class QuoteView @JvmOverloads constructor(context: Context, attrs: AttributeSet?
if (!hasAttachments) {
binding.quoteViewAccentLine.setBackgroundColor(getLineColor(isOutgoingMessage))
} else if (attachments != null) {
binding.quoteViewAttachmentPreviewImageView.imageTintList = ColorStateList.valueOf(ResourcesCompat.getColor(resources, R.color.white, context.theme))
val backgroundColor = context.getAccentColor()
binding.quoteViewAttachmentPreviewContainer.backgroundTintList = ColorStateList.valueOf(backgroundColor)
binding.quoteViewAttachmentPreviewImageView.imageTintList = ColorStateList.valueOf(textColor)
binding.quoteViewAttachmentPreviewImageView.isVisible = false
binding.quoteViewAttachmentThumbnailImageView.root.isVisible = false
when {

@ -119,7 +119,6 @@ public abstract class DisplayRecord {
return SmsDatabase.Types.isGroupUpdateMessage(type);
}
public boolean isExpirationTimerUpdate() { return SmsDatabase.Types.isExpirationTimerUpdate(type); }
public boolean isGroupV2ExpirationTimerUpdate() { return false; }
public boolean isMediaSavedNotification() { return MmsSmsColumns.Types.isMediaSavedExtraction(type); }
public boolean isScreenshotNotification() { return MmsSmsColumns.Types.isScreenshotExtraction(type); }
public boolean isDataExtractionNotification() { return isMediaSavedNotification() || isScreenshotNotification(); }

@ -3,7 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/black" />
<solid android:color="@color/transparent_black_6" />
<corners android:radius="4dp" />
</shape>

@ -5,9 +5,8 @@
android:id="@+id/mainQuoteViewContainer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?input_bar_background"
android:minHeight="52dp"
android:paddingVertical="12dp"
android:background="#F00"
android:paddingTop="12dp"
android:paddingHorizontal="12dp"
app:quote_mode="regular">
@ -15,7 +14,6 @@
android:id="@+id/quoteViewAccentLine"
android:layout_width="@dimen/accent_line_thickness"
android:layout_height="0dp"
android:layout_marginVertical="2dp"
android:background="?colorAccent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0"
@ -28,7 +26,6 @@
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:layout_marginVertical="@dimen/small_spacing"
android:background="@drawable/view_quote_attachment_preview_background"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"

Loading…
Cancel
Save