diff options
Diffstat (limited to 'modules/protocol/charybdis.cpp')
-rw-r--r-- | modules/protocol/charybdis.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/modules/protocol/charybdis.cpp b/modules/protocol/charybdis.cpp index 028babe73..adb8b0a54 100644 --- a/modules/protocol/charybdis.cpp +++ b/modules/protocol/charybdis.cpp @@ -409,13 +409,14 @@ class ProtoCharybdis : public Module void OnChannelSync(Channel *c) override { - if (!c->ci || !mlocks) + ChanServ::Channel *ci = c->GetChannel(); + if (!ci || !mlocks) return; if (use_server_side_mlock && Servers::Capab.count("MLOCK") > 0) { - Anope::string modes = mlocks->GetMLockAsString(c->ci, false).replace_all_cs("+", "").replace_all_cs("-", ""); - Uplink::Send(Me, "MLOCK", c->creation_time, c->ci->GetName(), modes); + Anope::string modes = mlocks->GetMLockAsString(ci, false).replace_all_cs("+", "").replace_all_cs("-", ""); + Uplink::Send(Me, "MLOCK", c->creation_time, ci->GetName(), modes); } } @@ -424,11 +425,12 @@ class ProtoCharybdis : public Module if (!mlocks) return EVENT_CONTINUE; + Channel *c = ci->GetChannel(); ChannelMode *cm = ModeManager::FindChannelModeByName(lock->GetName()); - if (use_server_side_mlock && cm && ci->c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0) + if (use_server_side_mlock && cm && c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0) { Anope::string modes = mlocks->GetMLockAsString(ci, false).replace_all_cs("+", "").replace_all_cs("-", "") + cm->mchar; - Uplink::Send(Me, "MLOCK", ci->c->creation_time, ci->GetName(), modes); + Uplink::Send(Me, "MLOCK", c->creation_time, ci->GetName(), modes); } return EVENT_CONTINUE; @@ -439,11 +441,12 @@ class ProtoCharybdis : public Module if (!mlocks) return EVENT_CONTINUE; + Channel *c = ci->GetChannel(); ChannelMode *cm = ModeManager::FindChannelModeByName(lock->GetName()); - if (use_server_side_mlock && cm && ci->c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0) + if (use_server_side_mlock && cm && c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0) { Anope::string modes = mlocks->GetMLockAsString(ci, false).replace_all_cs("+", "").replace_all_cs("-", "").replace_all_cs(cm->mchar, ""); - Uplink::Send(Me, "MLOCK", ci->c->creation_time, ci->GetName(), modes); + Uplink::Send(Me, "MLOCK", c->creation_time, ci->GetName(), modes); } return EVENT_CONTINUE; |