summary refs log tree commit diff
path: root/src/Cache_p.h
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-12-27 01:40:03 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2022-12-27 01:40:25 +0100
commitf98b289ba2f8241ebe33da3e4aac9a6e71ca5c3e (patch)
tree1ab2131f42ed214d36f345b49bdc48229d7530b5 /src/Cache_p.h
parentUpdate translations (diff)
downloadnheko-f98b289ba2f8241ebe33da3e4aac9a6e71ca5c3e.tar.xz
Show invite reason in the UI (hidden by default)
Diffstat (limited to 'src/Cache_p.h')
-rw-r--r--src/Cache_p.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Cache_p.h b/src/Cache_p.h
index 5a42c7f9..6712e48e 100644
--- a/src/Cache_p.h
+++ b/src/Cache_p.h
@@ -244,6 +244,8 @@ public:
 
     //! Check if a user is a member of the room.
     bool isRoomMember(const std::string &user_id, const std::string &room_id);
+    std::optional<MemberInfo>
+    getInviteMember(const std::string &room_id, const std::string &user_id);
 
     //
     // Outbound Megolm Sessions
@@ -396,7 +398,7 @@ private:
                   e->content.display_name.empty() ? e->state_key : e->content.display_name;
 
                 // Lightweight representation of a member.
-                MemberInfo tmp{display_name, e->content.avatar_url};
+                MemberInfo tmp{display_name, e->content.avatar_url, e->content.reason};
 
                 membersdb.put(txn, e->state_key, nlohmann::json(tmp).dump());
                 break;
@@ -406,8 +408,8 @@ private:
                 break;
             }
             }
-
-            return;
+            // fallthrough to also store it as state event to eventually migrate away from a
+            // separate members db.
         } else if (std::holds_alternative<StateEvent<Encryption>>(event)) {
             setEncryptedRoom(txn, room_id);
             return;