diff options
Diffstat (limited to 'modules/commands/cs_suspend.cpp')
-rw-r--r-- | modules/commands/cs_suspend.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/modules/commands/cs_suspend.cpp b/modules/commands/cs_suspend.cpp index 9cb829ad1..bce549e79 100644 --- a/modules/commands/cs_suspend.cpp +++ b/modules/commands/cs_suspend.cpp @@ -102,15 +102,18 @@ class CommandCSSuspend : public Command if (ci->c) { - for (CUserList::iterator it = ci->c->users.begin(), it_end = ci->c->users.end(); it != it_end; ) - { - UserContainer *uc = *it++; - - if (uc->user->HasMode(UMODE_OPER)) - continue; + std::vector<User *> users; - ci->c->Kick(NULL, uc->user, "%s", !reason.empty() ? reason.c_str() : translate(uc->user, _("This channel has been suspended."))); + for (CUserList::iterator it = ci->c->users.begin(), it_end = ci->c->users.end(); it != it_end; ++it) + { + UserContainer *uc = *it; + User *user = uc->user; + if (!user->HasMode(UMODE_OPER) && user->server != Me) + users.push_back(user); } + + for (unsigned i = 0; i < users.size(); ++i) + ci->c->Kick(NULL, users[i], "%s", !reason.empty() ? reason.c_str() : translate(users[i], _("This channel has been suspended."))); } if (expiry_secs > 0) |