This commit is contained in:
kosyak 2024-02-28 19:29:20 +01:00
parent 1726fc86e3
commit dd7a1c1bdb

View file

@ -2341,21 +2341,24 @@ public class XmppConnectionService extends Service {
String replyId = reply.getAttribute("id"); String replyId = reply.getAttribute("id");
if (replyId == null) {
continue;
}
Message replyMessage = null; Message replyMessage = null;
for (Message rep : messages) { for (Message rep : messages) {
if (replyId.equals(rep.getServerMsgId())) { if (StringUtils.equals(replyId,rep.getServerMsgId())) {
replyMessage = rep; replyMessage = rep;
break; break;
} }
if (replyId.equals(rep.getRemoteMsgId())) { if (StringUtils.equals(replyId, rep.getRemoteMsgId())) {
replyMessage = rep; replyMessage = rep;
break; break;
} }
if (replyId.equals(rep.getUuid())) { if (StringUtils.equals(replyId, rep.getUuid())) {
replyMessage = rep; replyMessage = rep;
break; break;
} }
@ -2381,23 +2384,26 @@ public class XmppConnectionService extends Service {
List<Message> restored = databaseBackend.getMessagesByIds(conversation, notFoundReplies.keySet()); List<Message> restored = databaseBackend.getMessagesByIds(conversation, notFoundReplies.keySet());
for (String id : notFoundReplies.keySet()) { for (String id : notFoundReplies.keySet()) {
ArrayList<Message> notFoundRepliesMessages = notFoundReplies.get(id);
if (notFoundRepliesMessages == null) continue;
for (Message m : restored) { for (Message m : restored) {
if (id.equals(m.getServerMsgId())) { if (StringUtils.equals(id, m.getServerMsgId())) {
for (Message rm : notFoundReplies.get(id)) { for (Message rm : notFoundRepliesMessages) {
rm.setReplyMessage(m, true); rm.setReplyMessage(m, true);
} }
break; break;
} }
if (id.equals(m.getRemoteMsgId())) { if (StringUtils.equals(id, m.getRemoteMsgId())) {
for (Message rm : notFoundReplies.get(id)) { for (Message rm : notFoundRepliesMessages) {
rm.setReplyMessage(m, true); rm.setReplyMessage(m, true);
} }
break; break;
} }
if (id.equals(m.getUuid())) { if (StringUtils.equals(id, m.getUuid())) {
for (Message rm : notFoundReplies.get(id)) { for (Message rm : notFoundRepliesMessages) {
rm.setReplyMessage(m, true); rm.setReplyMessage(m, true);
} }
break; break;