mirror of
https://github.com/42wim/matterbridge.git
synced 2024-11-14 16:09:26 +01:00
Add PASS support as per RFC1459
Provide a connection password via the protocol's PASS command. Imported irc.go supports it as a simple parameter: https://github.com/thoj/go-ircevent/blob/master/irc.go#L381 See https://tools.ietf.org/html/rfc1459#section-4.1 for full details.
This commit is contained in:
parent
c7ace91bf6
commit
fd74dca175
@ -13,6 +13,7 @@ type Config struct {
|
|||||||
Server string
|
Server string
|
||||||
Port int
|
Port int
|
||||||
Nick string
|
Nick string
|
||||||
|
Password string
|
||||||
Channel string
|
Channel string
|
||||||
}
|
}
|
||||||
Mattermost struct {
|
Mattermost struct {
|
||||||
|
@ -41,6 +41,9 @@ func (b *Bridge) createIRC(name string) *irc.Connection {
|
|||||||
i := irc.IRC(b.Config.IRC.Nick, b.Config.IRC.Nick)
|
i := irc.IRC(b.Config.IRC.Nick, b.Config.IRC.Nick)
|
||||||
i.UseTLS = b.Config.IRC.UseTLS
|
i.UseTLS = b.Config.IRC.UseTLS
|
||||||
i.TLSConfig = &tls.Config{InsecureSkipVerify: b.Config.IRC.SkipTLSVerify}
|
i.TLSConfig = &tls.Config{InsecureSkipVerify: b.Config.IRC.SkipTLSVerify}
|
||||||
|
if b.Config.IRC.Password != "" {
|
||||||
|
i.Password = b.Config.IRC.Password
|
||||||
|
}
|
||||||
i.Connect(b.Config.IRC.Server + ":" + strconv.Itoa(b.Config.IRC.Port))
|
i.Connect(b.Config.IRC.Server + ":" + strconv.Itoa(b.Config.IRC.Port))
|
||||||
time.Sleep(time.Second)
|
time.Sleep(time.Second)
|
||||||
log.Println("Joining", b.Config.IRC.Channel, "as", b.Config.IRC.Nick)
|
log.Println("Joining", b.Config.IRC.Channel, "as", b.Config.IRC.Nick)
|
||||||
|
Loading…
Reference in New Issue
Block a user