Skip to content

Status message can't be cleared until client is restarted #5072

@NoahvdAa

Description

@NoahvdAa

If I set my presence and add a status text like this:

mx.setPresence({
    presence: 'online',
    status_msg: 'Hello world!'
});

My status text in mx.getUser(mx.getUserId())?.presenceStatusMsg is updated to return 'Hello world!'.

If I then try to clear it like so:

mx.setPresence({
    presence: 'online',
    //status_msg: 'Hello world!'
});

The status text in mx.getUser(mx.getUserId())?.presenceStatusMsg will still return Hello world instead of undefined/null.

This behaviour happens because the event handler checks whether the status_msg has a value before updating it:

if (event.getContent().status_msg) {
this.presenceStatusMsg = event.getContent().status_msg;
}

When I restart my client, the text is gone correctly. From my quick testing synapse seems to always include the status text in the presence if it is set, so maybe the value check can just be dropped? Not sure how other server implementations handle that though...

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-PresenceO-OccasionalAffects or can be seen by some users regularly or most users rarelyS-MinorImpairs non-critical functionality or suitable workarounds existT-Defect

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions