summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-11-11 23:16:58 +0100
committerWim <wim@42.be>2017-11-11 23:16:58 +0100
commitbcdecdaa73531464084b060f2777887befc0382d (patch)
tree2c70284f59b35d5d5c12bb1544f26c3fd602c7a6
parentdaac3ebca27e8559f79b189bab85b1008e7a3543 (diff)
downloadmatterbridge-msglm-bcdecdaa73531464084b060f2777887befc0382d.tar.gz
matterbridge-msglm-bcdecdaa73531464084b060f2777887befc0382d.tar.bz2
matterbridge-msglm-bcdecdaa73531464084b060f2777887befc0382d.zip
Fix strict user handling of girc (irc). Closes #298
-rw-r--r--bridge/irc/irc.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/bridge/irc/irc.go b/bridge/irc/irc.go
index e3191a93..78981f08 100644
--- a/bridge/irc/irc.go
+++ b/bridge/irc/irc.go
@@ -81,12 +81,22 @@ func (b *Birc) Connect() error {
if err != nil {
return err
}
+ // fix strict user handling of girc
+ user := b.Config.Nick
+ for !girc.IsValidUser(user) {
+ if len(user) == 1 {
+ user = "matterbridge"
+ break
+ }
+ user = user[1:]
+ }
+
i := girc.New(girc.Config{
Server: server,
ServerPass: b.Config.Password,
Port: port,
Nick: b.Config.Nick,
- User: b.Config.Nick,
+ User: user,
Name: b.Config.Nick,
SSL: b.Config.UseTLS,
TLSConfig: &tls.Config{InsecureSkipVerify: b.Config.SkipTLSVerify, ServerName: server},