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

Don't update channel key from 324 numeric, some servers send channel key as

"*" in it which breaks irssi.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2905 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-08-27 19:42:23 +00:00 committed by cras
parent 746ae09050
commit 1faed99b33
4 changed files with 8 additions and 8 deletions

View File

@ -405,9 +405,9 @@ static void event_channel_mode(IRC_SERVER_REC *server, const char *data,
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, NULL, "-k", TRUE);
}
parse_channel_modes(chanrec, nick, mode);
parse_channel_modes(chanrec, nick, mode, FALSE);
channel_got_query(chanrec, CHANNEL_QUERY_MODE);
}

View File

@ -101,10 +101,10 @@ static void event_names_list(IRC_SERVER_REC *server, const char *data)
we know better, so parse_channel_modes() won't clear the key */
if (*type == '*') {
parse_channel_modes(chanrec, NULL,
chanrec->key ? "+kp" : "+p");
chanrec->key ? "+kp" : "+p", FALSE);
} else if (*type == '@') {
parse_channel_modes(chanrec, NULL,
chanrec->key ? "+ks" : "+s");
chanrec->key ? "+ks" : "+s", FALSE);
}
while (*names != '\0') {

View File

@ -198,7 +198,7 @@ int channel_mode_is_set(IRC_CHANNEL_REC *channel, char mode)
/* Parse channel mode string */
void parse_channel_modes(IRC_CHANNEL_REC *channel, const char *setby,
const char *mode)
const char *mode, int update_key)
{
GString *newmode;
char *dup, *modestr, *arg, *curmode, type;
@ -256,7 +256,7 @@ void parse_channel_modes(IRC_CHANNEL_REC *channel, const char *setby,
}
mode_set_arg(newmode, type, 'k', arg);
if (arg != channel->key) {
if (arg != channel->key && update_key) {
g_free_and_null(channel->key);
if (type == '+')
channel->key = g_strdup(arg);
@ -382,7 +382,7 @@ static void event_mode(IRC_SERVER_REC *server, const char *data,
/* channel mode change */
chanrec = irc_channel_find(server, channel);
if (chanrec != NULL)
parse_channel_modes(chanrec, nick, mode);
parse_channel_modes(chanrec, nick, mode, TRUE);
}
g_free(params);

View File

@ -29,7 +29,7 @@ char *modes_join(const char *old, const char *mode, int channel);
int channel_mode_is_set(IRC_CHANNEL_REC *channel, char mode);
void parse_channel_modes(IRC_CHANNEL_REC *channel, const char *setby,
const char *modestr);
const char *modestr, int update_key);
void channel_set_singlemode(IRC_CHANNEL_REC *channel, const char *nicks,
const char *mode);