Fix lastactivity behaviour

Autocomplete only completed on|off.

Now:

`/lastactivity get` -> get server uptime
`/lastactivity get <jid>` -> get user lastactivity
`/lastactivity set on` -> enable for self
`/lastactivity set off` -> disable for self

Fix https://github.com/profanity-im/profanity/issues/1411
This commit is contained in:
Michael Vetter
2020-07-22 13:13:30 +02:00
parent 7319f9eb1d
commit a5ca65453e
3 changed files with 68 additions and 27 deletions

View File

@@ -885,25 +885,25 @@ static struct cmd_t command_defs[] = {
},
{ "/lastactivity",
parse_args, 0, 1, NULL,
parse_args, 1, 2, NULL,
CMD_NOSUBFUNCS
CMD_MAINFUNC(cmd_lastactivity)
CMD_TAGS(
CMD_TAG_PRESENCE)
CMD_SYN(
"/lastactivity on|off",
"/lastactivity [<jid>]")
"/lastactivity set on|off",
"/lastactivity get [<jid>]")
CMD_DESC(
"Enable/disable sending last activity, and send last activity requests.")
CMD_ARGS(
{ "on|off", "Enable or disable sending of last activity." },
{ "<jid>", "The JID of the entity to query. Omitting the JID will query your server for its uptime." })
CMD_EXAMPLES(
"/lastactivity",
"/lastactivity off",
"/lastactivity freyja@asgaard.edda",
"/lastactivity freyja@asgaard.edda/laptop",
"/lastactivity someserver.com")
"/lastactivity get",
"/lastactivity set off",
"/lastactivity get freyja@asgaard.edda",
"/lastactivity get freyja@asgaard.edda/laptop",
"/lastactivity get someserver.com")
},
{ "/nick",