fixed #651
This commit is contained in:
parent
46e319b241
commit
e623e28487
|
@ -458,6 +458,18 @@ public class Conversation extends AbstractEntity {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Message findSentMessageWithBody(String body) {
|
||||||
|
synchronized (this.messages) {
|
||||||
|
for (int i = this.getMessages().size() - 1; i >= 0; --i) {
|
||||||
|
Message message = this.messages.get(i);
|
||||||
|
if ((message.getStatus() == Message.STATUS_UNSEND || message.getStatus() == Message.STATUS_SEND) && message.getBody() != null && message.getBody().equals(body)) {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void setMutedTill(long value) {
|
public void setMutedTill(long value) {
|
||||||
this.setAttribute(ATTRIBUTE_MUTED_TILL, String.valueOf(value));
|
this.setAttribute(ATTRIBUTE_MUTED_TILL, String.valueOf(value));
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,6 +158,14 @@ public class MessageParser extends AbstractParser implements
|
||||||
if (mXmppConnectionService.markMessage(conversation,
|
if (mXmppConnectionService.markMessage(conversation,
|
||||||
packet.getId(), Message.STATUS_SEND)) {
|
packet.getId(), Message.STATUS_SEND)) {
|
||||||
return null;
|
return null;
|
||||||
|
} else if (packet.getId() == null) {
|
||||||
|
Message message = conversation.findSentMessageWithBody(packet.getBody());
|
||||||
|
if (message != null) {
|
||||||
|
mXmppConnectionService.markMessage(message,Message.STATUS_SEND_RECEIVED);
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
status = Message.STATUS_SEND;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
status = Message.STATUS_SEND;
|
status = Message.STATUS_SEND;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue