Add option to only allow messages from jids in roster

`/silence on` will throw away all messages (type: chat, normal) that
come from jids that are not in the roster.

Implement https://github.com/profanity-im/profanity/issues/955
This commit is contained in:
Michael Vetter
2021-07-01 18:02:03 +02:00
parent 226cffe75b
commit 06482fdaef
9 changed files with 62 additions and 1 deletions

View File

@@ -2622,6 +2622,20 @@ static struct cmd_t command_defs[] = {
CMD_NOEXAMPLES
},
{ "/silence",
parse_args, 1, 1, &cons_silence_setting,
CMD_NOSUBFUNCS
CMD_MAINFUNC(cmd_silence)
CMD_TAGS(
CMD_TAG_CHAT)
CMD_SYN(
"/silence on|off")
CMD_DESC(
"Let's you silence all message attempts from people who are not in your roster.")
CMD_NOARGS
CMD_NOEXAMPLES
},
// NEXT-COMMAND (search helper)
};