summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-05-22 20:41:16 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-05-22 20:41:16 +0000
commitda8fe330c2b3445b370cb80ecae93c7fb34d441d (patch)
tree4b6ef238c206d3440b36827b847fd3895dc300f8 /src/modules
parent38c9d65253a67dbe13c77792027a9db601735813 (diff)
Added support for changing of text within OnUserPreNotice and OnUserPreMessage (required for modes +G and +S etc)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@821 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_blockcolor.cpp4
-rw-r--r--src/modules/m_filter.cpp12
-rw-r--r--src/modules/m_noctcp.cpp4
-rw-r--r--src/modules/m_nonotice.cpp2
-rw-r--r--src/modules/m_services.cpp4
5 files changed, 13 insertions, 13 deletions
diff --git a/src/modules/m_blockcolor.cpp b/src/modules/m_blockcolor.cpp
index a4e5acc1d..7f9d8716d 100644
--- a/src/modules/m_blockcolor.cpp
+++ b/src/modules/m_blockcolor.cpp
@@ -32,7 +32,7 @@ class ModuleBlockColor : public Module
Srv->AddExtendedMode('c',MT_CHANNEL,false,0,0);
}
- virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string text)
+ virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text)
{
if (target_type == TYPE_CHANNEL)
{
@@ -51,7 +51,7 @@ class ModuleBlockColor : public Module
return 0;
}
- virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string text)
+ virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text)
{
if (target_type == TYPE_CHANNEL)
{
diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp
index 8d121ac0e..679df66bc 100644
--- a/src/modules/m_filter.cpp
+++ b/src/modules/m_filter.cpp
@@ -62,13 +62,13 @@ class ModuleFilter : public Module
// format of a config entry is <keyword pattern="*glob*" reason="Some reason here" action="kill/block">
- virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string text)
+ virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text)
{
- text = text + " ";
+ std::string text2 = text + " ";
for (int index = 0; index < MyConf->Enumerate("keyword"); index++)
{
std::string pattern = MyConf->ReadValue("keyword","pattern",index);
- if (Srv->MatchText(text,pattern))
+ if (Srv->MatchText(text2,pattern))
{
std::string target = "";
std::string reason = MyConf->ReadValue("keyword","reason",index);
@@ -111,13 +111,13 @@ class ModuleFilter : public Module
return 0;
}
- virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string text)
+ virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text)
{
- text = text + " ";
+ std::string text2 = text + " ";
for (int index = 0; index < MyConf->Enumerate("keyword"); index++)
{
std::string pattern = MyConf->ReadValue("keyword","pattern",index);
- if (Srv->MatchText(text,pattern))
+ if (Srv->MatchText(text2,pattern))
{
std::string target = "";
std::string reason = MyConf->ReadValue("keyword","reason",index);
diff --git a/src/modules/m_noctcp.cpp b/src/modules/m_noctcp.cpp
index 8d597d1b8..4d58151f0 100644
--- a/src/modules/m_noctcp.cpp
+++ b/src/modules/m_noctcp.cpp
@@ -33,7 +33,7 @@ class ModuleNoCTCP : public Module
Srv->AddExtendedMode('C',MT_CHANNEL,false,0,0);
}
- virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string text)
+ virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text)
{
if (target_type == TYPE_CHANNEL)
{
@@ -53,7 +53,7 @@ class ModuleNoCTCP : public Module
return 0;
}
- virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string text)
+ virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text)
{
if (target_type == TYPE_CHANNEL)
{
diff --git a/src/modules/m_nonotice.cpp b/src/modules/m_nonotice.cpp
index a5fa2b61c..89a619590 100644
--- a/src/modules/m_nonotice.cpp
+++ b/src/modules/m_nonotice.cpp
@@ -32,7 +32,7 @@ class ModuleNoNotice : public Module
Srv->AddExtendedMode('T',MT_CHANNEL,false,0,0);
}
- virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string text)
+ virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text)
{
if (target_type == TYPE_CHANNEL)
{
diff --git a/src/modules/m_services.cpp b/src/modules/m_services.cpp
index 74c2bf2dc..95d0436e1 100644
--- a/src/modules/m_services.cpp
+++ b/src/modules/m_services.cpp
@@ -85,7 +85,7 @@ class ModuleServices : public Module
return 0;
}
- virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string text)
+ virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text)
{
if (target_type == TYPE_CHANNEL)
{
@@ -120,7 +120,7 @@ class ModuleServices : public Module
return 0;
}
- virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string text)
+ virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text)
{
if (target_type == TYPE_CHANNEL)
{