* style command so services can modify lots of entries at once.
* leaving it backwards compatible for now as it's late. -- w
*/
- if (!ServerInstance->ULine(user->server))
+ if (!user->server->IsULine())
return CMD_FAILURE;
User *u = ServerInstance->FindNick(parameters[0]);
if (IS_LOCAL(u))
{
- ServerInstance->Parser->CallHandler("SILENCE", std::vector<std::string>(++parameters.begin(), parameters.end()), u);
+ ServerInstance->Parser.CallHandler("SILENCE", std::vector<std::string>(parameters.begin() + 1, parameters.end()), u);
}
return CMD_SUCCESS;
for (silencelist::const_iterator c = sl->begin(); c != sl->end(); c++)
{
std::string decomppattern = DecompPattern(c->second);
- user->WriteNumeric(271, "%s %s %s %s",user->nick.c_str(), user->nick.c_str(),c->first.c_str(), decomppattern.c_str());
+ user->WriteNumeric(271, "%s %s %s", user->nick.c_str(),c->first.c_str(), decomppattern.c_str());
}
}
- user->WriteNumeric(272, "%s :End of Silence List",user->nick.c_str());
+ user->WriteNumeric(272, ":End of Silence List");
return CMD_SUCCESS;
}
if (listitem == mask && i->second == pattern)
{
sl->erase(i);
- user->WriteNumeric(950, "%s %s :Removed %s %s from silence list",user->nick.c_str(), user->nick.c_str(), mask.c_str(), decomppattern.c_str());
+ user->WriteNumeric(950, "%s :Removed %s %s from silence list", user->nick.c_str(), mask.c_str(), decomppattern.c_str());
if (!sl->size())
{
ext.unset(user);
}
}
}
- user->WriteNumeric(952, "%s %s :%s %s does not exist on your silence list",user->nick.c_str(), user->nick.c_str(), mask.c_str(), decomppattern.c_str());
+ user->WriteNumeric(952, "%s :%s %s does not exist on your silence list", user->nick.c_str(), mask.c_str(), decomppattern.c_str());
}
else if (action == '+')
{
}
if (sl->size() > maxsilence)
{
- user->WriteNumeric(952, "%s %s :Your silence list is full",user->nick.c_str(), user->nick.c_str());
+ user->WriteNumeric(952, "%s :Your silence list is full",user->nick.c_str());
return CMD_FAILURE;
}
irc::string listitem = n->first.c_str();
if (listitem == mask && n->second == pattern)
{
- user->WriteNumeric(952, "%s %s :%s %s is already on your silence list",user->nick.c_str(), user->nick.c_str(), mask.c_str(), decomppattern.c_str());
+ user->WriteNumeric(952, "%s :%s %s is already on your silence list", user->nick.c_str(), mask.c_str(), decomppattern.c_str());
return CMD_FAILURE;
}
}
{
sl->push_back(silenceset(mask,pattern));
}
- user->WriteNumeric(951, "%s %s :Added %s %s to silence list",user->nick.c_str(), user->nick.c_str(), mask.c_str(), decomppattern.c_str());
+ user->WriteNumeric(951, "%s :Added %s %s to silence list", user->nick.c_str(), mask.c_str(), decomppattern.c_str());
return CMD_SUCCESS;
}
}
{
}
- void init() CXX11_OVERRIDE
+ void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
{
- OnRehash(NULL);
- ServerInstance->Modules->AddService(cmdsilence);
- ServerInstance->Modules->AddService(cmdsvssilence);
- ServerInstance->Modules->AddService(cmdsilence.ext);
- }
-
- void OnRehash(User* user) CXX11_OVERRIDE
- {
- maxsilence = ServerInstance->Config->ConfValue("showwhois")->getInt("maxentries", 32);
+ maxsilence = ServerInstance->Config->ConfValue("silence")->getInt("maxentries", 32);
if (!maxsilence)
maxsilence = 32;
}
else if (target_type == TYPE_CHANNEL)
{
Channel* chan = (Channel*)dest;
- if (chan)
- {
- this->OnBuildExemptList(msgtype, chan, user, status, exempt_list, "");
- }
+ this->OnBuildExemptList(msgtype, chan, user, status, exempt_list, "");
}
return MOD_RES_PASSTHRU;
}
ModResult MatchPattern(User* dest, User* source, int pattern)
{
- /* Server source */
- if (!source || !dest)
- return MOD_RES_ALLOW;
-
silencelist* sl = cmdsilence.ext.get(dest);
if (sl)
{