X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_silence.cpp;h=7d3b3f90ce091d20b2d07713a5664ad6c9fdc27d;hb=da29af8cba49d51e53d6e68237ccbf6370b6dd1f;hp=502f947f45b0f4f442af00ef30e574ddc8934c5b;hpb=6fe1f4e1136f2ab95a88e68af1894bf6002d03f4;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_silence.cpp b/src/modules/m_silence.cpp index 502f947f4..7d3b3f90c 100644 --- a/src/modules/m_silence.cpp +++ b/src/modules/m_silence.cpp @@ -45,8 +45,8 @@ // pair of hostmask and flags typedef std::pair silenceset; -// deque list of pairs -typedef std::deque silencelist; +// list of pairs +typedef std::vector silencelist; // intmasks for flags static int SILENCE_PRIVATE = 0x0001; /* p private messages */ @@ -125,10 +125,10 @@ class CommandSilence : public Command for (silencelist::const_iterator c = sl->begin(); c != sl->end(); c++) { std::string decomppattern = DecompPattern(c->second); - user->WriteNumeric(271, "%s %s %s", user->nick.c_str(),c->first.c_str(), decomppattern.c_str()); + user->WriteNumeric(271, user->nick, c->first, decomppattern); } } - user->WriteNumeric(272, ":End of Silence List"); + user->WriteNumeric(272, "End of Silence List"); return CMD_SUCCESS; } @@ -174,7 +174,7 @@ class CommandSilence : public Command if (listitem == mask && i->second == pattern) { sl->erase(i); - user->WriteNumeric(950, "%s :Removed %s %s from silence list", user->nick.c_str(), mask.c_str(), decomppattern.c_str()); + user->WriteNumeric(950, user->nick, InspIRCd::Format("Removed %s %s from silence list", mask.c_str(), decomppattern.c_str())); if (!sl->size()) { ext.unset(user); @@ -183,7 +183,7 @@ class CommandSilence : public Command } } } - user->WriteNumeric(952, "%s :%s %s does not exist on your silence list", user->nick.c_str(), mask.c_str(), decomppattern.c_str()); + user->WriteNumeric(952, user->nick, InspIRCd::Format("%s %s does not exist on your silence list", mask.c_str(), decomppattern.c_str())); } else if (action == '+') { @@ -196,7 +196,7 @@ class CommandSilence : public Command } if (sl->size() > maxsilence) { - user->WriteNumeric(952, "%s :Your silence list is full",user->nick.c_str()); + user->WriteNumeric(952, user->nick, "Your silence list is full"); return CMD_FAILURE; } @@ -206,19 +206,19 @@ class CommandSilence : public Command irc::string listitem = n->first.c_str(); if (listitem == mask && n->second == pattern) { - user->WriteNumeric(952, "%s :%s %s is already on your silence list", user->nick.c_str(), mask.c_str(), decomppattern.c_str()); + user->WriteNumeric(952, user->nick, InspIRCd::Format("%s %s is already on your silence list", mask.c_str(), decomppattern.c_str())); return CMD_FAILURE; } } if (((pattern & SILENCE_EXCLUDE) > 0)) { - sl->push_front(silenceset(mask,pattern)); + sl->insert(sl->begin(), silenceset(mask, pattern)); } else { sl->push_back(silenceset(mask,pattern)); } - user->WriteNumeric(951, "%s :Added %s %s to silence list", user->nick.c_str(), mask.c_str(), decomppattern.c_str()); + user->WriteNumeric(951, user->nick, InspIRCd::Format("Added %s %s to silence list", mask.c_str(), decomppattern.c_str())); return CMD_SUCCESS; } } @@ -318,7 +318,7 @@ class ModuleSilence : public Module tokens["SILENCE"] = ConvToStr(maxsilence); } - void OnBuildExemptList(MessageType message_type, Channel* chan, User* sender, char status, CUList &exempt_list, const std::string &text) + void BuildExemptList(MessageType message_type, Channel* chan, User* sender, CUList& exempt_list) { int public_silence = (message_type == MSG_PRIVMSG ? SILENCE_CHANNEL : SILENCE_CNOTICE); @@ -344,7 +344,7 @@ class ModuleSilence : public Module else if (target_type == TYPE_CHANNEL) { Channel* chan = (Channel*)dest; - this->OnBuildExemptList(msgtype, chan, user, status, exempt_list, ""); + BuildExemptList(msgtype, chan, user, exempt_list); } return MOD_RES_PASSTHRU; }