aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-03-29 13:02:12 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2019-03-29 13:02:12 +0900
commit3d13e32530990569a418449c86d9848fd71490e4 (patch)
tree2d53f45f3f7798470e243ee8175403597c091f2a /lib
parentc659d18f36aa9f587003d5f50a9734c85d684a7c (diff)
downloadlibquotient-3d13e32530990569a418449c86d9848fd71490e4.tar.gz
libquotient-3d13e32530990569a418449c86d9848fd71490e4.zip
Room::processRedaction(): avoid accidental creation of entries in
currentState; cleanup
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 4ce1bee3..38f5c4ac 100644
--- a/lib/room.cpp
+++ b/lib/room.cpp
@@ -1959,10 +1959,10 @@ bool Room::Private::processRedaction(const RedactionEvent& redaction)
{
const StateEventKey evtKey { oldEvent->matrixType(), oldEvent->stateKey() };
Q_ASSERT(currentState.contains(evtKey));
- if (currentState[evtKey] == oldEvent.get())
+ if (currentState.value(evtKey) == oldEvent.get())
{
Q_ASSERT(ti.index() >= 0); // Historical states can't be in currentState
- qCDebug(MAIN).nospace() << "Reverting state "
+ qCDebug(MAIN).nospace() << "Redacting state "
<< oldEvent->matrixType() << "/" << oldEvent->stateKey();
// Retarget the current state to the newly made event.
if (q->processStateEvent(*ti))
@@ -2163,7 +2163,7 @@ Room::Changes Room::processStateEvent(const RoomEvent& e)
Q_ASSERT(!oldStateEvent ||
(oldStateEvent->matrixType() == e.matrixType() &&
oldStateEvent->stateKey() == e.stateKey()));
- if (!is<RoomMemberEvent>(e))
+ if (!is<RoomMemberEvent>(e)) // Room member events are too numerous
qCDebug(EVENTS) << "Room state event:" << e;
return visit(e