summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-06-14 23:08:11 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-06-14 23:08:11 +0000
commitfc826b6f0127f8075e87c8c3d9e8a5b3ee94abe1 (patch)
tree7f55948b526c5988540b51c83265e8e504375932 /src
parentb22124cbc3f4fb365a743cd5d5bb76223e48eeed (diff)
Fix m_shun as per bug #560 reported by Casey, thanks
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9905 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_shun.cpp33
1 files changed, 24 insertions, 9 deletions
diff --git a/src/modules/m_shun.cpp b/src/modules/m_shun.cpp
index 56d4be808..0cf62dd35 100644
--- a/src/modules/m_shun.cpp
+++ b/src/modules/m_shun.cpp
@@ -173,11 +173,11 @@ class ModuleShun : public Module
virtual int OnStats(char symbol, User* user, string_list& out)
{
- // XXX write me
-//format << Srv->Config->ServerName << " 223 " << user->nick << " :" << iter->banmask << " " << iter->set_on << " " << iter->length << " " <<
-//iter->set_by << " " << iter->reason;
+ if (symbol != 'S')
+ return 0;
- return 0;
+ ServerInstance->XLines->InvokeStats("SHUN", 223, user, out);
+ return 1;
}
virtual void OnUserConnect(User* user)
@@ -197,18 +197,33 @@ class ModuleShun : public Module
virtual int OnPreCommand(std::string &command, std::vector<std::string>& parameters, User* user, bool validated, const std::string &original_line)
{
- if((command != "PONG") && (command != "PING"))
+ if (validated || !user->GetExt("shunned"))
+ return 0;
+
+ if (!ServerInstance->XLines->MatchesLine("SHUN", user))
{
- if (user->GetExt("shunned"))
- return 1;
+ /* The shun previously set on this user has expired or been removed */
+ user->Shrink("shunned");
+ return 0;
}
- return 0;
+ if (command == "QUIT")
+ {
+ /* Allow QUIT but dont show any quit message */
+ parameters.clear();
+ return 0;
+ }
+
+ /* Always allow PONG and PING */
+ if (command == "PONG" || command == "PING")
+ return 0;
+
+ return 1;
}
virtual Version GetVersion()
{
- return Version(1,0,0,0,0,API_VERSION);
+ return Version(1,2,0,0,VF_VENDOR|VF_COMMON,API_VERSION);
}
};