From 393687582907ed939b1586bece8e0b5545e258c5 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sun, 23 Nov 2003 12:39:08 +0000 Subject: netjoin mode fixes git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3183 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/irc/fe-netjoin.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/fe-common/irc/fe-netjoin.c b/src/fe-common/irc/fe-netjoin.c index f00f1b03..ec1b745d 100644 --- a/src/fe-common/irc/fe-netjoin.c +++ b/src/fe-common/irc/fe-netjoin.c @@ -325,29 +325,25 @@ static int netjoin_set_nickmode(NETJOIN_REC *rec, const char *channel, char mode) { GSList *pos; - char oldmode = 0; + char *found_chan = NULL; for (pos = rec->now_channels; pos != NULL; pos = pos->next) { char *chan = pos->data; - char *realchannel = chan + - (isnickflag(*chan) && ischannel(chan[1])); - if (strcasecmp(realchannel, channel) == 0) { - if (strcasecmp(chan, channel) != 0) - oldmode = chan[0]; + if (strcasecmp(chan+1, channel) == 0) { + found_chan = chan; break; } } - if (pos == NULL) + if (found_chan == NULL) return FALSE; - if (oldmode == '@') + if (found_chan[0] == '@') return TRUE; - if (oldmode == '%' && mode == '+') + if (found_chan[0] == '%' && mode == '+') return TRUE; - g_free(pos->data); - pos->data = g_strdup_printf("%c%s", mode, channel); + found_chan[0] = mode; return TRUE; } -- cgit v1.2.3