diff options
author | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-02-09 01:00:23 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-02-09 01:00:23 +0100 |
commit | 4a963d6f5047705cb635924cf35b523f6cd6ba6b (patch) | |
tree | 4cbafe5de55d01439ec937f73d6f12f2cf87a1bf /src/de/gultsch/chat/services | |
parent | c31101dd6458225a007466a3d58a2f4b591c684f (diff) |
send messages in mucs are no longer displayed twice
Diffstat (limited to 'src/de/gultsch/chat/services')
-rw-r--r-- | src/de/gultsch/chat/services/XmppConnectionService.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/de/gultsch/chat/services/XmppConnectionService.java b/src/de/gultsch/chat/services/XmppConnectionService.java index 3a316fbb..0a189492 100644 --- a/src/de/gultsch/chat/services/XmppConnectionService.java +++ b/src/de/gultsch/chat/services/XmppConnectionService.java @@ -194,9 +194,9 @@ public class XmppConnectionService extends Service { } public void sendMessage(final Account account, final Message message) { - Log.d(LOGTAG, "sending message for " + account.getJid() + " to: " - + message.getCounterpart()); - databaseBackend.createMessage(message); + if (message.getConversation().getMode()==Conversation.MODE_SINGLE) { + databaseBackend.createMessage(message); + } MessagePacket packet = new MessagePacket(); if (message.getConversation().getMode() == Conversation.MODE_SINGLE) { packet.setType(MessagePacket.TYPE_CHAT); @@ -208,8 +208,10 @@ public class XmppConnectionService extends Service { packet.setBody(message.getBody()); if (account.getStatus()==Account.STATUS_ONLINE) { connections.get(account).sendMessagePacket(packet); - message.setStatus(Message.STATUS_SEND); - databaseBackend.updateMessage(message); + if (message.getConversation().getMode()==Conversation.MODE_SINGLE) { + message.setStatus(Message.STATUS_SEND); + databaseBackend.updateMessage(message); + } } } |