aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/parser/MessageParser.java
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-06-22 18:21:04 +0200
committeriNPUTmice <daniel@gultsch.de>2014-06-22 18:21:04 +0200
commit1374fed31b96cbe4a16ee6349afe38f9203c8ac4 (patch)
tree6c7403d1743c14fcc20ac42fd50b71f68d6379f7 /src/eu/siacs/conversations/parser/MessageParser.java
parentfafc5306d7856cb258dcacecf91366dfedf85f92 (diff)
fixed #220
Diffstat (limited to 'src/eu/siacs/conversations/parser/MessageParser.java')
-rw-r--r--src/eu/siacs/conversations/parser/MessageParser.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/eu/siacs/conversations/parser/MessageParser.java b/src/eu/siacs/conversations/parser/MessageParser.java
index a435d055..e99892a0 100644
--- a/src/eu/siacs/conversations/parser/MessageParser.java
+++ b/src/eu/siacs/conversations/parser/MessageParser.java
@@ -18,20 +18,24 @@ public class MessageParser extends AbstractParser {
}
public Message parseChat(MessagePacket packet, Account account) {
+ Log.d("xmppService","received message: "+packet.toString());
String[] fromParts = packet.getFrom().split("/");
Conversation conversation = mXmppConnectionService
.findOrCreateConversation(account, fromParts[0], false);
conversation.setLatestMarkableMessageId(getMarkableMessageId(packet));
updateLastseen(packet, account,true);
String pgpBody = getPgpBody(packet);
+ Message finishedMessage;
if (pgpBody != null) {
- return new Message(conversation, packet.getFrom(), pgpBody,
+ finishedMessage = new Message(conversation, packet.getFrom(), pgpBody,
Message.ENCRYPTION_PGP, Message.STATUS_RECIEVED);
} else {
- return new Message(conversation, packet.getFrom(),
+ finishedMessage = new Message(conversation, packet.getFrom(),
packet.getBody(), Message.ENCRYPTION_NONE,
Message.STATUS_RECIEVED);
}
+ finishedMessage.setTime(getTimestamp(packet));
+ return finishedMessage;
}
public Message parseOtrChat(MessagePacket packet, Account account) {