summaryrefslogtreecommitdiff
path: root/modules/core/cs_set_founder.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-05-08 19:48:26 -0400
committerAdam <Adam@anope.org>2011-05-16 04:10:18 -0400
commit9962fae1a176d62813d8c83ca77104a2efc60e92 (patch)
tree6174b6e37e963a7d4fc479d51411b416aac8dc8d /modules/core/cs_set_founder.cpp
parent9fcbe293e2820a92921762d892767e2b1802c9c0 (diff)
Calculate nc::channelcount at runtime
Diffstat (limited to 'modules/core/cs_set_founder.cpp')
-rw-r--r--modules/core/cs_set_founder.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/modules/core/cs_set_founder.cpp b/modules/core/cs_set_founder.cpp
index 88ddabd86..a71794756 100644
--- a/modules/core/cs_set_founder.cpp
+++ b/modules/core/cs_set_founder.cpp
@@ -36,7 +36,6 @@ class CommandCSSetFounder : public Command
}
NickAlias *na = findnick(params[1]);
- NickCore *nc, *nc0 = ci->founder;
if (!na)
{
@@ -44,7 +43,7 @@ class CommandCSSetFounder : public Command
return MOD_CONT;
}
- nc = na->nc;
+ NickCore *nc = na->nc;
if (Config->CSMaxReg && nc->channelcount >= Config->CSMaxReg && !u->HasPriv("chanserv/no-register-limit"))
{
source.Reply(_("\002%s\002 has too many channels registered."), na->nick.c_str());
@@ -53,13 +52,7 @@ class CommandCSSetFounder : public Command
Log(!this->permission.empty() ? LOG_ADMIN : LOG_COMMAND, u, this, ci) << "to change the founder to " << nc->display;
- /* Founder and successor must not be the same group */
- if (nc == ci->successor)
- ci->successor = NULL;
-
- --nc0->channelcount;
- ci->founder = nc;
- ++nc->channelcount;
+ ci->SetFounder(nc);
source.Reply(_("Founder of %s changed to \002%s\002."), ci->name.c_str(), na->nick.c_str());