Skip to content

Setting the status message for the user's presence #6461

@jannistpl

Description

@jannistpl

Hi everyone,

The matrix specifications allow you to define a status_msg in addition to a user's presence. See: https://spec.matrix.org/v1.18/client-server-api/#put_matrixclientv3presenceuseridstatus

I couldn't find a method in the SDK to set a user's status message. Currently, it seems a user's presence can only be set via the SyncSettings, but there is no option to set the status message.

I also tried using the low-level API of the ruma crate:

use matrix_sdk::ruma::api::client::presence::set_presence::v3::Request;

let mut request = Request::new(user_id.to_owned(), PresenceState::Unavailable);
request.status_msg = Some("Doing some stuff".to_owned());

client.send(request).await;

However, this doesn't seem to work. I suspect this is because the SDK overwrites the presence with every sync.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions