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

netjoins should display the @, + etc. before the nick again.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1488 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-05-11 17:42:05 +00:00 committed by cras
parent f89d89b0e7
commit 0ec7e8ed58

View File

@ -326,22 +326,13 @@ static int netjoin_set_nickmode(NETJOIN_REC *rec, const char *channel,
char mode) char mode)
{ {
GSList *pos; GSList *pos;
char *oldchannel;
pos = gslist_find_icase_string(rec->now_channels, channel); pos = gslist_find_icase_string(rec->now_channels, channel);
if (pos == NULL) if (pos == NULL)
return FALSE; return FALSE;
oldchannel = pos->data;
if (isnickflag(*oldchannel) && mode != '\0') {
/* already set some mode, should we use old or new one? */
if (mode == '+' || (mode == '%' && *oldchannel == '@'))
return TRUE;
}
g_free(pos->data); g_free(pos->data);
pos->data = mode == '\0' ? g_strdup(channel) : pos->data = g_strdup_printf("%c%s", mode, channel);
g_strdup_printf("%c%s", mode, channel);
return TRUE; return TRUE;
} }
@ -355,7 +346,7 @@ static void msg_mode(IRC_SERVER_REC *server, const char *channel,
{ {
NETJOIN_REC *rec; NETJOIN_REC *rec;
char *params, *mode, *nicks; char *params, *mode, *nicks;
char **nicklist, **nick, type; char **nicklist, **nick, type, modechr;
int show; int show;
g_return_if_fail(data != NULL); g_return_if_fail(data != NULL);
@ -379,8 +370,9 @@ static void msg_mode(IRC_SERVER_REC *server, const char *channel,
if (*nick != NULL && isnickmode(*mode)) { if (*nick != NULL && isnickmode(*mode)) {
/* give/remove ops */ /* give/remove ops */
rec = netjoin_find(server, *nick); rec = netjoin_find(server, *nick);
if (rec == NULL || !netjoin_set_nickmode(rec, channel, modechr = nickmodechar(*mode);
nickmodechar(type))) if (rec == NULL || type != '+' || modechr == '\0' ||
!netjoin_set_nickmode(rec, channel, modechr))
show = TRUE; show = TRUE;
nick++; nick++;
} else { } else {