mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-24 17:52:17 -05:00
be more restrictive about marking messages as sent_received in muc parser
This commit is contained in:
parent
3e0636367a
commit
ea2ce78d6e
@ -201,12 +201,23 @@ public class Conversation extends AbstractEntity implements Blockable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Message findSentMessageWithUuid(String uuid) {
|
public Message findSentMessageWithUuidOrRemoteId(String id) {
|
||||||
synchronized (this.messages) {
|
synchronized (this.messages) {
|
||||||
for (Message message : this.messages) {
|
for (Message message : this.messages) {
|
||||||
if (uuid.equals(message.getUuid())
|
if (id.equals(message.getUuid())
|
||||||
|| (message.getStatus() >= Message.STATUS_SEND && uuid
|
|| (message.getStatus() >= Message.STATUS_SEND
|
||||||
.equals(message.getRemoteMsgId()))) {
|
&& id.equals(message.getRemoteMsgId()))) {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Message findSentMessageWithUuid(String id) {
|
||||||
|
synchronized (this.messages) {
|
||||||
|
for (Message message : this.messages) {
|
||||||
|
if (id.equals(message.getUuid())) {
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2216,7 +2216,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
|
|||||||
}
|
}
|
||||||
for (Conversation conversation : getConversations()) {
|
for (Conversation conversation : getConversations()) {
|
||||||
if (conversation.getJid().toBareJid().equals(recipient) && conversation.getAccount() == account) {
|
if (conversation.getJid().toBareJid().equals(recipient) && conversation.getAccount() == account) {
|
||||||
final Message message = conversation.findSentMessageWithUuid(uuid);
|
final Message message = conversation.findSentMessageWithUuidOrRemoteId(uuid);
|
||||||
if (message != null) {
|
if (message != null) {
|
||||||
markMessage(message, status);
|
markMessage(message, status);
|
||||||
}
|
}
|
||||||
@ -2226,8 +2226,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean markMessage(Conversation conversation, String uuid,
|
public boolean markMessage(Conversation conversation, String uuid, int status) {
|
||||||
int status) {
|
|
||||||
if (uuid == null) {
|
if (uuid == null) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user