diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-02 00:49:36 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-02 00:49:36 +0000 |
commit | 86775e2e98f55b3b88befe2daff0ca23f02f3155 (patch) | |
tree | cbc3abf3f55ae6fd1112bcf6bf44e02b502ac2d6 /src/modules/m_silence.cpp | |
parent | 3d8ec5dbd9cfde34fcbc63ad7b9b1369866f0a33 (diff) |
ModResult conversion: Change return type of all module functions
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11634 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_silence.cpp')
-rw-r--r-- | src/modules/m_silence.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/modules/m_silence.cpp b/src/modules/m_silence.cpp index 0f851f15c..dd720608f 100644 --- a/src/modules/m_silence.cpp +++ b/src/modules/m_silence.cpp @@ -331,7 +331,7 @@ class ModuleSilence : public Module { if (IS_LOCAL(i->first)) { - if (MatchPattern(i->first, sender, public_silence) == 1) + if (MatchPattern(i->first, sender, public_silence) == MOD_RES_ALLOW) { exempt_list[i->first] = i->first->nick; } @@ -339,7 +339,7 @@ class ModuleSilence : public Module } } - virtual int PreText(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list, int silence_type) + virtual ModResult PreText(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list, int silence_type) { if (target_type == TYPE_USER && IS_LOCAL(((User*)dest))) { @@ -353,29 +353,29 @@ class ModuleSilence : public Module this->OnBuildExemptList((silence_type == SILENCE_PRIVATE ? MSG_PRIVMSG : MSG_NOTICE), chan, user, status, exempt_list, ""); } } - return 0; + return MOD_RES_PASSTHRU; } - virtual int OnUserPreMessage(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list) + virtual ModResult OnUserPreMessage(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list) { return PreText(user, dest, target_type, text, status, exempt_list, SILENCE_PRIVATE); } - virtual int OnUserPreNotice(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list) + virtual ModResult OnUserPreNotice(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list) { return PreText(user, dest, target_type, text, status, exempt_list, SILENCE_NOTICE); } - virtual int OnUserPreInvite(User* source,User* dest,Channel* channel, time_t timeout) + virtual ModResult OnUserPreInvite(User* source,User* dest,Channel* channel, time_t timeout) { return MatchPattern(dest, source, SILENCE_INVITE); } - int MatchPattern(User* dest, User* source, int pattern) + ModResult MatchPattern(User* dest, User* source, int pattern) { /* Server source */ if (!source || !dest) - return 1; + return MOD_RES_ALLOW; silencelist* sl; dest->GetExt("silence_list", sl); @@ -384,10 +384,10 @@ class ModuleSilence : public Module for (silencelist::const_iterator c = sl->begin(); c != sl->end(); c++) { if (((((c->second & pattern) > 0)) || ((c->second & SILENCE_ALL) > 0)) && (InspIRCd::Match(source->GetFullHost(), c->first))) - return !(((c->second & SILENCE_EXCLUDE) > 0)); + return (c->second & SILENCE_EXCLUDE) ? MOD_RES_PASSTHRU : MOD_RES_DENY; } } - return 0; + return MOD_RES_PASSTHRU; } virtual ~ModuleSilence() |