|
|
|
@ -557,7 +557,8 @@ func handleGetDiscoItems(s xmpp.Sender, iq *stanza.IQ, di *stanza.DiscoItems) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
commands := telegram.GetCommands(cmdType)
|
|
|
|
|
for name, command := range commands {
|
|
|
|
|
for _, name := range telegram.SortedCommandKeys(commands) {
|
|
|
|
|
command := commands[name]
|
|
|
|
|
di.AddItem(iq.To, name, telegram.CommandToHelpString(name, command))
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
@ -759,9 +760,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{
|
|
|
|
|