9 #include <Quotient/quotient_common.h>
14 Q_IMPLICIT MemberEventContent(Membership ms) : membership(ms) {}
15 explicit MemberEventContent(
const QJsonObject& json);
16 QJsonObject toJson()
const;
18 Membership membership;
20 bool isDirect =
false;
21 std::optional<QString> displayName;
22 std::optional<QUrl> avatarUrl;
27 :
public KeyedStateEventBase<RoomMemberEvent, MemberEventContent> {
30 QUO_EVENT(RoomMemberEvent,
"m.room.member")
32 static bool isValid(
const QJsonObject& fullJson)
34 return !fullJson[StateKeyKey].toString().isEmpty();
37 using KeyedStateEventBase::KeyedStateEventBase;
39 Membership membership()
const {
return content().membership; }
40 QString userId()
const {
return stateKey(); }
41 bool isDirect()
const {
return content().isDirect; }
42 std::optional<QString> newDisplayName()
const {
return content().displayName; }
43 std::optional<QUrl> newAvatarUrl()
const {
return content().avatarUrl; }
44 QString reason()
const {
return content().reason; }
45 bool changesMembership()
const;
48 bool isInvite()
const;
49 bool isRejectedInvite()
const;
52 bool isRename()
const;
53 bool isAvatarUpdate()
const;