From dde444ed0ec31245545a57e1fc220f1e2308cec0 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 6 Feb 2017 13:15:01 -0500 Subject: [PATCH] protocol/inspircd12: set +x on /hs off --- modules/protocol/inspircd12.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/protocol/inspircd12.cpp b/modules/protocol/inspircd12.cpp index 348969285..39963f391 100644 --- a/modules/protocol/inspircd12.cpp +++ b/modules/protocol/inspircd12.cpp @@ -151,13 +151,14 @@ class InspIRCd12Proto : public IRCDProto void SendVhostDel(User *u) anope_override { - if (u->HasMode("CLOAK")) - this->SendChgHostInternal(u->nick, u->chost); - else - this->SendChgHostInternal(u->nick, u->host); + UserMode *um = ModeManager::FindUserModeByName("CLOAK"); - if (Servers::Capab.count("CHGIDENT") && u->GetIdent() != u->GetVIdent()) - this->SendChgIdentInternal(u->nick, u->GetIdent()); + if (um && !u->HasMode(um->name)) + // Just set +x if we can + u->SetMode(NULL, um); + else + // Try to restore cloaked host + this->SendChgHostInternal(u->nick, u->chost); } void SendAkill(User *u, XLine *x) anope_override