mirror of
https://github.com/oxen-io/session-android.git
synced 2025-06-08 20:18:34 +00:00
Use mention-updated body for unread reaction notification text.
This commit is contained in:
parent
e3338dc3ff
commit
29930cac41
@ -560,6 +560,7 @@ public class DefaultMessageNotifier implements MessageNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (hasUnreadReactions) {
|
if (hasUnreadReactions) {
|
||||||
|
CharSequence originalBody = body;
|
||||||
for (ReactionRecord reaction : record.getReactions()) {
|
for (ReactionRecord reaction : record.getReactions()) {
|
||||||
Recipient reactionSender = Recipient.resolved(reaction.getAuthor());
|
Recipient reactionSender = Recipient.resolved(reaction.getAuthor());
|
||||||
if (reactionSender.equals(Recipient.self()) || !record.isOutgoing() || reaction.getDateReceived() <= lastReactionRead) {
|
if (reactionSender.equals(Recipient.self()) || !record.isOutgoing() || reaction.getDateReceived() <= lastReactionRead) {
|
||||||
@ -569,7 +570,7 @@ public class DefaultMessageNotifier implements MessageNotifier {
|
|||||||
if (KeyCachingService.isLocked(context)) {
|
if (KeyCachingService.isLocked(context)) {
|
||||||
body = SpanUtil.italic(context.getString(R.string.MessageNotifier_locked_message));
|
body = SpanUtil.italic(context.getString(R.string.MessageNotifier_locked_message));
|
||||||
} else {
|
} else {
|
||||||
String text = SpanUtil.italic(getReactionMessageBody(context, record)).toString();
|
String text = SpanUtil.italic(getReactionMessageBody(context, record, originalBody)).toString();
|
||||||
String[] parts = text.split(EMOJI_REPLACEMENT_STRING);
|
String[] parts = text.split(EMOJI_REPLACEMENT_STRING);
|
||||||
|
|
||||||
SpannableStringBuilder builder = new SpannableStringBuilder();
|
SpannableStringBuilder builder = new SpannableStringBuilder();
|
||||||
@ -599,9 +600,8 @@ public class DefaultMessageNotifier implements MessageNotifier {
|
|||||||
return notificationState;
|
return notificationState;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static CharSequence getReactionMessageBody(@NonNull Context context, @NonNull MessageRecord record) {
|
private static CharSequence getReactionMessageBody(@NonNull Context context, @NonNull MessageRecord record, @NonNull CharSequence body) {
|
||||||
CharSequence body = record.getDisplayBody(context);
|
boolean bodyIsEmpty = TextUtils.isEmpty(body);
|
||||||
boolean bodyIsEmpty = TextUtils.isEmpty(body);
|
|
||||||
|
|
||||||
if (MessageRecordUtil.hasSharedContact(record)) {
|
if (MessageRecordUtil.hasSharedContact(record)) {
|
||||||
Contact contact = ((MmsMessageRecord) record).getSharedContacts().get(0);
|
Contact contact = ((MmsMessageRecord) record).getSharedContacts().get(0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user