diff options
author | Adam <Adam@anope.org> | 2011-05-08 19:48:26 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-05-16 04:10:18 -0400 |
commit | 9962fae1a176d62813d8c83ca77104a2efc60e92 (patch) | |
tree | 6174b6e37e963a7d4fc479d51411b416aac8dc8d /src | |
parent | 9fcbe293e2820a92921762d892767e2b1802c9c0 (diff) |
Calculate nc::channelcount at runtime
Diffstat (limited to 'src')
-rw-r--r-- | src/chanserv.cpp | 2 | ||||
-rw-r--r-- | src/regchannel.cpp | 22 |
2 files changed, 23 insertions, 1 deletions
diff --git a/src/chanserv.cpp b/src/chanserv.cpp index 393ad935d..42d637c38 100644 --- a/src/chanserv.cpp +++ b/src/chanserv.cpp @@ -282,7 +282,7 @@ bool IsFounder(User *user, ChannelInfo *ci) if (user->isSuperAdmin) return true; - if (user->Account() && user->Account() == ci->founder) + if (user->Account() && user->Account() == ci->GetFounder()) return true; return false; diff --git a/src/regchannel.cpp b/src/regchannel.cpp index 5a94027ae..1bd8807d9 100644 --- a/src/regchannel.cpp +++ b/src/regchannel.cpp @@ -166,6 +166,28 @@ ChannelInfo::~ChannelInfo() --this->founder->channelcount; } +/** Change the founder of the channek + * @params nc The new founder + */ +void ChannelInfo::SetFounder(NickCore *nc) +{ + if (this->founder) + --this->founder->channelcount; + this->founder = nc; + if (this->founder) + ++this->founder->channelcount; + if (this->founder == this->successor) + this->successor = NULL; +} + +/** Get the founder of the channel + * @return The founder + */ +NickCore *ChannelInfo::GetFounder() const +{ + return this->founder; +} + /** Find which bot should send mode/topic/etc changes for this channel * @return The bot */ |