summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Leadbeater <dgl@dgl.cx>2014-06-30 00:10:45 +0100
committerDavid Leadbeater <dgl@dgl.cx>2014-06-30 00:32:21 +0100
commit3698ddfc3baa024304342ed360a6136a40c25d36 (patch)
tree2c244cad4ea5a65d13ffc3d9e7ddd95a515f60cf /src
parente8b0eb4986ee24b83ef185354a931b120b29ad96 (diff)
downloadirssi-3698ddfc3baa024304342ed360a6136a40c25d36.zip
Add NO_ACT checks for DCC messages
Diffstat (limited to 'src')
-rw-r--r--src/fe-common/irc/dcc/fe-dcc-chat-messages.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/fe-common/irc/dcc/fe-dcc-chat-messages.c b/src/fe-common/irc/dcc/fe-dcc-chat-messages.c
index 23ccc943..93e10943 100644
--- a/src/fe-common/irc/dcc/fe-dcc-chat-messages.c
+++ b/src/fe-common/irc/dcc/fe-dcc-chat-messages.c
@@ -25,6 +25,7 @@
#include "irc-servers.h"
#include "irc-queries.h"
#include "dcc-chat.h"
+#include "ignore.h"
#include "module-formats.h"
#include "printtext.h"
@@ -86,12 +87,17 @@ static void sig_message_dcc(CHAT_DCC_REC *dcc, const char *msg)
TEXT_DEST_REC dest;
QUERY_REC *query;
char *tag;
+ int level = MSGLEVEL_DCCMSGS;
tag = g_strconcat("=", dcc->id, NULL);
query = query_find(NULL, tag);
+ if (ignore_check(SERVER(dcc->server), tag, dcc->addrstr, NULL, msg,
+ level | MSGLEVEL_NO_ACT))
+ level |= MSGLEVEL_NO_ACT;
+
format_create_dest_tag(&dest, dcc->server, dcc->servertag, tag,
- MSGLEVEL_DCCMSGS, NULL);
+ level, NULL);
printformat_dest(&dest, query != NULL ? IRCTXT_DCC_MSG_QUERY :
IRCTXT_DCC_MSG, dcc->id, msg);
@@ -103,12 +109,17 @@ static void sig_message_dcc_action(CHAT_DCC_REC *dcc, const char *msg)
TEXT_DEST_REC dest;
QUERY_REC *query;
char *tag;
+ int level = MSGLEVEL_DCCMSGS | MSGLEVEL_ACTIONS;
tag = g_strconcat("=", dcc->id, NULL);
query = query_find(NULL, tag);
+ if (ignore_check(SERVER(dcc->server), tag, dcc->addrstr, NULL, msg,
+ level | MSGLEVEL_NO_ACT))
+ level |= MSGLEVEL_NO_ACT;
+
format_create_dest_tag(&dest, dcc->server, dcc->servertag, tag,
- MSGLEVEL_DCCMSGS | MSGLEVEL_ACTIONS, NULL);
+ level, NULL);
printformat_dest(&dest, query != NULL ? IRCTXT_ACTION_DCC_QUERY :
IRCTXT_ACTION_DCC, dcc->id, msg);
@@ -120,11 +131,16 @@ static void sig_message_dcc_ctcp(CHAT_DCC_REC *dcc, const char *cmd,
{
TEXT_DEST_REC dest;
char *tag;
+ int level = MSGLEVEL_DCCMSGS | MSGLEVEL_CTCPS;
tag = g_strconcat("=", dcc->id, NULL);
+ if (ignore_check(SERVER(dcc->server), tag, dcc->addrstr, NULL, cmd,
+ level | MSGLEVEL_NO_ACT))
+ level |= MSGLEVEL_NO_ACT;
+
format_create_dest_tag(&dest, dcc->server, dcc->servertag, tag,
- MSGLEVEL_DCC | MSGLEVEL_CTCPS, NULL);
+ level, NULL);
printformat_dest(&dest, IRCTXT_DCC_CTCP, dcc->id, cmd, data);
g_free(tag);