summaryrefslogtreecommitdiff
path: root/src/regchannel.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-12-29 23:12:26 -0500
committerAdam <Adam@anope.org>2010-12-29 23:12:26 -0500
commit72b8f4609b147b9b9a222c14bfc4ae100cc7f250 (patch)
tree3b5fde173f448176878036b2c718682d09f90188 /src/regchannel.cpp
parentd36e53f702f6f166e862c88dd2399bef91e9d1d5 (diff)
Use empty SJOINs when allowed to create empty permanent channels
Diffstat (limited to 'src/regchannel.cpp')
-rw-r--r--src/regchannel.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/regchannel.cpp b/src/regchannel.cpp
index 17c141ea7..0b67daf9a 100644
--- a/src/regchannel.cpp
+++ b/src/regchannel.cpp
@@ -563,10 +563,21 @@ void ChannelInfo::LoadMLock()
if (this->HasFlag(CI_PERSIST) && !this->c)
{
this->c = new Channel(this->name, this->time_registered);
- if (!this->bi && ChanServ && ModeManager::FindChannelModeByName(CMODE_PERM) == NULL)
- ChanServ->Assign(NULL, this);
- else if (this->bi)
- this->bi->Join(c);
+ if (ModeManager::FindChannelModeByName(CMODE_PERM) != NULL)
+ {
+ /* At this point, CMODE_PERM *must* be locked on the channel, so this is fine */
+ ircdproto->SendChannel(this->c, get_mlock_modes(this, true));
+ }
+ else
+ {
+ if (!this->bi)
+ {
+ this->bi = whosends(this);
+ ++this->bi->chancount;
+ }
+ this->bi->Join(this->c);
+ }
+
check_modes(this->c);
this->CheckTopic();
}