Use the last message in the content text instead of the first.

This fixes the issue where the first message in the notification was sent to pebble
(and possibly to other wear devices) for every update in the conversation, as
reported in #1249.

This is the same patch propoed in https://github.com/siacs/Conversations/issues/1249#issuecomment-245878335
This commit is contained in:
Daniele Gobbetti 2016-09-11 18:42:05 +02:00
parent 75fcab3170
commit e6e46651c9

View file

@ -376,7 +376,7 @@ public class NotificationService {
builder.setStyle(messagingStyle); builder.setStyle(messagingStyle);
} else { } else {
builder.setStyle(new NotificationCompat.BigTextStyle().bigText(getMergedBodies(messages))); builder.setStyle(new NotificationCompat.BigTextStyle().bigText(getMergedBodies(messages)));
builder.setContentText(UIHelper.getMessagePreview(mXmppConnectionService, messages.get(0)).first); builder.setContentText(UIHelper.getMessagePreview(mXmppConnectionService, messages.get((messages.size()-1))).first);
} }
} }