Skip to content

Commit

Permalink
Fix setting of status message
Browse files Browse the repository at this point in the history
Seems this actually never worked.
Now it does.

`/status set online "This is my text"`
`/status set away bye`
`/status set away`
  • Loading branch information
jubalh committed Nov 7, 2019
1 parent ecfa2d0 commit b846c49
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/command/cmd_defs.c
Expand Up @@ -516,14 +516,14 @@ static struct cmd_t command_defs[] =
CMD_TAG_CHAT,
CMD_TAG_GROUPCHAT)
CMD_SYN(
"/status set <state> [<message>]",
"/status set <state> [\"<message>\"]",
"/status get <contact>|<nick>")
CMD_DESC(
"/status get: Find out a contact, or room members presence information. "
"/status set: set own status.")
CMD_ARGS(
{ "<state>", "Own status. Possible values: chat, online, away, dnd, xa" },
{ "<message>", "Optional message to use with the status." },
{ "<message>", "Optional message to use with the status. Needs quotation marks if it's more than one word." },
{ "<contact>", "The contact who's presence you which to see." },
{ "<nick>", "If in a chat room, the occupant who's presence you wish to see." })
CMD_EXAMPLES(
Expand Down
4 changes: 4 additions & 0 deletions src/command/cmd_funcs.c
Expand Up @@ -8078,8 +8078,12 @@ _update_presence(const resource_presence_t resource_presence,
{
char *msg = NULL;
int num_args = g_strv_length(args);

// if no message, use status as message
if (num_args == 2) {
msg = args[1];
} else {
msg = args[2];
}

jabber_conn_status_t conn_status = connection_get_status();
Expand Down

0 comments on commit b846c49

Please sign in to comment.