aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBohdan Horbeshko <bodqhrohro@gmail.com>2024-05-11 02:53:16 +0300
committerBohdan Horbeshko <bodqhrohro@gmail.com>2024-05-11 02:53:16 +0300
commit249c942fc2d9f017ffb66c98f22e7f2a2c40ad2a (patch)
tree495f0ae87a3d11857da0895abc8fdd87a8639025
parent9aec929e71c9a05a9b31d29607bf9dc2a99d070e (diff)
Allow empty form for mute/unmute commands
-rw-r--r--xmpp/handlers.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/xmpp/handlers.go b/xmpp/handlers.go
index 1d77bc4..1a47c10 100644
--- a/xmpp/handlers.go
+++ b/xmpp/handlers.go
@@ -808,6 +808,13 @@ func handleSetQueryCommand(s xmpp.Sender, iq *stanza.IQ, command *stanza.Command
members, err := session.GetChatMembers(toId, true, "", membersList)
if err == nil {
fieldType = stanza.FieldTypeListSingle
+ switch command.Node {
+ // allow empty form
+ case "mute", "unmute":
+ options = append(options, stanza.Option{
+ ValuesList: []string{""},
+ })
+ }
for _, member := range members {
senderId := session.GetSenderId(member.MemberId)
options = append(options, stanza.Option{