summaryrefslogtreecommitdiff
path: root/modules/commands/cs_set.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-03-01 19:59:40 -0500
committerAdam <Adam@anope.org>2014-03-01 19:59:40 -0500
commit4d54358745977b57eddb957a7e0b0a8374e15ff4 (patch)
treebe03111a20a744faf700f4762f8811a65b543e6d /modules/commands/cs_set.cpp
parented0882ec04fb0d3bb288df3390dd120728ff021a (diff)
When unserializating channels and persist is set, only assign chanserv if the perm channel mode doesnt exist
Diffstat (limited to 'modules/commands/cs_set.cpp')
-rw-r--r--modules/commands/cs_set.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/modules/commands/cs_set.cpp b/modules/commands/cs_set.cpp
index 5769adb30..993dbf8f8 100644
--- a/modules/commands/cs_set.cpp
+++ b/modules/commands/cs_set.cpp
@@ -1164,17 +1164,26 @@ class CSSet : public Module
bool created;
Channel *c = Channel::FindOrCreate(ci->name, created, ci->time_registered);
- if (!ci->bi)
+
+ ChannelMode *cm = ModeManager::FindChannelModeByName("PERM");
+ if (cm)
{
- BotInfo *ChanServ = Config->GetClient("ChanServ");
- if (ChanServ)
- ChanServ->Assign(NULL, ci);
+ c->SetMode(NULL, cm);
}
-
- if (ci->bi && !c->FindUser(ci->bi))
+ else
{
- ChannelStatus status(BotModes());
- ci->bi->Join(c, &status);
+ if (!ci->bi)
+ {
+ BotInfo *ChanServ = Config->GetClient("ChanServ");
+ if (ChanServ)
+ ChanServ->Assign(NULL, ci);
+ }
+
+ if (ci->bi && !c->FindUser(ci->bi))
+ {
+ ChannelStatus status(BotModes());
+ ci->bi->Join(c, &status);
+ }
}
if (created)