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