diff options
author | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2023-05-17 01:20:02 +0300 |
---|---|---|
committer | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2023-05-17 01:20:02 +0300 |
commit | 94b51a70df98f32dcac0e90fa92d8fe0d1523987 (patch) | |
tree | e714341157e5589e9d5f259069bd466cc0ef9ac5 /xmpp/gateway | |
parent | 9c28af848d3adc9e998b6456b3ebc71172ca68fd (diff) |
Calls [WIP]calls
Diffstat (limited to 'xmpp/gateway')
-rw-r--r-- | xmpp/gateway/gateway.go | 20 |
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() } |