libduvet/model/client_status
Types
A user’s client status (client_status): each platform they’re connected
on, with their status there. A person shows one status, so each of their
platforms has it; a bot’s connections all count as desktop, as does a
client that doesn’t say its platform. Servers leave it out while the user
is offline, and ones from before it always do.
pub type ClientStatus {
ClientStatus(
platforms: dict.Dict(
client_platform.ClientPlatform,
user_status.UserStatus,
),
)
}
Constructors
-
ClientStatus( platforms: dict.Dict( client_platform.ClientPlatform, user_status.UserStatus, ), )
Values
pub fn from_field(
object: dict.Dict(String, dynamic.Dynamic),
key: String,
) -> option.Option(ClientStatus)
The field’s client status, when it is there and not null.
pub fn from_json(
object: dict.Dict(String, dynamic.Dynamic),
) -> ClientStatus
A platform this package doesn’t name is kept as the server gave it.
pub fn is_mobile_only(status: ClientStatus) -> Bool
They’re connected only from the mobile app: the apps show a phone for them rather than the presence dot.
pub fn status_on(
status: ClientStatus,
platform: client_platform.ClientPlatform,
) -> Result(user_status.UserStatus, Nil)
The user’s status on [platform], when they’re connected there.