diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2014-09-19 10:32:24 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2014-09-19 10:32:24 +0200 |
commit | 96e2dfa24666d0ffd055324f2833e735db1b91e8 (patch) | |
tree | c888ea9376076a37c8d4b46383d450ef07cb2753 /src/eu/siacs/conversations | |
parent | d5b58449a01e439c94bb65c3b2a0338a2e78f393 (diff) | |
parent | 00ff5c2dbd70174d52797d598c3c2d59a5b8e6a9 (diff) |
Merge pull request #447 from betheg/private_notify
MUC: notify also on private messages
Diffstat (limited to 'src/eu/siacs/conversations')
-rw-r--r-- | src/eu/siacs/conversations/utils/UIHelper.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/eu/siacs/conversations/utils/UIHelper.java b/src/eu/siacs/conversations/utils/UIHelper.java index 54c370ef..56248234 100644 --- a/src/eu/siacs/conversations/utils/UIHelper.java +++ b/src/eu/siacs/conversations/utils/UIHelper.java @@ -353,14 +353,15 @@ public class UIHelper { Pattern highlight = generateNickHighlightPattern(nick); Matcher m = highlight.matcher(currentCon.getLatestMessage() .getBody()); - notify = m.find(); + notify = m.find() + || (currentCon.getLatestMessage().getType() == Message.TYPE_PRIVATE); } List<Conversation> unread = new ArrayList<Conversation>(); for (Conversation conversation : conversations) { if (conversation.getMode() == Conversation.MODE_MULTI) { if ((!conversation.isRead()) - && ((wasHighlighted(conversation) || (alwaysNotify)))) { + && ((wasHighlightedOrPrivate(conversation) || (alwaysNotify)))) { unread.add(conversation); } } else { @@ -466,7 +467,7 @@ public class UIHelper { } } - private static boolean wasHighlighted(Conversation conversation) { + private static boolean wasHighlightedOrPrivate(Conversation conversation) { List<Message> messages = conversation.getMessages(); String nick = conversation.getMucOptions().getActualNick(); Pattern highlight = generateNickHighlightPattern(nick); @@ -475,7 +476,8 @@ public class UIHelper { break; } else { Matcher m = highlight.matcher(messages.get(i).getBody()); - if (m.find()) { + if (m.find() + || messages.get(i).getType() == Message.TYPE_PRIVATE) { return true; } } |