Make use of FAST configurable.

This commit is contained in:
Martin Dosch 2024-05-11 15:05:41 +02:00
parent 4be597a84a
commit e9123cc4b3

View File

@ -262,6 +262,9 @@ type Options struct {
// MUST be a valid UUIDv4
UserAgentID string
// Enable XEP-0484: Fast Authentication Streamlining Tokens
Fast bool
// XEP-0484: Fast Authentication Streamlining Tokens
// Fast Token
FastToken string
@ -625,7 +628,7 @@ func (c *Client) init(o *Options) error {
if o.UserAgentID != "" {
userAgentID = fmt.Sprintf(" id='%s'", o.UserAgentID)
}
if f.Authentication.Inline.Fast.Mechanism != nil && o.UserAgentID != "" && c.IsEncrypted() {
if o.Fast && f.Authentication.Inline.Fast.Mechanism != nil && o.UserAgentID != "" && c.IsEncrypted() {
var mech string
if o.FastToken == "" {
m := f.Authentication.Inline.Fast.Mechanism