From da8fe330c2b3445b370cb80ecae93c7fb34d441d Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 22 May 2004 20:41:16 +0000 Subject: 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 --- src/modules/m_blockcolor.cpp | 4 ++-- src/modules/m_filter.cpp | 12 ++++++------ src/modules/m_noctcp.cpp | 4 ++-- src/modules/m_nonotice.cpp | 2 +- src/modules/m_services.cpp | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src/modules') 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 - 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) { -- cgit v1.2.3