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

Merge pull request #1164 from ailin-nemui/modes-noact

fix /ignore ... MODES NO_ACT not working
This commit is contained in:
ailin-nemui 2020-04-03 10:20:52 +02:00 committed by GitHub
commit 46ae8c20c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,6 +36,7 @@
typedef struct { typedef struct {
IRC_CHANNEL_REC *channel; IRC_CHANNEL_REC *channel;
int level;
char *mode; char *mode;
GSList *nicks; GSList *nicks;
time_t last_mode; time_t last_mode;
@ -84,9 +85,8 @@ static void print_mode(MODE_REC *rec)
tmp = modes; modes = NULL; tmp = modes; modes = NULL;
nicks = gslist_to_string(rec->nicks, ", "); nicks = gslist_to_string(rec->nicks, ", ");
printformat(rec->channel->server, rec->channel->visible_name, printformat(rec->channel->server, rec->channel->visible_name, rec->level,
MSGLEVEL_MODES, IRCTXT_CHANMODE_CHANGE, IRCTXT_CHANMODE_CHANGE, rec->channel->visible_name, rec->mode, nicks, "");
rec->channel->visible_name, rec->mode, nicks, "");
g_free(nicks); g_free(nicks);
modes = tmp; modes = tmp;
@ -126,7 +126,7 @@ static int sig_check_modes(void)
return 1; return 1;
} }
static void msg_multi_mode(IRC_CHANNEL_REC *channel, const char *sender, static void msg_multi_mode(IRC_CHANNEL_REC *channel, int level, const char *sender,
const char *addr, const char *mode) const char *addr, const char *mode)
{ {
MODE_REC *rec; MODE_REC *rec;
@ -147,10 +147,13 @@ static void msg_multi_mode(IRC_CHANNEL_REC *channel, const char *sender,
rec = g_new0(MODE_REC, 1); rec = g_new0(MODE_REC, 1);
modes = g_slist_append(modes, rec); modes = g_slist_append(modes, rec);
rec->level = level;
rec->channel = channel; rec->channel = channel;
rec->mode = g_strdup(mode); rec->mode = g_strdup(mode);
} }
/* the levels (everything below MSGLEVEL_ALL) are combined (|)
whereas the flags (anything above) must all match (&) */
rec->level = ((rec->level | level) & MSGLEVEL_ALL) | (rec->level & level);
rec->nicks = g_slist_append(rec->nicks, g_strdup(sender)); rec->nicks = g_slist_append(rec->nicks, g_strdup(sender));
rec->last_mode = time(NULL); rec->last_mode = time(NULL);
@ -187,7 +190,7 @@ static void sig_message_mode(IRC_SERVER_REC *server, const char *channel,
irc_channel_find(server, channel); irc_channel_find(server, channel);
if (chanrec != NULL && g_ascii_strcasecmp(nick, server->nick) != 0) if (chanrec != NULL && g_ascii_strcasecmp(nick, server->nick) != 0)
msg_multi_mode(chanrec, nick, addr, mode); msg_multi_mode(chanrec, level, nick, addr, mode);
else { else {
printformat(server, channel, level, printformat(server, channel, level,
IRCTXT_CHANMODE_CHANGE, IRCTXT_CHANMODE_CHANGE,