summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2003-11-23 12:39:08 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2003-11-23 12:39:08 +0000
commit393687582907ed939b1586bece8e0b5545e258c5 (patch)
tree6b4c7cffeafc38c2f124902e72c07dd446163a53
parentc074f551bf0efb92851ecbc1ba3df463d83ba7d4 (diff)
downloadirssi-393687582907ed939b1586bece8e0b5545e258c5.zip
netjoin mode fixes
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3183 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r--src/fe-common/irc/fe-netjoin.c18
1 files 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;
}