fixed private messages

This commit is contained in:
iNPUTmice 2014-11-09 21:14:37 +01:00
parent a45a343604
commit 72068d1a26

View file

@ -23,7 +23,7 @@ public class MessageParser extends AbstractParser implements
} }
private Message parseChat(MessagePacket packet, Account account) { private Message parseChat(MessagePacket packet, Account account) {
final Jid jid = packet.getFrom().toBareJid(); final Jid jid = packet.getFrom();
Conversation conversation = mXmppConnectionService Conversation conversation = mXmppConnectionService
.findOrCreateConversation(account, jid.toBareJid(), false); .findOrCreateConversation(account, jid.toBareJid(), false);
updateLastseen(packet, account, true); updateLastseen(packet, account, true);
@ -42,7 +42,6 @@ public class MessageParser extends AbstractParser implements
if (conversation.getMode() == Conversation.MODE_MULTI if (conversation.getMode() == Conversation.MODE_MULTI
&& !jid.isBareJid()) { && !jid.isBareJid()) {
finishedMessage.setType(Message.TYPE_PRIVATE); finishedMessage.setType(Message.TYPE_PRIVATE);
finishedMessage.setCounterpart(packet.getFrom());
finishedMessage.setTrueCounterpart(conversation.getMucOptions() finishedMessage.setTrueCounterpart(conversation.getMucOptions()
.getTrueCounterpart(jid.getResourcepart())); .getTrueCounterpart(jid.getResourcepart()));
if (conversation.hasDuplicateMessage(finishedMessage)) { if (conversation.hasDuplicateMessage(finishedMessage)) {
@ -50,6 +49,7 @@ public class MessageParser extends AbstractParser implements
} }
} }
finishedMessage.setCounterpart(jid);
finishedMessage.setTime(getTimestamp(packet)); finishedMessage.setTime(getTimestamp(packet));
return finishedMessage; return finishedMessage;
} }