diff options
| author | Adam <Adam@anope.org> | 2010-12-29 23:12:26 -0500 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2010-12-29 23:12:26 -0500 |
| commit | 72b8f4609b147b9b9a222c14bfc4ae100cc7f250 (patch) | |
| tree | 3b5fde173f448176878036b2c718682d09f90188 /src/regchannel.cpp | |
| parent | d36e53f702f6f166e862c88dd2399bef91e9d1d5 (diff) | |
Use empty SJOINs when allowed to create empty permanent channels
Diffstat (limited to 'src/regchannel.cpp')
| -rw-r--r-- | src/regchannel.cpp | 19 |
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(); } |
