summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-11-26 18:04:47 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-11-26 18:04:47 +0000
commit2e52ff280dca14d1598b84fab7a8c2e93fa30910 (patch)
treeb61c54d4e0921b6349ff6b5aeb36008e52973076 /src/modules
parent69488d0a42ae22d1cf39244100403b63075ad4c3 (diff)
Add extra parameter to OnUserPreNotice and OnUserPrePrivmsg, CUList &exempt_list, a list of users NOT to write to. By default it just contains the sender, you can add more.
This also bumps the module api version by one. added "CUList fixme" to peaveys module just so it builds, as this will be refactored to use the new feature that was just added :) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5806 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-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
15 files changed, 48 insertions, 45 deletions
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()