From e6e46651c9ffee9a48bf98f63871c4ef5c1d33c9 Mon Sep 17 00:00:00 2001 From: Daniele Gobbetti Date: Sun, 11 Sep 2016 18:42:05 +0200 Subject: [PATCH] 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 --- .../eu/siacs/conversations/services/NotificationService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/services/NotificationService.java b/src/main/java/eu/siacs/conversations/services/NotificationService.java index fe9215d4b..7cfe2433a 100644 --- a/src/main/java/eu/siacs/conversations/services/NotificationService.java +++ b/src/main/java/eu/siacs/conversations/services/NotificationService.java @@ -376,7 +376,7 @@ public class NotificationService { builder.setStyle(messagingStyle); } else { 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); } }