| 1 |
@(#)$eterna: ctcp,v 1.4 2024/01/11 18:51:53 mrg Exp $ |
| 2 |
|
| 3 |
ircII CTCP implementation notes: |
| 4 |
|
| 5 |
[ i've heard and seen all sorts of CTCP specification papers |
| 6 |
but this document describes what ircII has done for at least |
| 7 |
7 years --mrg 1999/3/7 ] |
| 8 |
|
| 9 |
|
| 10 |
ircII sends ctcp messages in the following format: |
| 11 |
|
| 12 |
^A<type>[ <type-specific-data>]^A |
| 13 |
|
| 14 |
where <type> and <type-specific-data> are the ctcp request (version, |
| 15 |
dcc, etc.) and any data supplied with the request. ctcp request |
| 16 |
messages are always sent as an IRC PRIVMSG command. ctcp reply |
| 17 |
messages are always send as an IRC NOTICE command. this limits |
| 18 |
the scope of CTCP to IRC currently [*], if you wish to use replies. |
| 19 |
|
| 20 |
multiple requests can be sent in one message, by simply putting |
| 21 |
them together, either back to back, or with normal message text |
| 22 |
in between. ircII strips the ctcp messages out, processes then, |
| 23 |
and returns the remaining text. |
| 24 |
|
| 25 |
ctcp quoting. |
| 26 |
|
| 27 |
as CTCP uses the ^A character as a message delimiter, it makes |
| 28 |
it impossible to send an embedded ^A without some quoting mechanism. |
| 29 |
ircII uses the typical UNIX quote character \ to quote these |
| 30 |
characters: |
| 31 |
real character converted string description |
| 32 |
^A \ a - ctcp message delimiter |
| 33 |
\n \ n - new line |
| 34 |
\r \ r - line feed |
| 35 |
\ \ \ - quote character |
| 36 |
\0 \ 0 - null character |
| 37 |
: \ : - irc message separator |
| 38 |
|
| 39 |
by converting them into the two characters in the second column. |
| 40 |
each of the above characters is able to corrupt the data if it |
| 41 |
is not quoted. |
| 42 |
|
| 43 |
|
| 44 |
[email protected] |
| 45 |
|
| 46 |
|
| 47 |
[*] one possible way would be to define that the ctcp reply request |
| 48 |
is really a ctc reply. eg, i send ^AREPLY VERSION <my version>^A |
| 49 |
as a "normal message". |