summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/chanserv.cpp2
-rw-r--r--src/regchannel.cpp22
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
*/