Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZNC erroneously replies to CTCP NOTICE messages to channels. #1624

Closed
AndrioCelos opened this issue Dec 23, 2018 · 1 comment
Closed

ZNC erroneously replies to CTCP NOTICE messages to channels. #1624

AndrioCelos opened this issue Dec 23, 2018 · 1 comment

Comments

@AndrioCelos
Copy link

AndrioCelos commented Dec 23, 2018

It seems that a CTCP NOTICE message to a channel, such as a KVIrc user changing their avatar, is treated the same as if it were a PRIVMSG, so ZNC is sending a configured response if there is one and not passing it on to the client. This seems to be erroneous: the NOTICE message should not be replied to automatically like this.

znc/src/IRCSock.cpp

Lines 428 to 434 in b52fecc

pChan = m_pNetwork->FindChan(sTarget);
if (pChan) {
Message.SetChan(pChan);
FixupChanNick(Message.GetNick(), pChan);
IRCSOCKMODULECALL(OnChanCTCPMessage(Message), &bResult);
if (bResult) return true;
}

(For normal private CTCP messages, the following lines deal with NOTICE replies:)

znc/src/IRCSock.cpp

Lines 420 to 422 in b52fecc

if (Message.IsReply()) {
IRCSOCKMODULECALL(OnCTCPReplyMessage(Message), &bResult);
return bResult;

@psychon
Copy link
Member

psychon commented Dec 23, 2018

Once upon a time, this worked fine. This must be a regression that was introduced by the CMessage "stuff". This handles both PRIVMSG CTCPs and NOTICE CTCPs as being of type CTCP. I guess the right fix would be to introduce a CTCPReply type here...

znc/src/Message.cpp

Lines 226 to 240 in b52fecc

} else if (m_sCommand.Equals("PRIVMSG")) {
CString sParam = GetParam(1);
if (sParam.TrimPrefix("\001") && sParam.EndsWith("\001")) {
if (sParam.StartsWith("ACTION ")) {
m_eType = Type::Action;
} else {
m_eType = Type::CTCP;
}
} else {
m_eType = Type::Text;
}
} else if (m_sCommand.Equals("NOTICE")) {
CString sParam = GetParam(1);
if (sParam.StartsWith("\001") && sParam.EndsWith("\001")) {
m_eType = Type::CTCP;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants