Files
buny-jabber-bot/internal/jabber/query_version.go
eleksir 3d85dbcb58 [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
2025-12-16 00:51:10 +03:00

37 lines
651 B
Go

package jabber
import (
"buny-jabber-bot/internal/log"
"fmt"
"github.com/google/uuid"
"github.com/xmppo/go-xmpp"
)
// QuerySoftwareVersion запрашивает версию и название клиента.
func (j *Jabber) QuerySoftwareVersion(jid string) (string, error) {
var (
id string
err error
)
if id, err = j.Talk.RawInformationQuery(
j.Talk.JID(),
jid,
uuid.New().String(),
xmpp.IQTypeGet,
"jabber:iq:version",
"",
); err != nil {
err = fmt.Errorf(
"unable to query software version of jid=%s err=%w",
jid,
err,
)
} else {
log.Infof("Query software version of %s", jid)
}
return id, err
}