diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2019-12-09 11:26:32 +0300 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2019-12-09 11:26:32 +0300 |
commit | bb44e61bab711327d1ae9f0d0732364006296c0e (patch) | |
tree | a325d7112fb2baa3e297998b53b36adbfd83e68a /lib | |
parent | aa6486024fda9910cecccfdcefae2b7e3cd0c108 (diff) | |
parent | 77f1ca99ade62565ce30758005b911eb340953e6 (diff) | |
download | libquotient-bb44e61bab711327d1ae9f0d0732364006296c0e.tar.gz libquotient-bb44e61bab711327d1ae9f0d0732364006296c0e.zip |
Merge branch 'kitsune-look-further-for-redactions'
Diffstat (limited to 'lib')
-rw-r--r-- | lib/room.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/room.cpp b/lib/room.cpp index edf732ff..71d76f66 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -2121,12 +2121,10 @@ Room::Changes Room::Private::addNewMessageEvents(RoomEvents&& events) // Try to find the target in the timeline, then in the batch. if (processRedaction(*r)) continue; - auto targetIt = std::find_if(events.begin(), it, - [id = r->redactedEvent()]( - const RoomEventPtr& ep) { - return ep->id() == id; - }); - if (targetIt != it) + if (auto targetIt = std::find_if(events.begin(), events.end(), + [id = r->redactedEvent()](const RoomEventPtr& ep) { + return ep->id() == id; + }); targetIt != events.end()) *targetIt = makeRedacted(**targetIt, *r); else qCDebug(EVENTS) |