From 9efcc41ab23aaabb935ad18cbb4122579a27a728 Mon Sep 17 00:00:00 2001 From: Wim Date: Sat, 31 Jul 2021 17:17:43 +0200 Subject: Update matterbridge/go-xmpp vendor (#1559) --- vendor/github.com/matterbridge/go-xmpp/xmpp.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'vendor/github.com/matterbridge') diff --git a/vendor/github.com/matterbridge/go-xmpp/xmpp.go b/vendor/github.com/matterbridge/go-xmpp/xmpp.go index 56b08f5b..5b8cdcf7 100644 --- a/vendor/github.com/matterbridge/go-xmpp/xmpp.go +++ b/vendor/github.com/matterbridge/go-xmpp/xmpp.go @@ -335,13 +335,19 @@ func (c *Client) init(o *Options) error { var domain string var user string a := strings.SplitN(o.User, "@", 2) - if len(o.User) > 0 { + // Check if User is not empty. Otherwise, we'll be attempting ANONYMOUS with Host domain. + switch { + case len(o.User) > 0: if len(a) != 2 { return errors.New("xmpp: invalid username (want user@domain): " + o.User) } user = a[0] domain = a[1] - } // Otherwise, we'll be attempting ANONYMOUS + case strings.Contains(o.Host, ":"): + domain = strings.SplitN(o.Host, ":", 2)[0] + default: + domain = o.Host + } // Declare intent to be a jabber client and gather stream features. f, err := c.startStream(o, domain) -- cgit v1.2.3