[WIP] Fix ban by software version, some other under-hood changes

- Use updated version of upstream go-xmpp + fixes on client-side
- Introduce golangci-lint v2 + fixes
- Move especially noisy debugging stuff to separate config handles to be able to switch them off
- Add a bit debug to ban by software path
This commit is contained in:
eleksir
2025-11-30 14:19:01 +03:00
parent a128b473ff
commit 3d85dbcb58
55 changed files with 4165 additions and 13190 deletions

110
vendor/github.com/xmppo/go-xmpp/xmpp_disco.go generated vendored Normal file
View File

@@ -0,0 +1,110 @@
package xmpp
import (
"encoding/xml"
)
type clientDiscoFeature struct {
XMLName xml.Name `xml:"feature"`
Var string `xml:"var,attr"`
}
type clientDiscoIdentity struct {
XMLName xml.Name `xml:"identity"`
Category string `xml:"category,attr"`
Type string `xml:"type,attr"`
Name string `xml:"name,attr"`
}
type clientDiscoQuery struct {
XMLName xml.Name `xml:"query"`
Features []clientDiscoFeature `xml:"feature"`
Identities []clientDiscoIdentity `xml:"identity"`
X []DiscoX `xml:"x"`
}
type clientDiscoItem struct {
XMLName xml.Name `xml:"item"`
Jid string `xml:"jid,attr"`
Node string `xml:"node,attr"`
Name string `xml:"name,attr"`
}
type clientDiscoItemsQuery struct {
XMLName xml.Name `xml:"query"`
Items []clientDiscoItem `xml:"item"`
}
type DiscoIdentity struct {
Category string
Type string
Name string
}
type DiscoItem struct {
Jid string
Name string
Node string
}
type DiscoResult struct {
ID string
From string
To string
Features []string
Identities []DiscoIdentity
X []DiscoX
}
type DiscoX struct {
XMLName xml.Name `xml:"x"`
Field []DiscoXField `xml:"field"`
}
type DiscoXField struct {
Type string `xml:"type,attr"`
Var string `xml:"var,attr"`
Value []string `xml:"value"`
}
type DiscoItems struct {
Jid string
Items []DiscoItem
}
func clientFeaturesToReturn(features []clientDiscoFeature) []string {
var ret []string
for _, feature := range features {
ret = append(ret, feature.Var)
}
return ret
}
func clientIdentitiesToReturn(identities []clientDiscoIdentity) []DiscoIdentity {
var ret []DiscoIdentity
for _, id := range identities {
ret = append(ret, DiscoIdentity{
Category: id.Category,
Type: id.Type,
Name: id.Name,
})
}
return ret
}
func clientDiscoItemsToReturn(items []clientDiscoItem) []DiscoItem {
var ret []DiscoItem
for _, item := range items {
ret = append(ret, DiscoItem{
Jid: item.Jid,
Name: item.Name,
Node: item.Node,
})
}
return ret
}