Page 1 of 1
Limited IRC channel topic content
Posted: Fri Jun 10, 2005 12:25 am
by _togo_
Just curious. Why is it that all topics in every channel have a limited topic amount...i.e....can put so many characters in the topic?
Thanks in advance.
Posted: Fri Jun 10, 2005 12:40 am
by Stealth
They are limited because everything on IRC has a limit. They are limited to 307 characters IIRC. In the protocol, you can only send 512 bytes to the client in 1 line, so that means there is the topic, the setter's nick, and in some cases the setter's address. I also think there is room left for other server-to-server things, such as the timestamp.
Posted: Fri Jun 10, 2005 3:18 am
by aquanight
Consider the regular server->client topic message (assuming maximum length on everything).
: (1) + NICKLEN (30) + ! (1) + USERLEN (10) + @ (1) + HOSTLEN (63) + <space>TOPIC<space> (7) + CHANNELLEN (32) + <space>: (2) + TOPICLEN (307)
This adds up to 454. This is the longest of the three cases in which the topic appears. Since IRC messages are limited to 510 characters (512 when you include the terminating CRLF). In theory the topic could be expanded by 56 characters. However, if 307 isn't enough for you then you need to think about what you're trying to put in there. :P
Posted: Fri Jun 10, 2005 11:15 pm
by DJ747
some channel services (like anope) allow you to have an entry message, so if you like a bigger topic just use that, or bring in a bot that sends a notice to someone when they join.