Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setPresenceStatus: status_msg defaults to undefined #218

Merged
merged 4 commits into from
May 29, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/MatrixClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,11 +371,11 @@ export class MatrixClient extends EventEmitter {
/**
* Sets the presence status for the current user.
* @param {"online"|"offline"|"unavailable"} presence The new presence state for the user.
* @param {string} statusMessage Optional status message to include with the presence.
* @param {string?} statusMessage Optional status message to include with the presence.
* @returns {Promise<any>} Resolves when complete.
*/
@timedMatrixClientFunctionCall()
public async setPresenceStatus(presence: "online" | "offline" | "unavailable", statusMessage: string = null): Promise<any> {
public async setPresenceStatus(presence: "online" | "offline" | "unavailable", statusMessage: string | undefined): Promise<any> {
jaller94 marked this conversation as resolved.
Show resolved Hide resolved
return this.doRequest("PUT", "/_matrix/client/r0/presence/" + encodeURIComponent(await this.getUserId()) + "/status", null, {
presence: presence,
status_msg: statusMessage,
Expand Down