diff options
author | Timo Sirainen <cras@irssi.org> | 2002-08-27 19:42:23 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2002-08-27 19:42:23 +0000 |
commit | 1faed99b33cc9d9617f0868964b25cc686aa82bd (patch) | |
tree | c87a6af26377a12d932d2364d0161bade1d4fcf0 /src | |
parent | 746ae090503172f276b0e5e09816d4e122deeb18 (diff) | |
download | irssi-1faed99b33cc9d9617f0868964b25cc686aa82bd.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/irc/core/channels-query.c | 4 | ||||
-rw-r--r-- | src/irc/core/irc-nicklist.c | 4 | ||||
-rw-r--r-- | src/irc/core/modes.c | 6 | ||||
-rw-r--r-- | src/irc/core/modes.h | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/src/irc/core/channels-query.c b/src/irc/core/channels-query.c index bc5ebf3a..6d54ddd9 100644 --- a/src/irc/core/channels-query.c +++ b/src/irc/core/channels-query.c @@ -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); } diff --git a/src/irc/core/irc-nicklist.c b/src/irc/core/irc-nicklist.c index b928ada0..2e100dda 100644 --- a/src/irc/core/irc-nicklist.c +++ b/src/irc/core/irc-nicklist.c @@ -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') { diff --git a/src/irc/core/modes.c b/src/irc/core/modes.c index 946b533b..0fce2e9b 100644 --- a/src/irc/core/modes.c +++ b/src/irc/core/modes.c @@ -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); diff --git a/src/irc/core/modes.h b/src/irc/core/modes.h index d2e10cd9..485b176b 100644 --- a/src/irc/core/modes.h +++ b/src/irc/core/modes.h @@ -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); |