summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Leadbeater <dgl@dgl.cx>2014-06-30 09:35:31 +0100
committerDavid Leadbeater <dgl@dgl.cx>2014-06-30 09:35:31 +0100
commita9d9756d4d4aa61e07f98f3d58f5db85cda08437 (patch)
treee18808c2a8b1714c831238745efb05d980c5ad73 /src
parent3698ddfc3baa024304342ed360a6136a40c25d36 (diff)
downloadirssi-a9d9756d4d4aa61e07f98f3d58f5db85cda08437.zip
Make /ignore -replies work with NO_ACT
Diffstat (limited to 'src')
-rw-r--r--src/core/ignore.c51
1 files changed, 26 insertions, 25 deletions
diff --git a/src/core/ignore.c b/src/core/ignore.c
index 63b8f279..af816237 100644
--- a/src/core/ignore.c
+++ b/src/core/ignore.c
@@ -58,30 +58,6 @@ static int ignore_check_replies_rec(IGNORE_REC *rec, CHANNEL_REC *channel,
return FALSE;
}
-#define ignore_match_channel(rec, channel) \
- ((rec)->channels == NULL || ((channel) != NULL && \
- strarray_find((rec)->channels, (channel)) != -1))
-
-static int ignore_check_replies(CHANNEL_REC *chanrec, const char *text)
-{
- GSList *tmp;
-
- if (text == NULL || chanrec == NULL)
- return FALSE;
-
- /* check reply ignores */
- for (tmp = ignores; tmp != NULL; tmp = tmp->next) {
- IGNORE_REC *rec = tmp->data;
-
- if (rec->mask != NULL && rec->replies &&
- ignore_match_channel(rec, chanrec->name) &&
- ignore_check_replies_rec(rec, chanrec, text))
- return TRUE;
- }
-
- return FALSE;
-}
-
static int ignore_match_pattern(IGNORE_REC *rec, const char *text)
{
if (rec->pattern == NULL)
@@ -124,6 +100,31 @@ static int ignore_match_pattern(IGNORE_REC *rec, const char *text)
((rec)->servertag == NULL || \
g_ascii_strcasecmp((server)->tag, (rec)->servertag) == 0)
+#define ignore_match_channel(rec, channel) \
+ ((rec)->channels == NULL || ((channel) != NULL && \
+ strarray_find((rec)->channels, (channel)) != -1))
+
+static int ignore_check_replies(CHANNEL_REC *chanrec, const char *text, int level)
+{
+ GSList *tmp;
+
+ if (text == NULL || chanrec == NULL)
+ return FALSE;
+
+ /* check reply ignores */
+ for (tmp = ignores; tmp != NULL; tmp = tmp->next) {
+ IGNORE_REC *rec = tmp->data;
+
+ if (rec->mask != NULL && rec->replies &&
+ ignore_match_level(rec, level) &&
+ ignore_match_channel(rec, chanrec->name) &&
+ ignore_check_replies_rec(rec, chanrec, text))
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
int ignore_check(SERVER_REC *server, const char *nick, const char *host,
const char *channel, const char *text, int level)
{
@@ -183,7 +184,7 @@ int ignore_check(SERVER_REC *server, const char *nick, const char *host,
if (best_match || (level & MSGLEVEL_PUBLIC) == 0)
return best_match;
- return ignore_check_replies(chanrec, text);
+ return ignore_check_replies(chanrec, text, level);
}
IGNORE_REC *ignore_find(const char *servertag, const char *mask,