- 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
37 lines
651 B
Go
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
|
|
}
|