diff options
Diffstat (limited to 'src/modules/m_silence.cpp')
-rw-r--r-- | src/modules/m_silence.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/modules/m_silence.cpp b/src/modules/m_silence.cpp index 5c8e5fdef..9aa891129 100644 --- a/src/modules/m_silence.cpp +++ b/src/modules/m_silence.cpp @@ -79,22 +79,19 @@ class cmd_silence : public command_t // does it contain any entries and does it exist? if (sl) { - if (sl->size()) + silencelist::iterator i = sl->find(mask.c_str()); + if (i != sl->end()) { - silencelist::iterator i = sl->find(mask.c_str()); - if (i != sl->end()) + sl->erase(i); + user->WriteServ("950 %s %s :Removed %s from silence list",user->nick, user->nick, mask.c_str()); + if (!sl->size()) { - sl->erase(i); - user->WriteServ("950 %s %s :Removed %s from silence list",user->nick, user->nick, mask.c_str()); + // tidy up -- if a user's list is empty, theres no use having it + // hanging around in the user record. + DELETE(sl); + user->Shrink("silence_list"); } } - else - { - // tidy up -- if a user's list is empty, theres no use having it - // hanging around in the user record. - DELETE(sl); - user->Shrink("silence_list"); - } } } else if (action == '+') |