1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

"/MODE #channel -k" automatically appends the channel key if it wasn't

given.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2360 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-01-30 01:57:34 +00:00 committed by cras
parent 0edf041e14
commit 05ecb785fb

View File

@ -531,7 +531,18 @@ void channel_set_mode(IRC_SERVER_REC *server, const char *channel,
count++; count++;
arg = cmd_get_param(&modestr); arg = cmd_get_param(&modestr);
if (*arg != '\0') g_string_sprintfa(targs, " %s", arg); if (*arg == '\0' && type == '-' && *curmode == 'k') {
/* "/mode #channel -k" - no reason why it
shouldn't work really, so append the key */
IRC_CHANNEL_REC *chanrec;
chanrec = irc_channel_find(server, channel);
if (chanrec != NULL && chanrec->key != NULL)
arg = chanrec->key;
}
if (*arg != '\0')
g_string_sprintfa(targs, " %s", arg);
} }
} }