aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmpp/handlers.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/xmpp/handlers.go b/xmpp/handlers.go
index 1885aae..08278d2 100644
--- a/xmpp/handlers.go
+++ b/xmpp/handlers.go
@@ -759,9 +759,15 @@ func handleSetQueryCommand(s xmpp.Sender, iq *stanza.IQ, command *stanza.Command
if ok && len(cmd.Arguments) > 0 {
var fields []*stanza.Field
for i, arg := range cmd.Arguments {
+ var required *string
+ if i < cmd.RequiredArgs {
+ dummyString := ""
+ required = &dummyString
+ }
fields = append(fields, &stanza.Field{
- Var: strconv.FormatInt(int64(i), 10),
- Label: arg,
+ Var: strconv.FormatInt(int64(i), 10),
+ Label: arg,
+ Required: required,
})
}
answer.Payload = &stanza.Command{