@@ -818,7 +818,11 @@ impl Client {
818818 /// events::{
819819 /// macros::EventContent,
820820 /// push_rules::PushRulesEvent,
821- /// room::{message::SyncRoomMessageEvent, topic::SyncRoomTopicEvent},
821+ /// room::{
822+ /// message::SyncRoomMessageEvent,
823+ /// topic::SyncRoomTopicEvent,
824+ /// member::{StrippedRoomMemberEvent, SyncRoomMemberEvent},
825+ /// },
822826 /// },
823827 /// push::Action,
824828 /// Int, MilliSecondsSinceUnixEpoch,
@@ -871,6 +875,18 @@ impl Client {
871875 /// // Use the context
872876 /// });
873877 ///
878+ /// // This will handle membership events in joined rooms. Invites are special, see below.
879+ /// client.add_event_handler(
880+ /// |ev: SyncRoomMemberEvent| async move {},
881+ /// );
882+ ///
883+ /// // To handle state events in invited rooms (including invite membership events),
884+ /// // `StrippedRoomMemberEvent` should be used.
885+ /// // https://spec.matrix.org/v1.16/client-server-api/#stripped-state
886+ /// client.add_event_handler(
887+ /// |ev: StrippedRoomMemberEvent| async move {},
888+ /// );
889+ ///
874890 /// // Custom events work exactly the same way, you just need to declare
875891 /// // the content struct and use the EventContent derive macro on it.
876892 /// #[derive(Clone, Debug, Deserialize, Serialize, EventContent)]
0 commit comments