From 79a66d9bd3b824ef4b3cf4e5da3490b36f58353b Mon Sep 17 00:00:00 2001 From: Ryan ZHAO Date: Thu, 6 Aug 2020 14:42:24 +1000 Subject: [PATCH 1/3] fix mention in notifications --- .../notifications/DefaultMessageNotifier.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/org/thoughtcrime/securesms/notifications/DefaultMessageNotifier.java b/src/org/thoughtcrime/securesms/notifications/DefaultMessageNotifier.java index 660e1a4ecd..56ec8a5fe1 100644 --- a/src/org/thoughtcrime/securesms/notifications/DefaultMessageNotifier.java +++ b/src/org/thoughtcrime/securesms/notifications/DefaultMessageNotifier.java @@ -51,6 +51,7 @@ import org.thoughtcrime.securesms.database.model.MessageRecord; import org.thoughtcrime.securesms.database.model.MmsMessageRecord; import org.thoughtcrime.securesms.logging.Log; import org.thoughtcrime.securesms.loki.protocol.SessionMetaProtocol; +import org.thoughtcrime.securesms.loki.utilities.MentionUtilities; import org.thoughtcrime.securesms.mms.SlideDeck; import org.thoughtcrime.securesms.recipients.Recipient; import org.thoughtcrime.securesms.service.IncomingMessageObserver; @@ -60,6 +61,7 @@ import org.thoughtcrime.securesms.util.SpanUtil; import org.thoughtcrime.securesms.util.TextSecurePreferences; import org.thoughtcrime.securesms.webrtc.CallNotificationBuilder; import org.whispersystems.signalservice.internal.util.Util; +import org.whispersystems.signalservice.loki.protocol.mentions.Mention; import java.util.HashSet; import java.util.List; @@ -311,7 +313,8 @@ public class DefaultMessageNotifier implements MessageNotifier { builder.setThread(notifications.get(0).getRecipient()); builder.setMessageCount(notificationState.getMessageCount()); builder.setPrimaryMessageBody(recipient, notifications.get(0).getIndividualRecipient(), - notifications.get(0).getText(), notifications.get(0).getSlideDeck()); + MentionUtilities.highlightMentions(notifications.get(0).getText(), notifications.get(0).getThreadId(), context), + notifications.get(0).getSlideDeck()); builder.setContentIntent(notifications.get(0).getPendingIntent(context)); builder.setDeleteIntent(notificationState.getDeleteIntent(context)); builder.setOnlyAlertOnce(!signal); @@ -390,13 +393,14 @@ public class DefaultMessageNotifier implements MessageNotifier { while(iterator.hasPrevious()) { NotificationItem item = iterator.previous(); - builder.addMessageBody(item.getIndividualRecipient(), item.getRecipient(), item.getText()); + builder.addMessageBody(item.getIndividualRecipient(), item.getRecipient(), + MentionUtilities.highlightMentions(item.getText(), item.getThreadId(), context)); } if (signal) { builder.setAlarms(notificationState.getRingtone(context), notificationState.getVibrate()); builder.setTicker(notifications.get(0).getIndividualRecipient(), - notifications.get(0).getText()); + MentionUtilities.highlightMentions(notifications.get(0).getText(), notifications.get(0).getThreadId(), context)); } Notification notification = builder.build(); From 3f69aabf85805814b2b56fd1c7163e95e897b0e0 Mon Sep 17 00:00:00 2001 From: Ryan ZHAO Date: Fri, 7 Aug 2020 10:45:43 +1000 Subject: [PATCH 2/3] fix ui issue that tick circles not shown for long names when creating a closed group --- res/layout/view_user.xml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/res/layout/view_user.xml b/res/layout/view_user.xml index 8df24dc6a5..2627f076cb 100644 --- a/res/layout/view_user.xml +++ b/res/layout/view_user.xml @@ -21,20 +21,17 @@ - - + android:text="Spiderman" + android:layout_weight="1"/> Date: Fri, 7 Aug 2020 15:13:08 +1000 Subject: [PATCH 3/3] fix text got cut off when sending an image with a text message --- .../thoughtcrime/securesms/conversation/ConversationItem.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/org/thoughtcrime/securesms/conversation/ConversationItem.java b/src/org/thoughtcrime/securesms/conversation/ConversationItem.java index fb56fbca52..74dc63dd15 100644 --- a/src/org/thoughtcrime/securesms/conversation/ConversationItem.java +++ b/src/org/thoughtcrime/securesms/conversation/ConversationItem.java @@ -290,6 +290,10 @@ public class ConversationItem extends LinearLayout } } + if (hasThumbnail(messageRecord) && messageRecord.getDisplayBody(context).length() > 0) { + ViewUtil.updateLayoutParams(bodyText, getAvailableMessageBubbleWidth(bodyText), ViewGroup.LayoutParams.WRAP_CONTENT); + } + ConversationItemFooter activeFooter = getActiveFooter(messageRecord); int availableWidth = getAvailableMessageBubbleWidth(footer);