Only use the default password when connecting to the default server

This commit is contained in:
Ken-Håvard Lieng 2016-01-27 18:21:36 +01:00
parent 2e8418516a
commit f678aaed8e

View File

@ -94,10 +94,11 @@ func (h *wsHandler) connect(b []byte) {
i := irc.NewClient(data.Nick, data.Username)
i.TLS = data.TLS
i.Password = data.Password
i.Realname = data.Realname
if data.Password == "" && viper.GetString("defaults.password") != "" {
if data.Password == "" &&
viper.GetString("defaults.password") != "" &&
data.Server == viper.GetString("defaults.address") {
i.Password = viper.GetString("defaults.password")
} else {
i.Password = data.Password