diff options
author | Adam <Adam@anope.org> | 2013-04-11 15:28:53 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-04-11 15:28:53 -0500 |
commit | 6f9dd282d2cdf5dc86a6998d6160f13e23ea9f70 (patch) | |
tree | f6b957303e8f2b7ecef60809bc403221f822ae47 | |
parent | c56d72ba84f5524174582f4b71ff8d1e9c208471 (diff) |
Use SetCorrectModes to set the inital modes on a founder once they register a channel
-rw-r--r-- | modules/commands/cs_register.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/modules/commands/cs_register.cpp b/modules/commands/cs_register.cpp index 0a571100c..5f31d823c 100644 --- a/modules/commands/cs_register.cpp +++ b/modules/commands/cs_register.cpp @@ -77,22 +77,14 @@ class CommandCSRegister : public Command if (c) { c->CheckModes(); - - ChannelMode *cm; - if (u && u->FindChannel(c) != NULL) - { - /* On most ircds you do not receive the admin/owner mode till its registered */ - if ((cm = ModeManager::FindChannelModeByName("OWNER"))) - c->SetMode(NULL, cm, u->GetUID()); - else if ((cm = ModeManager::FindChannelModeByName("PROTECT"))) - c->RemoveMode(NULL, cm, u->GetUID()); - } + if (u) + c->SetCorrectModes(u, true, true); /* Mark the channel as persistent */ if (c->HasMode("PERM")) ci->Extend("PERSIST"); /* Persist may be in def cflags, set it here */ - else if (ci->HasExt("PERSIST") && (cm = ModeManager::FindChannelModeByName("PERM"))) + else if (ci->HasExt("PERSIST")) c->SetMode(NULL, "PERM"); } |