aboutsummaryrefslogtreecommitdiff
path: root/xmpp/gateway/gateway.go
diff options
context:
space:
mode:
Diffstat (limited to 'xmpp/gateway/gateway.go')
-rw-r--r--xmpp/gateway/gateway.go20
1 files changed, 18 insertions, 2 deletions
diff --git a/xmpp/gateway/gateway.go b/xmpp/gateway/gateway.go
index 9cd2102..94fb13d 100644
--- a/xmpp/gateway/gateway.go
+++ b/xmpp/gateway/gateway.go
@@ -469,6 +469,22 @@ func discoToCaps(disco *stanza.DiscoInfo) string {
s.WriteString(">")
}
- for disco
- s.WriteString(
+ if disco.Form != nil {
+ fields := make([]*stanza.Field, len(disco.Form.Fields))
+ copy(fields, disco.Form.Fields)
+ sort.Slice(fields, func(a, b *stanza.Field) bool {
+ if a.Var == "FORM_TYPE" {
+ return true
+ }
+ if b.Var == "FORM_TYPE" {
+ return false
+ }
+ return a.Var < b.Var
+ })
+ for _, field := range fields {
+
+ }
+ }
+
+ return s.String()
}