mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-28 11:42:15 -05:00
Merge pull request #447 from betheg/private_notify
MUC: notify also on private messages
This commit is contained in:
commit
96e2dfa246
@ -353,14 +353,15 @@ public class UIHelper {
|
|||||||
Pattern highlight = generateNickHighlightPattern(nick);
|
Pattern highlight = generateNickHighlightPattern(nick);
|
||||||
Matcher m = highlight.matcher(currentCon.getLatestMessage()
|
Matcher m = highlight.matcher(currentCon.getLatestMessage()
|
||||||
.getBody());
|
.getBody());
|
||||||
notify = m.find();
|
notify = m.find()
|
||||||
|
|| (currentCon.getLatestMessage().getType() == Message.TYPE_PRIVATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Conversation> unread = new ArrayList<Conversation>();
|
List<Conversation> unread = new ArrayList<Conversation>();
|
||||||
for (Conversation conversation : conversations) {
|
for (Conversation conversation : conversations) {
|
||||||
if (conversation.getMode() == Conversation.MODE_MULTI) {
|
if (conversation.getMode() == Conversation.MODE_MULTI) {
|
||||||
if ((!conversation.isRead())
|
if ((!conversation.isRead())
|
||||||
&& ((wasHighlighted(conversation) || (alwaysNotify)))) {
|
&& ((wasHighlightedOrPrivate(conversation) || (alwaysNotify)))) {
|
||||||
unread.add(conversation);
|
unread.add(conversation);
|
||||||
}
|
}
|
||||||
} else {
|
} 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();
|
List<Message> messages = conversation.getMessages();
|
||||||
String nick = conversation.getMucOptions().getActualNick();
|
String nick = conversation.getMucOptions().getActualNick();
|
||||||
Pattern highlight = generateNickHighlightPattern(nick);
|
Pattern highlight = generateNickHighlightPattern(nick);
|
||||||
@ -475,7 +476,8 @@ public class UIHelper {
|
|||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
Matcher m = highlight.matcher(messages.get(i).getBody());
|
Matcher m = highlight.matcher(messages.get(i).getBody());
|
||||||
if (m.find()) {
|
if (m.find()
|
||||||
|
|| messages.get(i).getType() == Message.TYPE_PRIVATE) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user