From 5ae5ff46db987f4c4295df862fbcd94c2de135a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20F=C3=A6r=C3=B8y?= Date: Sun, 4 Jan 2015 01:26:15 +0100 Subject: [PATCH] Q: Ignore JoinAfterCloaked unless UseCloakedHost is set This patch ignores the value of JoinAfterCloaked unless UseCloakedHost is set. Without this patch, it's possible to enable JoinAfterCloaked, but not have UseCloakedHost enabled, which means that no channel will ever be joined automatically by ZNC. Fixes: #602 --- modules/q.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/q.cpp b/modules/q.cpp index 00fbb0c8..a64e756b 100644 --- a/modules/q.cpp +++ b/modules/q.cpp @@ -258,7 +258,8 @@ public: m_bCloaked = true; PutModule("Cloak successful: Your hostname is now cloaked."); - // Join channels immediately after our spoof is set. + // Join channels immediately after our spoof is set, but only if + // both UseCloakedHost and JoinAfterCloaked is enabled. See #602. if (m_bJoinAfterCloaked) { GetNetwork()->JoinChans(); } @@ -275,7 +276,9 @@ public: } virtual EModRet OnJoining(CChan& Channel) override { - if (m_bJoinAfterCloaked && !m_bCloaked) + // Halt if are not already cloaked, but the user requres that we delay + // channel join till after we are cloaked. + if (!m_bCloaked && m_bUseCloakedHost && m_bJoinAfterCloaked) return HALT; return CONTINUE;