summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/channels.h4
-rw-r--r--include/modules.h6
-rw-r--r--src/channels.cpp26
-rw-r--r--src/cmd_notice.cpp13
-rw-r--r--src/cmd_privmsg.cpp15
-rw-r--r--src/modules.cpp4
-rw-r--r--src/modules/m_blockcaps.cpp6
-rw-r--r--src/modules/m_blockcolor.cpp6
-rw-r--r--src/modules/m_censor.cpp6
-rw-r--r--src/modules/m_chanfilter.cpp6
-rw-r--r--src/modules/m_dccallow.cpp6
-rw-r--r--src/modules/m_filter.h10
-rw-r--r--src/modules/m_noctcp.cpp6
-rw-r--r--src/modules/m_nonotice.cpp2
-rw-r--r--src/modules/m_restrictbanned.cpp6
-rw-r--r--src/modules/m_restrictmsg.cpp6
-rw-r--r--src/modules/m_services.cpp6
-rw-r--r--src/modules/m_services_account.cpp6
-rw-r--r--src/modules/m_silence.cpp6
-rw-r--r--src/modules/m_silence_ext.cpp9
-rw-r--r--src/modules/m_stripcolor.cpp6
21 files changed, 100 insertions, 61 deletions
diff --git a/include/channels.h b/include/channels.h
index 648723b09..70e5c2233 100644
--- a/include/channels.h
+++ b/include/channels.h
@@ -416,6 +416,8 @@ class chanrec : public Extensible
*/
void WriteAllExceptSender(userrec* user, bool serversource, char status, char* text, ...);
+ void WriteAllExcept(userrec* user, bool serversource, char status, CUList &except_list, char* text, ...);
+
/** Write to all users on a channel except a specific user, using std::string for text
* @param user User whos details to prefix the line with, and to omit from receipt of the message
* @param serversource If this parameter is true, use the local server name as the source of the text, otherwise,
@@ -425,6 +427,8 @@ class chanrec : public Extensible
*/
void WriteAllExceptSender(userrec* user, bool serversource, char status, const std::string& text);
+ void WriteAllExcept(userrec* user, bool serversource, char status, CUList &except_list, const std::string& text);
+
/** Returns the maximum number of bans allowed to be set on this channel
* @return The maximum number of bans allowed
*/
diff --git a/include/modules.h b/include/modules.h
index 8e2746bf0..57fbc03b6 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -74,7 +74,7 @@ enum TargetTypeFlags {
* ipv4 servers, so this value will be ten times as
* high on ipv6 servers.
*/
-#define NATIVE_API_VERSION 11004
+#define NATIVE_API_VERSION 11005
#ifdef IPV6
#define API_VERSION (NATIVE_API_VERSION * 10)
#else
@@ -613,7 +613,7 @@ class Module : public Extensible
* @param status The status being used, e.g. PRIVMSG @#chan has status== '@', 0 to send to everyone.
* @return 1 to deny the NOTICE, 0 to allow it
*/
- virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text,char status);
+ virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text,char status, CUList &exempt_list);
/** Called whenever a user is about to NOTICE A user or a channel, before any processing is done.
* Returning any nonzero value from this function stops the process immediately, causing no
@@ -632,7 +632,7 @@ class Module : public Extensible
* @param status The status being used, e.g. PRIVMSG @#chan has status== '@', 0 to send to everyone.
* @return 1 to deny the NOTICE, 0 to allow it
*/
- virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text,char status);
+ virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text,char status, CUList &exempt_list);
/** Called before any nickchange, local or remote. This can be used to implement Q-lines etc.
* Please note that although you can see remote nickchanges through this function, you should
diff --git a/src/channels.cpp b/src/channels.cpp
index 948b49a0b..7a6f85469 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -695,7 +695,22 @@ void chanrec::WriteAllExceptSender(userrec* user, bool serversource, char status
this->WriteAllExceptSender(user, serversource, status, std::string(textbuffer));
}
-void chanrec::WriteAllExceptSender(userrec* user, bool serversource, char status, const std::string& text)
+void chanrec::WriteAllExcept(userrec* user, bool serversource, char status, CUList &except_list, char* text, ...)
+{
+ char textbuffer[MAXBUF];
+ va_list argsPtr;
+
+ if (!text)
+ return;
+
+ va_start(argsPtr, text);
+ vsnprintf(textbuffer, MAXBUF, text, argsPtr);
+ va_end(argsPtr);
+
+ this->WriteAllExcept(user, serversource, status, except_list, std::string(textbuffer));
+}
+
+void chanrec::WriteAllExcept(userrec* user, bool serversource, char status, CUList &except_list, const std::string &text)
{
CUList *ulist;
@@ -717,7 +732,7 @@ void chanrec::WriteAllExceptSender(userrec* user, bool serversource, char status
for (CUList::iterator i = ulist->begin(); i != ulist->end(); i++)
{
- if ((IS_LOCAL(i->second)) && (user != i->second))
+ if ((IS_LOCAL(i->second)) && (except_list.find(i->second) == except_list.end()))
{
if (serversource)
i->second->WriteServ(text);
@@ -727,6 +742,13 @@ void chanrec::WriteAllExceptSender(userrec* user, bool serversource, char status
}
}
+void chanrec::WriteAllExceptSender(userrec* user, bool serversource, char status, const std::string& text)
+{
+ CUList except_list;
+ except_list[user] = user;
+ this->WriteAllExcept(user, serversource, status, except_list, std::string(text));
+}
+
/*
* return a count of the users on a specific channel accounting for
* invisible users who won't increase the count. e.g. for /LIST
diff --git a/src/cmd_notice.cpp b/src/cmd_notice.cpp
index d947c70be..c9c06ff67 100644
--- a/src/cmd_notice.cpp
+++ b/src/cmd_notice.cpp
@@ -32,6 +32,8 @@ CmdResult cmd_notice::Handle (const char** parameters, int pcnt, userrec *user)
userrec *dest;
chanrec *chan;
+ CUList exempt_list;
+
user->idle_lastmsg = ServerInstance->Time();
if (ServerInstance->Parser->LoopCall(user, this, parameters, pcnt, 0))
@@ -40,7 +42,7 @@ CmdResult cmd_notice::Handle (const char** parameters, int pcnt, userrec *user)
{
int MOD_RESULT = 0;
std::string temp = parameters[1];
- FOREACH_RESULT(I_OnUserPreNotice,OnUserPreNotice(user,(void*)parameters[0],TYPE_SERVER,temp,0));
+ FOREACH_RESULT(I_OnUserPreNotice,OnUserPreNotice(user,(void*)parameters[0],TYPE_SERVER,temp,0,exempt_list));
if (MOD_RESULT)
return CMD_FAILURE;
parameters[1] = (char*)temp.c_str();
@@ -62,6 +64,9 @@ CmdResult cmd_notice::Handle (const char** parameters, int pcnt, userrec *user)
if (*parameters[0] == '#')
{
chan = ServerInstance->FindChan(parameters[0]);
+
+ exempt_list[user] = user;
+
if (chan)
{
if (IS_LOCAL(user))
@@ -81,7 +86,7 @@ CmdResult cmd_notice::Handle (const char** parameters, int pcnt, userrec *user)
int MOD_RESULT = 0;
std::string temp = parameters[1];
- FOREACH_RESULT(I_OnUserPreNotice,OnUserPreNotice(user,chan,TYPE_CHANNEL,temp,status));
+ FOREACH_RESULT(I_OnUserPreNotice,OnUserPreNotice(user,chan,TYPE_CHANNEL,temp,status, exempt_list));
if (MOD_RESULT) {
return CMD_FAILURE;
}
@@ -93,7 +98,7 @@ CmdResult cmd_notice::Handle (const char** parameters, int pcnt, userrec *user)
return CMD_FAILURE;
}
- chan->WriteAllExceptSender(user, false, status, "NOTICE %s :%s", chan->name, parameters[1]);
+ chan->WriteAllExcept(user, false, status, exempt_list, "NOTICE %s :%s", chan->name, parameters[1]);
FOREACH_MOD(I_OnUserNotice,OnUserNotice(user,chan,TYPE_CHANNEL,parameters[1],status));
}
@@ -112,7 +117,7 @@ CmdResult cmd_notice::Handle (const char** parameters, int pcnt, userrec *user)
int MOD_RESULT = 0;
std::string temp = parameters[1];
- FOREACH_RESULT(I_OnUserPreNotice,OnUserPreNotice(user,dest,TYPE_USER,temp,0));
+ FOREACH_RESULT(I_OnUserPreNotice,OnUserPreNotice(user,dest,TYPE_USER,temp,0,exempt_list));
if (MOD_RESULT) {
return CMD_FAILURE;
}
diff --git a/src/cmd_privmsg.cpp b/src/cmd_privmsg.cpp
index aba8ae12d..d3d7e483e 100644
--- a/src/cmd_privmsg.cpp
+++ b/src/cmd_privmsg.cpp
@@ -33,6 +33,8 @@ CmdResult cmd_privmsg::Handle (const char** parameters, int pcnt, userrec *user)
userrec *dest;
chanrec *chan;
+ CUList except_list;
+
user->idle_lastmsg = ServerInstance->Time();
if (ServerInstance->Parser->LoopCall(user, this, parameters, pcnt, 0))
@@ -42,7 +44,7 @@ CmdResult cmd_privmsg::Handle (const char** parameters, int pcnt, userrec *user)
{
int MOD_RESULT = 0;
std::string temp = parameters[1];
- FOREACH_RESULT(I_OnUserPreMessage,OnUserPreMessage(user,(void*)parameters[0],TYPE_SERVER,temp,0));
+ FOREACH_RESULT(I_OnUserPreMessage,OnUserPreMessage(user,(void*)parameters[0],TYPE_SERVER,temp,0,except_list));
if (MOD_RESULT)
return CMD_FAILURE;
parameters[1] = (char*)temp.c_str();
@@ -64,6 +66,9 @@ CmdResult cmd_privmsg::Handle (const char** parameters, int pcnt, userrec *user)
if (parameters[0][0] == '#')
{
chan = ServerInstance->FindChan(parameters[0]);
+
+ except_list[user] = user;
+
if (chan)
{
if (IS_LOCAL(user))
@@ -82,7 +87,7 @@ CmdResult cmd_privmsg::Handle (const char** parameters, int pcnt, userrec *user)
int MOD_RESULT = 0;
std::string temp = parameters[1];
- FOREACH_RESULT(I_OnUserPreMessage,OnUserPreMessage(user,chan,TYPE_CHANNEL,temp,status));
+ FOREACH_RESULT(I_OnUserPreMessage,OnUserPreMessage(user,chan,TYPE_CHANNEL,temp,status,except_list));
if (MOD_RESULT) {
return CMD_FAILURE;
}
@@ -93,8 +98,8 @@ CmdResult cmd_privmsg::Handle (const char** parameters, int pcnt, userrec *user)
user->WriteServ("412 %s No text to send", user->nick);
return CMD_FAILURE;
}
-
- chan->WriteAllExceptSender(user, false, status, "PRIVMSG %s :%s", chan->name, parameters[1]);
+
+ chan->WriteAllExcept(user, false, status, except_list, "PRIVMSG %s :%s", chan->name, parameters[1]);
FOREACH_MOD(I_OnUserMessage,OnUserMessage(user,chan,TYPE_CHANNEL,parameters[1],status));
}
else
@@ -118,7 +123,7 @@ CmdResult cmd_privmsg::Handle (const char** parameters, int pcnt, userrec *user)
int MOD_RESULT = 0;
std::string temp = parameters[1];
- FOREACH_RESULT(I_OnUserPreMessage,OnUserPreMessage(user,dest,TYPE_USER,temp,0));
+ FOREACH_RESULT(I_OnUserPreMessage,OnUserPreMessage(user,dest,TYPE_USER,temp,0,except_list));
if (MOD_RESULT) {
return CMD_FAILURE;
}
diff --git a/src/modules.cpp b/src/modules.cpp
index 8f5e427d9..a8e7a2f75 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -122,8 +122,8 @@ void Module::OnPostOper(userrec* user, const std::string &opertype) { };
void Module::OnInfo(userrec* user) { };
void Module::OnWhois(userrec* source, userrec* dest) { };
int Module::OnUserPreInvite(userrec* source,userrec* dest,chanrec* channel) { return 0; };
-int Module::OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text,char status) { return 0; };
-int Module::OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text,char status) { return 0; };
+int Module::OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text,char status, CUList &exempt_list) { return 0; };
+int Module::OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text,char status, CUList &exempt_list) { return 0; };
int Module::OnUserPreNick(userrec* user, const std::string &newnick) { return 0; };
void Module::OnUserPostNick(userrec* user, const std::string &oldnick) { };
int Module::OnAccessCheck(userrec* source,userrec* dest,chanrec* channel,int access_type) { return ACR_DEFAULT; };
diff --git a/src/modules/m_blockcaps.cpp b/src/modules/m_blockcaps.cpp
index e4f655760..830b05ae9 100644
--- a/src/modules/m_blockcaps.cpp
+++ b/src/modules/m_blockcaps.cpp
@@ -72,7 +72,7 @@ public:
List[I_OnUserPreMessage] = List[I_OnUserPreNotice] = 1;
}
- virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status)
+ virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
if (target_type == TYPE_CHANNEL)
{
@@ -96,9 +96,9 @@ public:
return 0;
}
- virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status)
+ virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
- return OnUserPreMessage(user,dest,target_type,text,status);
+ return OnUserPreMessage(user,dest,target_type,text,status,exempt_list);
}
virtual ~ModuleBlockCAPS()
diff --git a/src/modules/m_blockcolor.cpp b/src/modules/m_blockcolor.cpp
index 967e8fd02..f62e54613 100644
--- a/src/modules/m_blockcolor.cpp
+++ b/src/modules/m_blockcolor.cpp
@@ -73,7 +73,7 @@ class ModuleBlockColour : public Module
List[I_OnUserPreMessage] = List[I_OnUserPreNotice] = 1;
}
- virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status)
+ virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
if (target_type == TYPE_CHANNEL)
{
@@ -102,9 +102,9 @@ class ModuleBlockColour : public Module
return 0;
}
- virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status)
+ virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
- return OnUserPreMessage(user,dest,target_type,text,status);
+ return OnUserPreMessage(user,dest,target_type,text,status,exempt_list);
}
virtual ~ModuleBlockColour()
diff --git a/src/modules/m_censor.cpp b/src/modules/m_censor.cpp
index 5cdee215d..657ad7f44 100644
--- a/src/modules/m_censor.cpp
+++ b/src/modules/m_censor.cpp
@@ -139,7 +139,7 @@ class ModuleCensor : public Module
}
// format of a config entry is <badword text="shit" replace="poo">
- virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status)
+ virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
bool active = false;
irc::string text2 = text.c_str();
@@ -168,9 +168,9 @@ class ModuleCensor : public Module
return 0;
}
- virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status)
+ virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
- return OnUserPreMessage(user,dest,target_type,text,status);
+ return OnUserPreMessage(user,dest,target_type,text,status,exempt_list);
}
virtual void OnRehash(const std::string &parameter)
diff --git a/src/modules/m_chanfilter.cpp b/src/modules/m_chanfilter.cpp
index c600740da..51bc2092a 100644
--- a/src/modules/m_chanfilter.cpp
+++ b/src/modules/m_chanfilter.cpp
@@ -116,7 +116,7 @@ class ModuleChanFilter : public Module
return 0;
}
- virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status)
+ virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
if (target_type == TYPE_CHANNEL)
{
@@ -130,9 +130,9 @@ class ModuleChanFilter : public Module
cf->DoCleanup(target_type, item);
}
- virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status)
+ virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
- return OnUserPreMessage(user,dest,target_type,text,status);
+ return OnUserPreMessage(user,dest,target_type,text,status,exempt_list);
}
virtual void OnSyncChannel(chanrec* chan, Module* proto, void* opaque)
diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp
index 5fb64a27e..95644a4e9 100644
--- a/src/modules/m_dccallow.cpp
+++ b/src/modules/m_dccallow.cpp
@@ -289,12 +289,12 @@ class ModuleDCCAllow : public Module
return 0;
}
- virtual int OnUserPreMessage(userrec* user, void* dest, int target_type, std::string &text, char status)
+ virtual int OnUserPreMessage(userrec* user, void* dest, int target_type, std::string &text, char status, CUList &exempt_list)
{
- return OnUserPreNotice(user, dest, target_type, text, status);
+ return OnUserPreNotice(user, dest, target_type, text, status, exempt_list);
}
- virtual int OnUserPreNotice(userrec* user, void* dest, int target_type, std::string &text, char status)
+ virtual int OnUserPreNotice(userrec* user, void* dest, int target_type, std::string &text, char status, CUList &exempt_list)
{
Expire();
diff --git a/src/modules/m_filter.h b/src/modules/m_filter.h
index 0e0ca067e..abacb1f1d 100644
--- a/src/modules/m_filter.h
+++ b/src/modules/m_filter.h
@@ -46,7 +46,7 @@ class FilterBase : public Module
FilterBase(InspIRCd* Me, const std::string &source);
virtual ~FilterBase();
virtual void Implements(char* List);
- virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status);
+ virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list);
virtual FilterResult* FilterMatch(const std::string &text) = 0;
virtual bool DeleteFilter(const std::string &freeform) = 0;
@@ -54,7 +54,7 @@ class FilterBase : public Module
virtual void SendFilter(Module* proto, void* opaque, FilterResult* iter);
virtual std::pair<bool, std::string> AddFilter(const std::string &freeform, const std::string &type, const std::string &reason, long duration) = 0;
- virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status);
+ virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list);
virtual void OnRehash(const std::string &parameter);
virtual Version GetVersion();
std::string EncodeFilter(FilterResult* filter);
@@ -168,12 +168,12 @@ void FilterBase::Implements(char* List)
List[I_OnStats] = List[I_OnSyncOtherMetaData] = List[I_OnDecodeMetaData] = List[I_OnUserPreMessage] = List[I_OnUserPreNotice] = List[I_OnRehash] = 1;
}
-int FilterBase::OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status)
+int FilterBase::OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
- return OnUserPreNotice(user,dest,target_type,text,status);
+ return OnUserPreNotice(user,dest,target_type,text,status,exempt_list);
}
-int FilterBase::OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status)
+int FilterBase::OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
/* Leave ulines alone */
if ((ServerInstance->ULine(user->server)) || (!IS_LOCAL(user)))
diff --git a/src/modules/m_noctcp.cpp b/src/modules/m_noctcp.cpp
index 351c8631e..2e62c8e51 100644
--- a/src/modules/m_noctcp.cpp
+++ b/src/modules/m_noctcp.cpp
@@ -73,12 +73,12 @@ class ModuleNoCTCP : public Module
List[I_OnUserPreMessage] = List[I_OnUserPreNotice] = 1;
}
- virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status)
+ virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
- return OnUserPreNotice(user,dest,target_type,text,status);
+ return OnUserPreNotice(user,dest,target_type,text,status,exempt_list);
}
- virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status)
+ virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
if (target_type == TYPE_CHANNEL)
{
diff --git a/src/modules/m_nonotice.cpp b/src/modules/m_nonotice.cpp
index 6286321b3..2c99a89e1 100644
--- a/src/modules/m_nonotice.cpp
+++ b/src/modules/m_nonotice.cpp
@@ -70,7 +70,7 @@ class ModuleNoNotice : public Module
List[I_OnUserPreNotice] = 1;
}
- virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status)
+ virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
if (target_type == TYPE_CHANNEL)
{
diff --git a/src/modules/m_restrictbanned.cpp b/src/modules/m_restrictbanned.cpp
index cdd80e741..51ff39772 100644
--- a/src/modules/m_restrictbanned.cpp
+++ b/src/modules/m_restrictbanned.cpp
@@ -88,12 +88,12 @@ class ModuleRestrictBanned : public Module
return CheckRestricted(user, channel, "change the topic");
}
- virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status)
+ virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
- return OnUserPreNotice(user,dest,target_type,text,status);
+ return OnUserPreNotice(user,dest,target_type,text,status,exempt_list);
}
- virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status)
+ virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
if (target_type == TYPE_CHANNEL)
{
diff --git a/src/modules/m_restrictmsg.cpp b/src/modules/m_restrictmsg.cpp
index 9a9c9ad5f..12130f0a1 100644
--- a/src/modules/m_restrictmsg.cpp
+++ b/src/modules/m_restrictmsg.cpp
@@ -44,7 +44,7 @@ class ModuleRestrictMsg : public Module
List[I_OnUserPreMessage] = List[I_OnUserPreNotice] = 1;
}
- virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status)
+ virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
if (target_type == TYPE_USER)
{
@@ -65,9 +65,9 @@ class ModuleRestrictMsg : public Module
return 0;
}
- virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status)
+ virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
- return this->OnUserPreMessage(user,dest,target_type,text,status);
+ return this->OnUserPreMessage(user,dest,target_type,text,status,exempt_list);
}
virtual ~ModuleRestrictMsg()
diff --git a/src/modules/m_services.cpp b/src/modules/m_services.cpp
index 457228234..b746f6492 100644
--- a/src/modules/m_services.cpp
+++ b/src/modules/m_services.cpp
@@ -227,7 +227,7 @@ class ModuleServices : public Module
}
}
- virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status)
+ virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
if (target_type == TYPE_CHANNEL)
{
@@ -262,9 +262,9 @@ class ModuleServices : public Module
return 0;
}
- virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status)
+ virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
- return OnUserPreMessage(user,dest,target_type,text,status);
+ return OnUserPreMessage(user,dest,target_type,text,status, exempt_list);
}
virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname, std::string &privs)
diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp
index 562e98fa4..49ce777e2 100644
--- a/src/modules/m_services_account.cpp
+++ b/src/modules/m_services_account.cpp
@@ -150,7 +150,7 @@ class ModuleServicesAccount : public Module
List[I_OnSyncUserMetaData] = List[I_OnUserQuit] = List[I_OnCleanup] = List[I_OnDecodeMetaData] = 1;
}
- virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status)
+ virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
std::string *account;
user->GetExt("accountname", account);
@@ -192,9 +192,9 @@ class ModuleServicesAccount : public Module
return 0;
}
- virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status)
+ virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
- return OnUserPreMessage(user, dest, target_type, text, status);
+ return OnUserPreMessage(user, dest, target_type, text, status, exempt_list);
}
virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname, std::string &privs)
diff --git a/src/modules/m_silence.cpp b/src/modules/m_silence.cpp
index 595c3505e..035be733c 100644
--- a/src/modules/m_silence.cpp
+++ b/src/modules/m_silence.cpp
@@ -166,7 +166,7 @@ class ModuleSilence : public Module
output = output + " SILENCE=999";
}
- virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status)
+ virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
// im not sure how unreal's silence operates but ours is sensible. It blocks notices and
// privmsgs from people on the silence list, directed privately at the user.
@@ -191,9 +191,9 @@ class ModuleSilence : public Module
return 0;
}
- virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status)
+ virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
- return OnUserPreNotice(user,dest,target_type,text,status);
+ return OnUserPreNotice(user,dest,target_type,text,status,exempt_list);
}
virtual ~ModuleSilence()
diff --git a/src/modules/m_silence_ext.cpp b/src/modules/m_silence_ext.cpp
index de01f43ac..d3f70411d 100644
--- a/src/modules/m_silence_ext.cpp
+++ b/src/modules/m_silence_ext.cpp
@@ -276,7 +276,7 @@ class ModuleSilence : public Module
output = output + " ESILENCE SILENCE=999";
}
- virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status)
+ virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
if (target_type == TYPE_USER)
{
@@ -285,7 +285,7 @@ class ModuleSilence : public Module
return 0;
}
- virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status)
+ virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
return MatchPattern((userrec*)dest, user, SILENCE_NOTICE);
}
@@ -325,6 +325,9 @@ class ModuleSilence : public Module
* on the channel. This code is from channels.cpp, and should also be changed if channels.cpp
* updates it's corresponding code
*/
+
+ CUList fixme;
+
if ((validated) && (command == "PRIVMSG"))
{
char status = 0;
@@ -356,7 +359,7 @@ class ModuleSilence : public Module
int MOD_RESULT = 0;
std::string temp = parameters[1];
- FOREACH_RESULT(I_OnUserPreMessage,OnUserPreMessage(user,chan,TYPE_CHANNEL,temp,status));
+ FOREACH_RESULT(I_OnUserPreMessage,OnUserPreMessage(user,chan,TYPE_CHANNEL,temp,status,fixme));
if (MOD_RESULT) {
return 1;
}
diff --git a/src/modules/m_stripcolor.cpp b/src/modules/m_stripcolor.cpp
index 723225cca..3537c899d 100644
--- a/src/modules/m_stripcolor.cpp
+++ b/src/modules/m_stripcolor.cpp
@@ -176,7 +176,7 @@ class ModuleStripColor : public Module
text = sentence;
}
- virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status)
+ virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
bool active = false;
if (target_type == TYPE_USER)
@@ -196,9 +196,9 @@ class ModuleStripColor : public Module
return 0;
}
- virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status)
+ virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
- return OnUserPreMessage(user,dest,target_type,text,status);
+ return OnUserPreMessage(user,dest,target_type,text,status,exempt_list);
}
virtual Version GetVersion()