aboutsummaryrefslogtreecommitdiff
path: root/lib/events/roommemberevent.cpp
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-12-17 08:07:07 +0100
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-12-17 08:07:07 +0100
commite5256e0b1e4c43ce96d99d1b82ca5d98a1baded6 (patch)
tree3e25f47d794dbb7444ca50ff1f70283012f669e9 /lib/events/roommemberevent.cpp
parent90b4ac346ac253345aca2b9a3c98df75d9c058d3 (diff)
downloadlibquotient-e5256e0b1e4c43ce96d99d1b82ca5d98a1baded6.tar.gz
libquotient-e5256e0b1e4c43ce96d99d1b82ca5d98a1baded6.zip
RoomMemberEvent: fix an off-by-one error
Also: extended quotest to cover member renames, not just user profile renames.
Diffstat (limited to 'lib/events/roommemberevent.cpp')
-rw-r--r--lib/events/roommemberevent.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/events/roommemberevent.cpp b/lib/events/roommemberevent.cpp
index b0bc7bcb..3141f6b5 100644
--- a/lib/events/roommemberevent.cpp
+++ b/lib/events/roommemberevent.cpp
@@ -48,11 +48,9 @@ void MemberEventContent::fillJson(QJsonObject* o) const
{
Q_ASSERT(o);
if (membership != Membership::Invalid)
- o->insert(
- QStringLiteral("membership"),
- MembershipStrings[qCountTrailingZeroBits(
- std::underlying_type_t<Membership>(membership))
- + 1]);
+ o->insert(QStringLiteral("membership"),
+ MembershipStrings[qCountTrailingZeroBits(
+ std::underlying_type_t<Membership>(membership))]);
if (displayName)
o->insert(QStringLiteral("displayname"), *displayName);
if (avatarUrl && avatarUrl->isValid())