diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2014-09-28 15:21:56 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2014-09-28 15:21:56 +0200 |
commit | bff23c2e232e8f9a4e64553215130079b7fc5a4f (patch) | |
tree | fec9608b615334ff065399b03fb747c4a7bf4d94 /src/eu/siacs/conversations/parser | |
parent | 1ae9338fc9d5f8e1f6505445f07f4476efd8f139 (diff) |
new notification service. first draft
Diffstat (limited to 'src/eu/siacs/conversations/parser')
-rw-r--r-- | src/eu/siacs/conversations/parser/AbstractParser.java | 2 | ||||
-rw-r--r-- | src/eu/siacs/conversations/parser/MessageParser.java | 11 | ||||
-rw-r--r-- | src/eu/siacs/conversations/parser/PresenceParser.java | 4 |
3 files changed, 11 insertions, 6 deletions
diff --git a/src/eu/siacs/conversations/parser/AbstractParser.java b/src/eu/siacs/conversations/parser/AbstractParser.java index efbf5aef..5541c1c6 100644 --- a/src/eu/siacs/conversations/parser/AbstractParser.java +++ b/src/eu/siacs/conversations/parser/AbstractParser.java @@ -60,7 +60,7 @@ public abstract class AbstractParser { protected void updateLastseen(Element packet, Account account, boolean presenceOverwrite) { - String[] fromParts = packet.getAttribute("from").split("/",2); + String[] fromParts = packet.getAttribute("from").split("/", 2); String from = fromParts[0]; String presence = null; if (fromParts.length >= 2) { diff --git a/src/eu/siacs/conversations/parser/MessageParser.java b/src/eu/siacs/conversations/parser/MessageParser.java index 9e2ccd92..3891ebf7 100644 --- a/src/eu/siacs/conversations/parser/MessageParser.java +++ b/src/eu/siacs/conversations/parser/MessageParser.java @@ -298,7 +298,8 @@ public class MessageParser extends AbstractParser implements Element password = x.findChild("password"); conversation.getMucOptions().setPassword( password.getContent()); - mXmppConnectionService.databaseBackend.updateConversation(conversation); + mXmppConnectionService.databaseBackend + .updateConversation(conversation); } mXmppConnectionService.joinMuc(conversation); mXmppConnectionService.updateConversationUi(); @@ -314,7 +315,8 @@ public class MessageParser extends AbstractParser implements if (!conversation.getMucOptions().online()) { if (password != null) { conversation.getMucOptions().setPassword(password); - mXmppConnectionService.databaseBackend.updateConversation(conversation); + mXmppConnectionService.databaseBackend + .updateConversation(conversation); } mXmppConnectionService.joinMuc(conversation); mXmppConnectionService.updateConversationUi(); @@ -465,7 +467,10 @@ public class MessageParser extends AbstractParser implements } } notify = notify && !conversation.isMuted(); - mXmppConnectionService.notifyUi(conversation, notify); + if (notify) { + mXmppConnectionService.pushNotification(message); + } + mXmppConnectionService.updateConversationUi(); } private void parseHeadline(MessagePacket packet, Account account) { diff --git a/src/eu/siacs/conversations/parser/PresenceParser.java b/src/eu/siacs/conversations/parser/PresenceParser.java index e240a858..507ebbd2 100644 --- a/src/eu/siacs/conversations/parser/PresenceParser.java +++ b/src/eu/siacs/conversations/parser/PresenceParser.java @@ -22,7 +22,7 @@ public class PresenceParser extends AbstractParser implements PgpEngine mPgpEngine = mXmppConnectionService.getPgpEngine(); if (packet.hasChild("x", "http://jabber.org/protocol/muc#user")) { Conversation muc = mXmppConnectionService.find(account, packet - .getAttribute("from").split("/",2)[0]); + .getAttribute("from").split("/", 2)[0]); if (muc != null) { boolean before = muc.getMucOptions().online(); muc.getMucOptions().processPacket(packet, mPgpEngine); @@ -32,7 +32,7 @@ public class PresenceParser extends AbstractParser implements } } else if (packet.hasChild("x", "http://jabber.org/protocol/muc")) { Conversation muc = mXmppConnectionService.find(account, packet - .getAttribute("from").split("/",2)[0]); + .getAttribute("from").split("/", 2)[0]); if (muc != null) { boolean before = muc.getMucOptions().online(); muc.getMucOptions().processPacket(packet, mPgpEngine); |