summaryrefslogtreecommitdiff
path: root/src/regchannel.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-04-22 03:16:11 -0400
committerAdam <Adam@anope.org>2011-05-16 04:06:17 -0400
commitc8c23158a4ff74822d6c7d201dc53d879e3d91e8 (patch)
tree4bc9ae029691d5e7c03ebc1481683a010b733844 /src/regchannel.cpp
parent1782ce260c5bc214ec0b2e39257ab1371b68ae9c (diff)
Moved the core pseudo clients out into their own modules
Diffstat (limited to 'src/regchannel.cpp')
-rw-r--r--src/regchannel.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/regchannel.cpp b/src/regchannel.cpp
index 9d0a95059..8bc369511 100644
--- a/src/regchannel.cpp
+++ b/src/regchannel.cpp
@@ -11,6 +11,8 @@
#include "services.h"
#include "modules.h"
+#include "chanserv.h"
+#include "nickserv.h"
ChanAccess::ChanAccess(const Anope::string &umask)
{
@@ -164,6 +166,16 @@ ChannelInfo::~ChannelInfo()
--this->founder->channelcount;
}
+/** Find which bot should send mode/topic/etc changes for this channel
+ * @return The bot
+ */
+BotInfo *ChannelInfo::WhoSends()
+{
+ if (!this || !this->bi || !this->c || !this->botflags.HasFlag(BS_SYMBIOSIS) || !this->c->FindUser(this->bi))
+ return chanserv ? chanserv->Bot() : (nickserv ? nickserv->Bot() : NULL);
+ return this->bi;
+}
+
/** Add an entry to the channel access list
*
* @param mask The mask of the access entry
@@ -553,7 +565,7 @@ void ChannelInfo::LoadMLock()
else
{
if (!this->bi)
- whosends(this)->Assign(NULL, this);
+ this->WhoSends()->Assign(NULL, this);
if (this->c->FindUser(this->bi) == NULL)
this->bi->Join(this->c);
@@ -860,7 +872,7 @@ void ChannelInfo::RestoreTopic()
if ((this->HasFlag(CI_KEEPTOPIC) || this->HasFlag(CI_TOPICLOCK)) && this->last_topic != this->c->topic)
{
- this->c->ChangeTopic(!this->last_topic_setter.empty() ? this->last_topic_setter : whosends(this)->nick, this->last_topic, this->last_topic_time ? this->last_topic_time : Anope::CurTime);
+ this->c->ChangeTopic(!this->last_topic_setter.empty() ? this->last_topic_setter : this->WhoSends()->nick, this->last_topic, this->last_topic_time ? this->last_topic_time : Anope::CurTime);
}
}