summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-02-07 17:03:15 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-02-07 17:03:15 +0000
commit0b34769b9e3b9e823763cfd8bf3e2d64c2426710 (patch)
tree177b1a11f15c3fea8a9c72cd79b99c114d4defb3 /src/modules
parentcb233b72f5d14993dc3fc8fea3dae246c2454c1e (diff)
Fix for bug #205 reported by nenolod (modules that erroneously check remote users to apply privmsg/notice restrictions)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6532 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_blockcaps.cpp2
-rw-r--r--src/modules/m_blockcolor.cpp2
-rw-r--r--src/modules/m_censor.cpp3
-rw-r--r--src/modules/m_chanfilter.cpp3
-rw-r--r--src/modules/m_dccallow.cpp3
-rw-r--r--src/modules/m_deaf.cpp2
-rw-r--r--src/modules/m_noctcp.cpp2
-rw-r--r--src/modules/m_nonotice.cpp2
-rw-r--r--src/modules/m_restrictmsg.cpp2
-rw-r--r--src/modules/m_services.cpp3
-rw-r--r--src/modules/m_services_account.cpp4
-rw-r--r--src/modules/m_silence.cpp2
-rw-r--r--src/modules/m_silence_ext.cpp3
-rw-r--r--src/modules/m_stripcolor.cpp3
14 files changed, 29 insertions, 7 deletions
diff --git a/src/modules/m_blockcaps.cpp b/src/modules/m_blockcaps.cpp
index 058336fb3..856f0c969 100644
--- a/src/modules/m_blockcaps.cpp
+++ b/src/modules/m_blockcaps.cpp
@@ -77,7 +77,7 @@ public:
virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
- if (text.size() < minlen)
+ if ((text.size() < minlen) || (!IS_LOCAL(user)))
return 0;
if (target_type == TYPE_CHANNEL)
diff --git a/src/modules/m_blockcolor.cpp b/src/modules/m_blockcolor.cpp
index df28f1807..24b3d7e9f 100644
--- a/src/modules/m_blockcolor.cpp
+++ b/src/modules/m_blockcolor.cpp
@@ -71,7 +71,7 @@ class ModuleBlockColour : public Module
virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
- if (target_type == TYPE_CHANNEL)
+ if ((target_type == TYPE_CHANNEL) && (IS_LOCAL(user)))
{
chanrec* c = (chanrec*)dest;
diff --git a/src/modules/m_censor.cpp b/src/modules/m_censor.cpp
index 0930c1d45..3b7545b58 100644
--- a/src/modules/m_censor.cpp
+++ b/src/modules/m_censor.cpp
@@ -132,6 +132,9 @@ 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, CUList &exempt_list)
{
+ if (!IS_LOCAL(user))
+ return 0;
+
bool active = false;
if (target_type == TYPE_USER)
diff --git a/src/modules/m_chanfilter.cpp b/src/modules/m_chanfilter.cpp
index 7c888c057..e21ac8ca4 100644
--- a/src/modules/m_chanfilter.cpp
+++ b/src/modules/m_chanfilter.cpp
@@ -92,6 +92,9 @@ class ModuleChanFilter : public Module
virtual int ProcessMessages(userrec* user,chanrec* chan,std::string &text)
{
+ if (!IS_LOCAL(user))
+ return 0;
+
// Create a copy of the string in irc::string
irc::string line = text.c_str();
diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp
index 76c8ccf81..18330e357 100644
--- a/src/modules/m_dccallow.cpp
+++ b/src/modules/m_dccallow.cpp
@@ -304,6 +304,9 @@ class ModuleDCCAllow : public Module
virtual int OnUserPreNotice(userrec* user, void* dest, int target_type, std::string &text, char status, CUList &exempt_list)
{
+ if (!IS_LOCAL(user))
+ return 0;
+
Expire();
if (target_type == TYPE_USER)
diff --git a/src/modules/m_deaf.cpp b/src/modules/m_deaf.cpp
index 2a1449bb4..69fde96f1 100644
--- a/src/modules/m_deaf.cpp
+++ b/src/modules/m_deaf.cpp
@@ -107,7 +107,7 @@ class ModuleDeaf : public Module
virtual int PreText(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
- if (target_type == TYPE_CHANNEL)
+ if ((target_type == TYPE_CHANNEL) & (IS_LOCAL(user)))
{
chanrec* chan = (chanrec*)dest;
if (chan)
diff --git a/src/modules/m_noctcp.cpp b/src/modules/m_noctcp.cpp
index 622a08ac6..029a95065 100644
--- a/src/modules/m_noctcp.cpp
+++ b/src/modules/m_noctcp.cpp
@@ -76,7 +76,7 @@ class ModuleNoCTCP : public Module
virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
- if (target_type == TYPE_CHANNEL)
+ if ((target_type == TYPE_CHANNEL) && (IS_LOCAL(user)))
{
chanrec* c = (chanrec*)dest;
if (c->IsModeSet('C'))
diff --git a/src/modules/m_nonotice.cpp b/src/modules/m_nonotice.cpp
index 71e7e570b..31d423996 100644
--- a/src/modules/m_nonotice.cpp
+++ b/src/modules/m_nonotice.cpp
@@ -68,7 +68,7 @@ class ModuleNoNotice : public Module
virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
- if (target_type == TYPE_CHANNEL)
+ if ((target_type == TYPE_CHANNEL) && (IS_LOCAL(user)))
{
chanrec* c = (chanrec*)dest;
if (c->IsModeSet('T'))
diff --git a/src/modules/m_restrictmsg.cpp b/src/modules/m_restrictmsg.cpp
index 8be5f270a..4f611653b 100644
--- a/src/modules/m_restrictmsg.cpp
+++ b/src/modules/m_restrictmsg.cpp
@@ -41,7 +41,7 @@ class ModuleRestrictMsg : public Module
virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
- if (target_type == TYPE_USER)
+ if ((target_type == TYPE_USER) && (IS_LOCAL(user)))
{
userrec* u = (userrec*)dest;
if (*u->oper || *user->oper)
diff --git a/src/modules/m_services.cpp b/src/modules/m_services.cpp
index 207079da0..5da01f979 100644
--- a/src/modules/m_services.cpp
+++ b/src/modules/m_services.cpp
@@ -222,6 +222,9 @@ class ModuleServices : public Module
virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
+ if (!IS_LOCAL(user))
+ return 0;
+
if (target_type == TYPE_CHANNEL)
{
chanrec* c = (chanrec*)dest;
diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp
index b5024e4df..9e73ba26b 100644
--- a/src/modules/m_services_account.cpp
+++ b/src/modules/m_services_account.cpp
@@ -147,6 +147,10 @@ class ModuleServicesAccount : public Module
virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
std::string *account;
+
+ if (!IS_LOCAL(user))
+ return 0;
+
user->GetExt("accountname", account);
if (target_type == TYPE_CHANNEL)
diff --git a/src/modules/m_silence.cpp b/src/modules/m_silence.cpp
index 7dcb94787..2bc58821d 100644
--- a/src/modules/m_silence.cpp
+++ b/src/modules/m_silence.cpp
@@ -167,7 +167,7 @@ class ModuleSilence : public Module
// privmsgs from people on the silence list, directed privately at the user.
// channel messages are unaffected (ever tried to follow the flow of conversation in
// a channel when you've set an ignore on the two most talkative people?)
- if (target_type == TYPE_USER)
+ if ((target_type == TYPE_USER) && (IS_LOCAL(user)))
{
userrec* u = (userrec*)dest;
silencelist* sl;
diff --git a/src/modules/m_silence_ext.cpp b/src/modules/m_silence_ext.cpp
index 12727bc86..122016dbc 100644
--- a/src/modules/m_silence_ext.cpp
+++ b/src/modules/m_silence_ext.cpp
@@ -305,6 +305,9 @@ class ModuleSilence : public Module
virtual int PreText(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list, int silence_type)
{
+ if (!IS_LOCAL(user))
+ return 0;
+
if (target_type == TYPE_USER)
{
return MatchPattern((userrec*)dest, user, silence_type);
diff --git a/src/modules/m_stripcolor.cpp b/src/modules/m_stripcolor.cpp
index 3639eae14..634358a6c 100644
--- a/src/modules/m_stripcolor.cpp
+++ b/src/modules/m_stripcolor.cpp
@@ -173,6 +173,9 @@ class ModuleStripColor : public Module
virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
+ if (!IS_LOCAL(user))
+ return 0;
+
bool active = false;
if (target_type == TYPE_USER)
{