#[non_exhaustive]pub struct PresenceUpdate {
pub user_id: OwnedUserId,
pub presence: PresenceState,
pub status_msg: Option<String>,
pub last_active_ago: UInt,
pub currently_active: bool,
pub recipients: PresenceRecipientListUpdates,
pub stream_id: Option<Int>,
pub prev_id: Option<Int>,
}api and (crate features client or server) and (crate features federation-api-c or federation-api-s) only.Expand description
An update to the presence of a user.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.user_id: OwnedUserIdThe user ID this presence EDU is for.
presence: PresenceStateThe presence of the user.
status_msg: Option<String>An optional description to accompany the presence.
last_active_ago: UIntThe number of milliseconds that have elapsed since the user last did something.
currently_active: boolWhether or not the user is currently active.
Defaults to false.
recipients: PresenceRecipientListUpdatesunstable-msc4495 only.Changes to the user’s presence recipient list since the last EDU was sent, if any.
This field will only be present if prev_id is also present.
This field uses the unstable prefix defined in MSC4495.
stream_id: Option<Int>unstable-msc4495 only.The stream ID of the user’s current presence recipient list.
This field uses the unstable prefix defined in MSC4495.
prev_id: Option<Int>unstable-msc4495 only.The prior stream ID in the user’s presence delta stream, if any.
If this field does not match the most recently seen stream_id, the presence list should
be re-fetched.
This field uses the unstable prefix defined in MSC4495.
Implementations§
Source§impl PresenceUpdate
impl PresenceUpdate
Sourcepub fn new(
user_id: OwnedUserId,
presence: PresenceState,
last_activity: UInt,
) -> PresenceUpdate
pub fn new( user_id: OwnedUserId, presence: PresenceState, last_activity: UInt, ) -> PresenceUpdate
Creates a new PresenceUpdate with the given user_id, presence and last_activity.
Trait Implementations§
Source§impl Clone for PresenceUpdate
impl Clone for PresenceUpdate
Source§fn clone(&self) -> PresenceUpdate
fn clone(&self) -> PresenceUpdate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more