diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-11-05 07:54:29 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-11-05 07:59:54 +0900 |
commit | bbfdedbc941e3eb53252ce7144fac787e64a6c2e (patch) | |
tree | e073890aff986a51043dcde0dacf3dd2b7343612 /lib | |
parent | ce3c66a55fce969753c587bd664fd51bd4fa900c (diff) | |
download | libquotient-bbfdedbc941e3eb53252ce7144fac787e64a6c2e.tar.gz libquotient-bbfdedbc941e3eb53252ce7144fac787e64a6c2e.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.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/room.cpp b/lib/room.cpp index f8ed2721..143e17b1 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -1285,15 +1285,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) |