From 72b8f4609b147b9b9a222c14bfc4ae100cc7f250 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 29 Dec 2010 23:12:26 -0500 Subject: Use empty SJOINs when allowed to create empty permanent channels --- src/regchannel.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/regchannel.cpp') 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(); } -- cgit From 03cc9eb5c597e37239debac25a7ed6ad4f4d9411 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 29 Dec 2010 23:30:28 -0500 Subject: Assign bots to new empty permanent channels on IRCds without permchannel mode not just join --- src/regchannel.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/regchannel.cpp') diff --git a/src/regchannel.cpp b/src/regchannel.cpp index 0b67daf9a..7ff3e753a 100644 --- a/src/regchannel.cpp +++ b/src/regchannel.cpp @@ -571,11 +571,9 @@ void ChannelInfo::LoadMLock() else { if (!this->bi) - { - this->bi = whosends(this); - ++this->bi->chancount; - } - this->bi->Join(this->c); + whosends(this)->Assign(NULL, this); + if (this->c->FindUser(this->bi) == NULL) + this->bi->Join(this->c); } check_modes(this->c); -- cgit