ZNC-git no longer manages custom CTCP responses. #563

Closed
opened 2026-10-05 04:30:08 +02:00 by adam · 1 comment
Owner

Custom set CTCP responses in ZNC no longer work in the latest git.

 CTCP query to zarthus: VERSION
 CTCP reply from Zarthus: VERSION mIRC v7.42 via ZNC 1.7.x-git-315-2de6169 - http://znc.in
 CTCP query to zarthus: SOURCE
(09:58:28) -> **controlpanel* listctcps Zarthus
(09:58:28) <-*controlpanel> CTCP replies for user [Zarthus]:
(09:58:28) <-*controlpanel> ------
(09:58:28) <-*controlpanel> Request: SOURCE
(09:58:28) <-*controlpanel> Reply: abc
(09:58:28) <-*controlpanel> ------
(09:58:28) <-*controlpanel> Request: VERSION
(09:58:28) <-*controlpanel> Reply: version
(09:58:28) <-*controlpanel> ------

Might be related to this change:

https://github.com/znc/znc/commit/e1ae565e6fc3d77f90ff6d370eeb1ac1aad53ce4

Upon further debugging, it seems like \001 is included in CIRCSock::OnGeneralCTCP(CMessage& Message).

The result of

DEBUG(sMessage)
DEBUG(sQuery)

is

[2015-08-31 12:08:57.228567] (zarthus/fn) IRC -> ZNC [:Zarthus!Zarthus@trivialand/guesser/zarthus PRIVMSG #ttttttt :\x01VERSION\x01]
[2015-08-31 12:08:57.228952] \x01VERSION\x01
[2015-08-31 12:08:57.229090] \x01VERSION\x01

The following "fix" works (Which should probably be used on sQuery instead):

 const CString& sMessage = Message.GetParam(1).TrimPrefix_n("\001").TrimSuffix_n("\001");

For channel CTCPs, but not for

bool CIRCSock::OnPrivCTCP(CMessage& Message) // compiler errors when calling .Trim* methods

Because CPrivCTCP doesn't appear to be a CString. I also don't know if that is the most optimal fix, but I hope my research so far helps someone else.

Custom set CTCP responses in ZNC no longer work in the latest git. ``` CTCP query to zarthus: VERSION CTCP reply from Zarthus: VERSION mIRC v7.42 via ZNC 1.7.x-git-315-2de6169 - http://znc.in CTCP query to zarthus: SOURCE ``` ``` (09:58:28) -> **controlpanel* listctcps Zarthus (09:58:28) <-*controlpanel> CTCP replies for user [Zarthus]: (09:58:28) <-*controlpanel> ------ (09:58:28) <-*controlpanel> Request: SOURCE (09:58:28) <-*controlpanel> Reply: abc (09:58:28) <-*controlpanel> ------ (09:58:28) <-*controlpanel> Request: VERSION (09:58:28) <-*controlpanel> Reply: version (09:58:28) <-*controlpanel> ------ ``` Might be related to this change: https://github.com/znc/znc/commit/e1ae565e6fc3d77f90ff6d370eeb1ac1aad53ce4 Upon further debugging, it seems like \001 is included in `CIRCSock::OnGeneralCTCP(CMessage& Message)`. The result of ``` cpp DEBUG(sMessage) DEBUG(sQuery) ``` is ``` [2015-08-31 12:08:57.228567] (zarthus/fn) IRC -> ZNC [:Zarthus!Zarthus@trivialand/guesser/zarthus PRIVMSG #ttttttt :\x01VERSION\x01] [2015-08-31 12:08:57.228952] \x01VERSION\x01 [2015-08-31 12:08:57.229090] \x01VERSION\x01 ``` The following "fix" works (Which should probably be used on sQuery instead): ``` cpp const CString& sMessage = Message.GetParam(1).TrimPrefix_n("\001").TrimSuffix_n("\001"); ``` For channel CTCPs, but not for ``` cpp bool CIRCSock::OnPrivCTCP(CMessage& Message) // compiler errors when calling .Trim* methods ``` Because CPrivCTCP doesn't appear to be a CString. I also don't know if that is the most optimal fix, but I hope my research so far helps someone else. <!-- github-sync-id:104006499 -->
adam closed this issue 2026-10-05 04:30:08 +02:00
Author
Owner

#1031 includes a fix

#1031 includes a fix <!-- github-comment-id:136505856 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#563