diff options
Diffstat (limited to 'modules/commands/cs_set.cpp')
-rw-r--r-- | modules/commands/cs_set.cpp | 25 |
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) |