From 34bd79ac04e6e7908faeacd9b1bcfa50bc73397e Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 4 Apr 2014 17:58:53 +0200 Subject: notify on incomming received carbon messages --- src/eu/siacs/conversations/services/XmppConnectionService.java | 6 ++++-- src/eu/siacs/conversations/utils/UIHelper.java | 10 ++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java index 786605ab..722245b2 100644 --- a/src/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/eu/siacs/conversations/services/XmppConnectionService.java @@ -136,10 +136,12 @@ public class XmppConnectionService extends Service { || (packet.hasChild("sent"))) { message = MessageParser.parseCarbonMessage(packet, account, service); - if (message != null) { + if ((message != null)&&(message.getStatus() == Message.STATUS_SEND)) { message.getConversation().markRead(); + notify = false; + } else { + notify = true; } - notify = false; } } else if (packet.getType() == MessagePacket.TYPE_GROUPCHAT) { diff --git a/src/eu/siacs/conversations/utils/UIHelper.java b/src/eu/siacs/conversations/utils/UIHelper.java index 3cc99dc5..73a0494b 100644 --- a/src/eu/siacs/conversations/utils/UIHelper.java +++ b/src/eu/siacs/conversations/utils/UIHelper.java @@ -191,8 +191,14 @@ public class UIHelper { List unread = new ArrayList(); for (Conversation conversation : conversations) { - if ((!conversation.isRead())&&((wasHighlighted(conversation)||(alwaysNotify)))) { - unread.add(conversation); + if (conversation.getMode() == Conversation.MODE_MULTI) { + if ((!conversation.isRead())&&((wasHighlighted(conversation)||(alwaysNotify)))) { + unread.add(conversation); + } + } else { + if (!conversation.isRead()) { + unread.add(conversation); + } } } String ringtone = preferences.getString("notification_ringtone", null); -- cgit v1.2.3