class documentation

class UserPresence(UserIdentity, Protocol):

Known subclasses: server.protocols.UserProtocol

View In Hierarchy

Tracks whether the user currently has active sessions.

Async Method add_session Register an active session for the user.
Async Method remove_session Unregister a previously added active session.
Property present Whether the user currently has at least one active session.
Property sessions Active sessions (Read-only).

Inherited from UserIdentity:

Property full_name Absolute username.
Property name Unique username.
async def add_session(self, session: SessionProtocol):

Register an active session for the user.

async def remove_session(self, session: SessionProtocol):

Unregister a previously added active session.

@property
present: bool =

Whether the user currently has at least one active session.

@property
sessions: set[SessionProtocol] =

Active sessions (Read-only).