From b76c7db60e6974507e53a1712ed3407e6e07431e Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 20 Jul 2000 12:35:54 +0000 Subject: [PATCH] The channel key given in /JOIN should override the one given in setup. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@495 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/irc/core/channels.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/irc/core/channels.c b/src/irc/core/channels.c index 1048b202..445bc1e4 100644 --- a/src/irc/core/channels.c +++ b/src/irc/core/channels.c @@ -192,13 +192,13 @@ void channels_join(IRC_SERVER_REC *server, const char *data, int automatic) schannel = channels_setup_find(channel, server->connrec->ircnet); g_string_sprintfa(outchans, "%s,", channel); - if (schannel == NULL || schannel->password == NULL) { - key = *tmpkey == NULL || **tmpkey == '\0' ? NULL : *tmpkey; - } else { + if (*tmpkey != NULL && **tmpkey != '\0') + key = *tmpkey; + else if (schannel != NULL && schannel->password != NULL) { /* get password from setup record */ use_keys = TRUE; key = schannel->password; - } + } else key = NULL; g_string_sprintfa(outkeys, "%s,", get_join_key(key)); chanrec = channel_create(server, channel + (channel[0] == '!' && channel[1] == '!'), automatic);