From 9af48920f66dc545075d734b9e7e4fc13b256039 Mon Sep 17 00:00:00 2001 From: Denis Kasak Date: Wed, 1 Jul 2020 10:39:45 +0200 Subject: [PATCH] Add some TODOs and FIXMEs. --- matrix_sdk_base/src/models/room_member.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/matrix_sdk_base/src/models/room_member.rs b/matrix_sdk_base/src/models/room_member.rs index 0db41cb3..3b7639c1 100644 --- a/matrix_sdk_base/src/models/room_member.rs +++ b/matrix_sdk_base/src/models/room_member.rs @@ -25,6 +25,7 @@ use crate::identifiers::UserId; use crate::js_int::{Int, UInt}; use serde::{Deserialize, Serialize}; + // Notes: if Alice invites Bob into a room we will get an event with the sender as Alice and the state key as Bob. #[derive(Debug, Serialize, Deserialize, Clone)] @@ -55,6 +56,14 @@ pub struct RoomMember { pub power_level_norm: Option, /// The human readable name of this room member. pub name: String, + // FIXME: The docstring below is currently a lie since we only store the initial event that + // creates the member (the one we pass to RoomMember::new). + // + // The intent of this field is to keep the last (or last few?) state events related to the room + // member cached so we can quickly go back to the previous one in case some of them get + // redacted. Keeping all state for each room member is probably too much. + // + // Needs design. /// The events that created the state of this room member. #[serde(deserialize_with = "super::event_deser::deserialize_events")] pub events: Vec, @@ -116,6 +125,7 @@ impl RoomMember { } /// Handle profile updates. + // TODO: NEXT: Add disambiguation handling here pub(crate) fn update_profile(&mut self, event: &MemberEvent) -> bool { self.display_name = event.content.displayname.clone(); self.avatar_url = event.content.avatar_url.clone();