mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-03-03 15:58:40 +00:00
Add proper thread summary for reactions to stories.
This commit is contained in:
committed by
Cody Henthorne
parent
d64aa3bc43
commit
b183a38f3c
@@ -50,6 +50,8 @@ public final class ThreadBodyUtil {
|
||||
return format(context, record, emoji, R.string.ThreadRecord_sticker);
|
||||
} else if (MessageRecordUtil.hasGiftBadge(record)) {
|
||||
return String.format("%s %s", EmojiStrings.GIFT, getGiftSummary(context, record));
|
||||
} else if (MessageRecordUtil.isStoryReaction(record)) {
|
||||
return getStoryReactionSummary(context, record);
|
||||
}
|
||||
|
||||
boolean hasImage = false;
|
||||
@@ -84,6 +86,14 @@ public final class ThreadBodyUtil {
|
||||
return context.getString(R.string.ThreadRecord__you_received_a_gift);
|
||||
}
|
||||
}
|
||||
|
||||
private static @NonNull String getStoryReactionSummary(@NonNull Context context, @NonNull MessageRecord messageRecord) {
|
||||
if (messageRecord.isOutgoing()) {
|
||||
return context.getString(R.string.ThreadRecord__reacted_s_to_their_story, messageRecord.getDisplayBody(context));
|
||||
} else {
|
||||
return context.getString(R.string.ThreadRecord__reacted_s_to_your_story, messageRecord.getDisplayBody(context));
|
||||
}
|
||||
}
|
||||
|
||||
private static @NonNull String format(@NonNull Context context, @NonNull MessageRecord record, @NonNull String emoji, @StringRes int defaultStringRes) {
|
||||
return String.format("%s %s", emoji, getBodyOrDefault(context, record, defaultStringRes));
|
||||
|
||||
Reference in New Issue
Block a user