+ if (validated || !user->GetExt("shunned"))
+ return 0;
+
+ if (!ServerInstance->XLines->MatchesLine("SHUN", user))
+ {
+ /* The shun previously set on this user has expired or been removed */
+ user->Shrink("shunned");
+ return 0;
+ }
+
+ std::set<std::string>::iterator i = ShunEnabledCommands.find(command);
+
+ if (i == ShunEnabledCommands.end())
+ {
+ if (NotifyOfShun)
+ user->WriteServ("NOTICE %s :*** Command %s not processed, as you have been blocked from issuing commands (SHUN)", user->nick.c_str(), command.c_str());
+ return 1;
+ }
+
+ if (command == "QUIT")
+ {
+ /* Allow QUIT but dont show any quit message */
+ parameters.clear();
+ }
+ else if (command == "PART")
+ {
+ /* same for PART */
+ parameters.clear();
+ }
+
+ return 1;