sent read marker to full jid
This commit is contained in:
parent
cbf42ee12c
commit
e9948f6b84
|
@ -119,7 +119,7 @@ public class Conversation extends AbstractEntity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLatestMarkableMessageId() {
|
public Message getLatestMarkableMessage() {
|
||||||
if (this.messages == null) {
|
if (this.messages == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -129,7 +129,7 @@ public class Conversation extends AbstractEntity {
|
||||||
if (this.messages.get(i).isRead()) {
|
if (this.messages.get(i).isRead()) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return this.messages.get(i).getRemoteMsgId();
|
return this.messages.get(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,6 +85,8 @@ import eu.siacs.conversations.xmpp.OnIqPacketReceived;
|
||||||
import eu.siacs.conversations.xmpp.OnMessageAcknowledged;
|
import eu.siacs.conversations.xmpp.OnMessageAcknowledged;
|
||||||
import eu.siacs.conversations.xmpp.OnStatusChanged;
|
import eu.siacs.conversations.xmpp.OnStatusChanged;
|
||||||
import eu.siacs.conversations.xmpp.XmppConnection;
|
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.InvalidJidException;
|
||||||
import eu.siacs.conversations.xmpp.jid.Jid;
|
import eu.siacs.conversations.xmpp.jid.Jid;
|
||||||
import eu.siacs.conversations.xmpp.jingle.JingleConnectionManager;
|
import eu.siacs.conversations.xmpp.jingle.JingleConnectionManager;
|
||||||
|
@ -1844,15 +1846,14 @@ public class XmppConnectionService extends Service {
|
||||||
|
|
||||||
public void markRead(Conversation conversation, boolean calledByUi) {
|
public void markRead(Conversation conversation, boolean calledByUi) {
|
||||||
mNotificationService.clear(conversation);
|
mNotificationService.clear(conversation);
|
||||||
String id = conversation.getLatestMarkableMessageId();
|
final Message markable = conversation.getLatestMarkableMessage();
|
||||||
conversation.markRead();
|
conversation.markRead();
|
||||||
if (confirmMessages() && id != null && calledByUi) {
|
if (confirmMessages() && markable != null && markable.getRemoteMsgId() != null && calledByUi) {
|
||||||
Log.d(Config.LOGTAG, conversation.getAccount().getJid().toBareJid()
|
Log.d(Config.LOGTAG, conversation.getAccount().getJid().toBareJid()+ ": sending read marker to " + markable.getCounterpart().toString());
|
||||||
+ ": sending read marker for " + conversation.getName());
|
|
||||||
Account account = conversation.getAccount();
|
Account account = conversation.getAccount();
|
||||||
final Jid to = conversation.getContactJid();
|
final Jid to = markable.getCounterpart();
|
||||||
this.sendMessagePacket(conversation.getAccount(),
|
MessagePacket packet = mMessageGenerator.confirm(account, to, markable.getRemoteMsgId());
|
||||||
mMessageGenerator.confirm(account, to, id));
|
this.sendMessagePacket(conversation.getAccount(),packet);
|
||||||
}
|
}
|
||||||
if (!calledByUi) {
|
if (!calledByUi) {
|
||||||
updateConversationUi();
|
updateConversationUi();
|
||||||
|
|
Loading…
Reference in a new issue