Don't send emulated chghost-JOIN to channels where the nick wasn't

Fix #1924
This commit is contained in:
Alexey Sokolov
2024-12-29 14:54:20 +00:00
parent 1224d303aa
commit 579906d686
2 changed files with 29 additions and 4 deletions
+6 -4
View File
@@ -550,10 +550,6 @@ bool CIRCSock::OnChgHostMessage(CChgHostMessage& Message) {
if (pChan->IsDisabled()) continue;
if (pChan->IsDetached()) continue;
CTargetMessage ModeMsg;
ModeMsg.SetNick(CNick(":irc.znc.in"));
ModeMsg.SetTags(Message.GetTags());
ModeMsg.SetCommand("MODE");
VCString vsModeParams = {pChan->GetName(), "+"};
if (CNick* pNick = pChan->FindNick(NewNick.GetNick())) {
for (char cPerm : pNick->GetPermStr()) {
@@ -563,7 +559,13 @@ bool CIRCSock::OnChgHostMessage(CChgHostMessage& Message) {
vsModeParams.push_back(NewNick.GetNick());
}
}
} else {
continue;
}
CTargetMessage ModeMsg;
ModeMsg.SetNick(CNick(":irc.znc.in"));
ModeMsg.SetTags(Message.GetTags());
ModeMsg.SetCommand("MODE");
ModeMsg.SetParams(std::move(vsModeParams));
for (CClient* pClient : m_pNetwork->GetClients()) {