aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-11-05 07:54:29 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-11-05 07:54:29 +0900
commitbe7d25ed22abd07a254bfb8ff6c30de4fcc79e6a (patch)
tree5990b36b1600a9da823b9e12e13a79acccd3ba75 /lib
parenta81383549df4db8a487a847dca41900f3ab38c27 (diff)
downloadlibquotient-be7d25ed22abd07a254bfb8ff6c30de4fcc79e6a.tar.gz
libquotient-be7d25ed22abd07a254bfb8ff6c30de4fcc79e6a.zip
isEchoEvent: check the pending event for ids, not the synced one
Synced events always have their event ids, so checking those for event id renders most of the function useless (and returns an incorrect result). Closes #248.
Diffstat (limited to 'lib')
-rw-r--r--lib/room.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/room.cpp b/lib/room.cpp
index 9cdacd91..cd4d4dca 100644
--- a/lib/room.cpp
+++ b/lib/room.cpp
@@ -1300,15 +1300,15 @@ bool isEchoEvent(const RoomEventPtr& le, const PendingEventItem& re)
if (le->type() != re->type())
return false;
- if (!le->id().isEmpty())
+ if (!re->id().isEmpty())
return le->id() == re->id();
- if (!le->transactionId().isEmpty())
+ if (!re->transactionId().isEmpty())
return le->transactionId() == re->transactionId();
// This one is not reliable (there can be two unsynced
// events with the same type, sender and state key) but
// it's the best we have for state events.
- if (le->isStateEvent())
+ if (re->isStateEvent())
return le->stateKey() == re->stateKey();
// Empty id and no state key, hmm... (shrug)