summaryrefslogtreecommitdiff
path: root/modules/commands/cs_clone.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-05-05 01:55:04 -0400
committerAdam <Adam@anope.org>2013-05-05 01:55:04 -0400
commit1d0bb9b26b7ad58ab0bf979ac046f4511b3bf12b (patch)
tree4486f0784bdf050fd7eb225c0cb9df352ce1f45a /modules/commands/cs_clone.cpp
parent781defb7076ddfddf723ca08cd0a518b6657b64f (diff)
Rework the config file reader to be much more flexible and move many configuration directives to the actual modules they are used in.
Diffstat (limited to 'modules/commands/cs_clone.cpp')
-rw-r--r--modules/commands/cs_clone.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/modules/commands/cs_clone.cpp b/modules/commands/cs_clone.cpp
index da8c82647..e4c1ac7f6 100644
--- a/modules/commands/cs_clone.cpp
+++ b/modules/commands/cs_clone.cpp
@@ -64,31 +64,25 @@ public:
target_ci->name = target;
(*RegisteredChannelList)[target_ci->name] = target_ci;
target_ci->c = Channel::Find(target_ci->name);
+
+ target_ci->bi = NULL;
+ if (ci->bi)
+ ci->bi->Assign(u, target_ci);
+
if (target_ci->c)
{
target_ci->c->ci = target_ci;
target_ci->c->CheckModes();
- ChannelMode *cm;
- if (u && u->FindChannel(target_ci->c) != NULL)
- {
- /* On most ircds you do not receive the admin/owner mode till its registered */
- if ((cm = ModeManager::FindChannelModeByName("OWNER")))
- target_ci->c->SetMode(NULL, cm, u->GetUID());
- else if ((cm = ModeManager::FindChannelModeByName("PROTECT")))
- target_ci->c->RemoveMode(NULL, cm, u->GetUID());
- }
+ target_ci->c->SetCorrectModes(u, true, true);
/* Mark the channel as persistent */
if (target_ci->c->HasMode("PERM"))
target_ci->ExtendMetadata("PERSIST");
/* Persist may be in def cflags, set it here */
- else if (target_ci->HasExt("PERSIST") && (cm = ModeManager::FindChannelModeByName("PERM")))
- target_ci->c->SetMode(NULL, cm);
-
- if (target_ci->bi && target_ci->c->FindUser(target_ci->bi) == NULL)
- target_ci->bi->Join(target_ci->c, &ModeManager::DefaultBotModes);
+ else if (target_ci->HasExt("PERSIST"))
+ target_ci->c->SetMode(NULL, "PERM");
}
if (target_ci->c && !target_ci->c->topic.empty())