diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-10-19 08:12:50 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-10-19 08:14:56 +0900 |
commit | ecc364d4ad752b34e41b717e3deff4d17a840378 (patch) | |
tree | ca1077fb3a751ad01f6638ee5733ddd4583d005f /events | |
parent | 8800690c691dc9534fdb0f2d902862f816704d50 (diff) | |
parent | f2f85ba093df5dcd991fd206af4d79d57f4c7fc8 (diff) | |
download | libquotient-ecc364d4ad752b34e41b717e3deff4d17a840378.tar.gz libquotient-ecc364d4ad752b34e41b717e3deff4d17a840378.zip |
Merge branch 'master' into kitsune-gtad
Diffstat (limited to 'events')
-rw-r--r-- | events/roommemberevent.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/events/roommemberevent.cpp b/events/roommemberevent.cpp index 5973acc7..19f116d2 100644 --- a/events/roommemberevent.cpp +++ b/events/roommemberevent.cpp @@ -22,6 +22,9 @@ using namespace QMatrixClient; +static const auto membershipStrings = + { "invite", "join", "knock", "leave", "ban" }; + RoomMemberEvent::RoomMemberEvent(const QJsonObject& obj) : RoomEvent(Type::RoomMember, obj), _userId(obj["state_key"].toString()) { @@ -29,11 +32,10 @@ RoomMemberEvent::RoomMemberEvent(const QJsonObject& obj) _displayName = contentObj["displayname"].toString(); _avatarUrl = contentObj["avatar_url"].toString(); QString membershipString = contentObj["membership"].toString(); - const auto supportedStrings = { "invite", "join", "knock", "leave", "ban" }; - for (auto it = supportedStrings.begin(); it != supportedStrings.end(); ++it) + for (auto it = membershipStrings.begin(); it != membershipStrings.end(); ++it) if (membershipString == *it) { - _membership = MembershipType(it - supportedStrings.begin()); + _membership = MembershipType(it - membershipStrings.begin()); return; } qCWarning(EVENTS) << "Unknown MembershipType: " << membershipString; |