Fix bug with quoted reply notifications.

This commit is contained in:
Greyson Parrelli 2018-06-18 14:08:47 -07:00
parent 0c3535cff8
commit 79857b98b3

View File

@ -441,20 +441,16 @@ public class MessageNotifier {
} else { } else {
body = SpanUtil.italic(context.getString(R.string.MessageNotifier_unknown_contact_message)); body = SpanUtil.italic(context.getString(R.string.MessageNotifier_unknown_contact_message));
} }
} else if (record.isMms() && TextUtils.isEmpty(body)) { } else if (record.isMms() && TextUtils.isEmpty(body) && !((MmsMessageRecord) record).getSlideDeck().getSlides().isEmpty()) {
body = SpanUtil.italic(context.getString(R.string.MessageNotifier_media_message)); body = SpanUtil.italic(context.getString(R.string.MessageNotifier_media_message));
slideDeck = ((MediaMmsMessageRecord)record).getSlideDeck(); slideDeck = ((MediaMmsMessageRecord)record).getSlideDeck();
} else if (record.isMms() && !record.isMmsNotification()) { } else if (record.isMms() && !record.isMmsNotification() && !((MmsMessageRecord) record).getSlideDeck().getSlides().isEmpty()) {
String message = context.getString(R.string.MessageNotifier_media_message_with_text, body); String message = context.getString(R.string.MessageNotifier_media_message_with_text, body);
int italicLength = message.length() - body.length(); int italicLength = message.length() - body.length();
body = SpanUtil.italic(message, italicLength); body = SpanUtil.italic(message, italicLength);
slideDeck = ((MediaMmsMessageRecord)record).getSlideDeck(); slideDeck = ((MediaMmsMessageRecord)record).getSlideDeck();
} }
if (record.isMms() && ((MmsMessageRecord) record).getQuote() != null && ((MmsMessageRecord) record).getSlideDeck().getSlides().isEmpty()) {
body = record.getDisplayBody();
}
if (threadRecipients == null || !threadRecipients.isMuted()) { if (threadRecipients == null || !threadRecipients.isMuted()) {
notificationState.addNotification(new NotificationItem(id, mms, recipient, conversationRecipient, threadRecipients, threadId, body, timestamp, slideDeck)); notificationState.addNotification(new NotificationItem(id, mms, recipient, conversationRecipient, threadRecipients, threadId, body, timestamp, slideDeck));
} }