summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-01-30 01:57:34 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-01-30 01:57:34 +0000
commit05ecb785fb463e5fa51869d11c031883d1d7380c (patch)
tree2597a44d4f479572b6004b49c0e8dce67d4589b9 /src
parent0edf041e14f7f76c320323e29428456b60f8b792 (diff)
downloadirssi-05ecb785fb463e5fa51869d11c031883d1d7380c.zip
"/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
Diffstat (limited to 'src')
-rw-r--r--src/irc/core/modes.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/irc/core/modes.c b/src/irc/core/modes.c
index 84ac123a..b8c98b37 100644
--- a/src/irc/core/modes.c
+++ b/src/irc/core/modes.c
@@ -531,7 +531,18 @@ void channel_set_mode(IRC_SERVER_REC *server, const char *channel,
count++;
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);
}
}