mirror of
https://github.com/42wim/matterbridge.git
synced 2024-11-15 16:39:26 +01:00
Fix strict user handling of girc (irc). Closes #298
This commit is contained in:
parent
daac3ebca2
commit
bcdecdaa73
@ -81,12 +81,22 @@ func (b *Birc) Connect() error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
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{
|
i := girc.New(girc.Config{
|
||||||
Server: server,
|
Server: server,
|
||||||
ServerPass: b.Config.Password,
|
ServerPass: b.Config.Password,
|
||||||
Port: port,
|
Port: port,
|
||||||
Nick: b.Config.Nick,
|
Nick: b.Config.Nick,
|
||||||
User: b.Config.Nick,
|
User: user,
|
||||||
Name: b.Config.Nick,
|
Name: b.Config.Nick,
|
||||||
SSL: b.Config.UseTLS,
|
SSL: b.Config.UseTLS,
|
||||||
TLSConfig: &tls.Config{InsecureSkipVerify: b.Config.SkipTLSVerify, ServerName: server},
|
TLSConfig: &tls.Config{InsecureSkipVerify: b.Config.SkipTLSVerify, ServerName: server},
|
||||||
|
Loading…
Reference in New Issue
Block a user