Files
buny-jabber-bot/internal/jabber/query_version.go
eleksir 7dbd246a5c [WIP] Fix ban by software version, some other under-hood changes
- Use updated version of upstream go-xmpp + fixes on client-side
- Still waiting for https://github.com/xmppo/go-xmpp/pull/215
- Introduce golangci-lint v2 + fixes
2025-11-30 14:19:01 +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
}