summaryrefslogtreecommitdiff
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
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
-rw-r--r--src/modules/m_shun.cpp33
-rw-r--r--win/inspircdVC80.vcproj40
2 files changed, 64 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);
}
};
diff --git a/win/inspircdVC80.vcproj b/win/inspircdVC80.vcproj
index 7d10bfac3..78126bb27 100644
--- a/win/inspircdVC80.vcproj
+++ b/win/inspircdVC80.vcproj
@@ -2754,6 +2754,26 @@
</FileConfiguration>
</File>
<File
+ RelativePath="..\src\modules\m_sasl.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
RelativePath="..\src\modules\m_securelist.cpp"
>
<FileConfiguration
@@ -2974,6 +2994,26 @@
</FileConfiguration>
</File>
<File
+ RelativePath="..\src\modules\m_shun.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
RelativePath="..\src\modules\m_silence.cpp"
>
<FileConfiguration