aboutsummaryrefslogtreecommitdiff
path: root/lib/room.cpp
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-30 16:19:31 +0900
commit01c5a35398a55dfc4a30e466aeb13419387555d3 (patch)
tree591d14e746e3d8d80e85154b80964c743aed4a60 /lib/room.cpp
parent57cf115d713bf02d0ba97a7a1f2e3874be8080e3 (diff)
downloadlibquotient-01c5a35398a55dfc4a30e466aeb13419387555d3.tar.gz
libquotient-01c5a35398a55dfc4a30e466aeb13419387555d3.zip
Room::processRedaction(): avoid accidental creation of entries in currentState; cleanup
Diffstat (limited to 'lib/room.cpp')
-rw-r--r--lib/room.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/room.cpp b/lib/room.cpp
index 2930875f..19658be0 100644
--- a/lib/room.cpp
+++ b/lib/room.cpp
@@ -1966,10 +1966,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))
@@ -2170,7 +2170,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