aboutsummaryrefslogtreecommitdiff
path: root/lib/room.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-12-09 11:26:32 +0300
committerKitsune Ral <Kitsune-Ral@users.sf.net>2019-12-09 11:26:32 +0300
commitbb44e61bab711327d1ae9f0d0732364006296c0e (patch)
treea325d7112fb2baa3e297998b53b36adbfd83e68a /lib/room.cpp
parentaa6486024fda9910cecccfdcefae2b7e3cd0c108 (diff)
parent77f1ca99ade62565ce30758005b911eb340953e6 (diff)
downloadlibquotient-bb44e61bab711327d1ae9f0d0732364006296c0e.tar.gz
libquotient-bb44e61bab711327d1ae9f0d0732364006296c0e.zip
Merge branch 'kitsune-look-further-for-redactions'
Diffstat (limited to 'lib/room.cpp')
-rw-r--r--lib/room.cpp10
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)