Open twisted-trac opened 18 years ago
@exarkun set owner to nullie |
---|
This seems like it might be a good improvement to make. The change should be backwards compatible, though. That means deleting all those functions shouldn't happen and the signature change should be avoided. There's also a problem with communicating with freenode with this patch -- parsing the message into two parts in ctcpParse sometimes fails with a TypeError
.
gnuk commented |
---|
#!html
<pre>
Hello,
I use twisted.words for an irc log bot.
I join a peace of code whose get mistake meet error,
based on example ircLogBot.py
(http://twistedmatrix.com/projects/words/documentation/examples/ircLogBot.py).
Bot connect to server and join a channel, and when an user say :
"foobar \o/", log's bot indicate :
"2005/11/12 20:23 CET [LogBot,client] raw data from privmsg : foobar \o/",
but when an user say :
"/me foobar \o/", an action, log's bot indicate :
"2005/11/12 20:23 CET [LogBot,client] raw data from action : foobar o/",
escape character « \ » (in python) disapear.
If an user say :
"/me foobar \\o/", always an action, but with additional escape character,
log's bot indicate :
"2005/11/12 20:23 CET [LogBot,client] raw data from action : foobar \o/".
I think it's just an error with escape characters in basic.LineReceiver, but I
don't find
any mistake in source.
Thanks,
Sorry for my poor english.
</pre>
nullie commented |
---|
Ok. I've figured out that this due to ctcp quoting and dequoting. According to http://www.irchelp.org/irchelp/rfc/ctcpspec.html, extended messages (and ACTION is extended message), must be quoted, using backslash ("\") as escape character. And Twisted respects this in both directions (quoting and dequoting). But most (all? I tried X-Chat, epic4, inettool (mobile client)) conventional IRC clients don't quote and dequote ACTION ctcp messages.
Should we add special handling for ACTION ctcp message?
nullie commented |
---|
http://www.irchelp.org/irchelp/rfc/index.html says that more current ctcp specification, adopted by major irc client is at: http://www.invlogic.com/irc/ctcp.html But that document is confusing on subject of CTCP high-level quoting. Maybe we should consider quoting only X-DELIM to be safe.
nullie commented |
---|
I've also found this: http://www.invlogic.com/irc/ctcp2_3.html
nullie commented |
---|
http://www.kvirc.de/docu/doc_ctcp_handling.html has a nice view. Current implementation in Twisted incorporates part of that approach.
We may assume there is only one CTCP extended message in IRC message and forget about CTCP quoting, only adopting practices of current clients to be compatible with them.
Attachments:
Searchable metadata
``` trac-id__1335 1335 type__defect defect reporter__gnuk gnuk priority__high high milestone__ branch__ branch_author__ status__new new resolution__ component__words words keywords__ time__1132440804000000 1132440804000000 changetime__1205777175000000 1205777175000000 version__ owner__nullie nullie cc__exarkun cc__gnuk ```