summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-07-20 12:35:54 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-07-20 12:35:54 +0000
commitb76c7db60e6974507e53a1712ed3407e6e07431e (patch)
tree101886902d5f05ab3fde00c9ec962183a9ef2f24
parent97599703af833aab95c0944f28732bcbdbfac071 (diff)
downloadirssi-b76c7db60e6974507e53a1712ed3407e6e07431e.zip
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
-rw-r--r--src/irc/core/channels.c8
1 files 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);