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

Irssi lost channel key for secret/private channels after join.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1835 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-10-14 13:33:22 +00:00 committed by cras
parent 880de0fe12
commit 44270041c2
2 changed files with 18 additions and 6 deletions

View File

@ -408,8 +408,14 @@ static void event_channel_mode(IRC_SERVER_REC *server, const char *data,
params = event_get_params(data, 3 | PARAM_FLAG_GETREST, NULL, &channel, &mode); params = event_get_params(data, 3 | PARAM_FLAG_GETREST, NULL, &channel, &mode);
chanrec = irc_channel_find(server, channel); chanrec = irc_channel_find(server, channel);
if (chanrec != NULL) if (chanrec != NULL) {
if (chanrec->key != NULL && strchr(mode, 'k') == NULL) {
/* we joined the channel with a key,
but it didn't have +k mode.. */
parse_channel_modes(chanrec, NULL, "-k");
}
parse_channel_modes(chanrec, nick, mode); parse_channel_modes(chanrec, nick, mode);
}
channel_got_query(server, chanrec, channel); channel_got_query(server, chanrec, channel);
g_free(params); g_free(params);

View File

@ -93,11 +93,17 @@ static void event_names_list(IRC_SERVER_REC *server, const char *data)
This is actually pretty useless to check here, but at least we This is actually pretty useless to check here, but at least we
get to know if the channel is +p or +s a few seconds before get to know if the channel is +p or +s a few seconds before
we receive the MODE reply... */ we receive the MODE reply...
if (*type == '*')
parse_channel_modes(IRC_CHANNEL(chanrec), NULL, "+p"); If the channel key is set, assume the channel is +k also until
else if (*type == '@') we know better, so parse_channel_modes() won't clear the key */
parse_channel_modes(IRC_CHANNEL(chanrec), NULL, "+s"); if (*type == '*') {
parse_channel_modes(chanrec, NULL,
chanrec->key ? "+kp" : "+p");
} else if (*type == '@') {
parse_channel_modes(chanrec, NULL,
chanrec->key ? "+ks" : "+s");
}
while (*names != '\0') { while (*names != '\0') {
while (*names == ' ') names++; while (*names == ' ') names++;