diff options
author | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-02-10 22:45:59 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-02-10 22:45:59 +0100 |
commit | b673af2ba0b46e7444f536fbc7429f9ef74560fb (patch) | |
tree | f33e36a559d3a2b574c25962579fa161f1f968d8 /src/de/gultsch/chat/services/XmppConnectionService.java | |
parent | cfc74e7c8e912c7a194ad674ec5f98ab6950640f (diff) |
reworked notification a bit
Diffstat (limited to '')
-rw-r--r-- | src/de/gultsch/chat/services/XmppConnectionService.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/de/gultsch/chat/services/XmppConnectionService.java b/src/de/gultsch/chat/services/XmppConnectionService.java index 1160754e..5a43f99f 100644 --- a/src/de/gultsch/chat/services/XmppConnectionService.java +++ b/src/de/gultsch/chat/services/XmppConnectionService.java @@ -86,6 +86,7 @@ public class XmppConnectionService extends Service { forwarded = packet.findChild("sent").findChild( "forwarded"); status = Message.STATUS_SEND; + notify = false; } else { return; // massage has no body and is not carbon. just // skip @@ -128,6 +129,9 @@ public class XmppConnectionService extends Service { } Message message = new Message(conversation, counterPart, body, Message.ENCRYPTION_NONE, status); + if(notify) { + message.markUnread(); + } conversation.getMessages().add(message); databaseBackend.createMessage(message); if (convChangedListener != null) { @@ -398,6 +402,7 @@ public class XmppConnectionService extends Service { Account account = accountLookupTable.get(conv.getAccountUuid()); conv.setAccount(account); conv.setContact(findContact(account, conv.getContactJid())); + conv.setMessages(databaseBackend.getMessages(conv, 50)); } } return this.conversations; @@ -406,11 +411,7 @@ public class XmppConnectionService extends Service { public List<Account> getAccounts() { return this.accounts; } - - public List<Message> getMessages(Conversation conversation) { - return databaseBackend.getMessages(conversation, 100); - } - + public Contact findContact(Account account, String jid) { return databaseBackend.findContact(account, jid); } |