mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Don't break the API.
Have a ignore_find_full method that is the one that all the new code should be using and provide some working stubs for ignore_find and ignore_find_noact.
This commit is contained in:
parent
609f3ba6c2
commit
dbee606c60
@ -186,7 +186,7 @@ int ignore_check(SERVER_REC *server, const char *nick, const char *host,
|
|||||||
return ignore_check_replies(chanrec, text, level);
|
return ignore_check_replies(chanrec, text, level);
|
||||||
}
|
}
|
||||||
|
|
||||||
IGNORE_REC *ignore_find(const char *servertag, const char *mask, const char *pattern,
|
IGNORE_REC *ignore_find_full(const char *servertag, const char *mask, const char *pattern,
|
||||||
char **channels, const int flags)
|
char **channels, const int flags)
|
||||||
{
|
{
|
||||||
GSList *tmp;
|
GSList *tmp;
|
||||||
@ -257,6 +257,16 @@ IGNORE_REC *ignore_find(const char *servertag, const char *mask, const char *pat
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IGNORE_REC *ignore_find(const char *servertag, const char *mask, char **channels)
|
||||||
|
{
|
||||||
|
return ignore_find_full(servertag, mask, NULL, channels, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
IGNORE_REC *ignore_find_noact(const char *servertag, const char *mask, char **channels, int noact)
|
||||||
|
{
|
||||||
|
return ignore_find_full(servertag, mask, NULL, channels, IGNORE_FIND_NOACT);
|
||||||
|
}
|
||||||
|
|
||||||
static void ignore_set_config(IGNORE_REC *rec)
|
static void ignore_set_config(IGNORE_REC *rec)
|
||||||
{
|
{
|
||||||
CONFIG_NODE *node;
|
CONFIG_NODE *node;
|
||||||
|
@ -36,9 +36,14 @@ enum {
|
|||||||
IGNORE_FIND_NOACT = 0x02, // Exclude the targets with NOACT level
|
IGNORE_FIND_NOACT = 0x02, // Exclude the targets with NOACT level
|
||||||
};
|
};
|
||||||
|
|
||||||
IGNORE_REC *ignore_find(const char *servertag, const char *mask, const char *pattern,
|
IGNORE_REC *ignore_find_full (const char *servertag, const char *mask, const char *pattern,
|
||||||
char **channels, const int flags);
|
char **channels, const int flags);
|
||||||
|
|
||||||
|
// Convenience wrappers around ignore_find_full, for compatibility purpose
|
||||||
|
|
||||||
|
IGNORE_REC *ignore_find(const char *servertag, const char *mask, char **channels);
|
||||||
|
IGNORE_REC *ignore_find_noact(const char *servertag, const char *mask, char **channels, int noact);
|
||||||
|
|
||||||
void ignore_add_rec(IGNORE_REC *rec);
|
void ignore_add_rec(IGNORE_REC *rec);
|
||||||
void ignore_update_rec(IGNORE_REC *rec);
|
void ignore_update_rec(IGNORE_REC *rec);
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@ static void cmd_ignore(const char *data)
|
|||||||
channels = (chanarg == NULL || *chanarg == '\0') ? NULL :
|
channels = (chanarg == NULL || *chanarg == '\0') ? NULL :
|
||||||
g_strsplit(chanarg, ",", -1);
|
g_strsplit(chanarg, ",", -1);
|
||||||
|
|
||||||
rec = ignore_find(servertag, mask, patternarg, channels,
|
rec = ignore_find_full(servertag, mask, patternarg, channels,
|
||||||
IGNORE_FIND_PATTERN | ((level & MSGLEVEL_NO_ACT) ? IGNORE_FIND_NOACT : 0));
|
IGNORE_FIND_PATTERN | ((level & MSGLEVEL_NO_ACT) ? IGNORE_FIND_NOACT : 0));
|
||||||
new_ignore = rec == NULL;
|
new_ignore = rec == NULL;
|
||||||
|
|
||||||
@ -237,9 +237,9 @@ static void cmd_unignore(const char *data)
|
|||||||
chans[0] = mask;
|
chans[0] = mask;
|
||||||
mask = NULL;
|
mask = NULL;
|
||||||
}
|
}
|
||||||
rec = ignore_find("*", mask, NULL, (char **) chans, 0);
|
rec = ignore_find_full("*", mask, NULL, (char **) chans, 0);
|
||||||
if (rec == NULL) {
|
if (rec == NULL) {
|
||||||
rec = ignore_find("*", mask, NULL, (char **) chans, IGNORE_FIND_NOACT);
|
rec = ignore_find_full("*", mask, NULL, (char **) chans, IGNORE_FIND_NOACT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ static void sig_flood(IRC_SERVER_REC *server, const char *nick, const char *host
|
|||||||
|
|
||||||
mask = g_strdup_printf("%s!%s", nick, host);
|
mask = g_strdup_printf("%s!%s", nick, host);
|
||||||
if (level & check_level) {
|
if (level & check_level) {
|
||||||
rec = ignore_find(server->tag, mask, NULL, NULL, 0);
|
rec = ignore_find_full(server->tag, mask, NULL, NULL, 0);
|
||||||
if (rec == NULL)
|
if (rec == NULL)
|
||||||
autoignore_add(server, mask, level);
|
autoignore_add(server, mask, level);
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user