diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-11-19 17:40:42 +0100 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-11-19 17:40:42 +0100 |
commit | e9948f6b8417803e2856f53482d5a158eb9ffa2e (patch) | |
tree | 1d77f062f752a272ec5251104dd08a06f7d5d7a4 | |
parent | cbf42ee12cb214e801a0e8473bae93935f70e394 (diff) |
sent read marker to full jid
-rw-r--r-- | src/main/java/eu/siacs/conversations/entities/Conversation.java | 4 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/XmppConnectionService.java | 15 |
2 files changed, 10 insertions, 9 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java index 4e894b84..8003759d 100644 --- a/src/main/java/eu/siacs/conversations/entities/Conversation.java +++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java @@ -119,7 +119,7 @@ public class Conversation extends AbstractEntity { } } - public String getLatestMarkableMessageId() { + public Message getLatestMarkableMessage() { if (this.messages == null) { return null; } @@ -129,7 +129,7 @@ public class Conversation extends AbstractEntity { if (this.messages.get(i).isRead()) { return null; } else { - return this.messages.get(i).getRemoteMsgId(); + return this.messages.get(i); } } } diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index d181fac3..c82d3374 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -85,6 +85,8 @@ import eu.siacs.conversations.xmpp.OnIqPacketReceived; import eu.siacs.conversations.xmpp.OnMessageAcknowledged; import eu.siacs.conversations.xmpp.OnStatusChanged; import eu.siacs.conversations.xmpp.XmppConnection; +import eu.siacs.conversations.xmpp.forms.Data; +import eu.siacs.conversations.xmpp.forms.Field; import eu.siacs.conversations.xmpp.jid.InvalidJidException; import eu.siacs.conversations.xmpp.jid.Jid; import eu.siacs.conversations.xmpp.jingle.JingleConnectionManager; @@ -1844,15 +1846,14 @@ public class XmppConnectionService extends Service { public void markRead(Conversation conversation, boolean calledByUi) { mNotificationService.clear(conversation); - String id = conversation.getLatestMarkableMessageId(); + final Message markable = conversation.getLatestMarkableMessage(); conversation.markRead(); - if (confirmMessages() && id != null && calledByUi) { - Log.d(Config.LOGTAG, conversation.getAccount().getJid().toBareJid() - + ": sending read marker for " + conversation.getName()); + if (confirmMessages() && markable != null && markable.getRemoteMsgId() != null && calledByUi) { + Log.d(Config.LOGTAG, conversation.getAccount().getJid().toBareJid()+ ": sending read marker to " + markable.getCounterpart().toString()); Account account = conversation.getAccount(); - final Jid to = conversation.getContactJid(); - this.sendMessagePacket(conversation.getAccount(), - mMessageGenerator.confirm(account, to, id)); + final Jid to = markable.getCounterpart(); + MessagePacket packet = mMessageGenerator.confirm(account, to, markable.getRemoteMsgId()); + this.sendMessagePacket(conversation.getAccount(),packet); } if (!calledByUi) { updateConversationUi(); |