Last Comment Bug 801582 - Line length in the new IRC chat module not restricted or restrictable by option
: Line length in the new IRC chat module not restricted or restrictable by option
Status: RESOLVED FIXED
:
Product: Thunderbird
Classification: Client Software
Component: Instant Messaging (show other bugs)
: 16 Branch
: x86_64 Linux
: -- enhancement (vote)
: Thunderbird 19.0
Assigned To: Patrick Cloke [:clokep]
:
:
Mentors:
https://bugzilla.instantbird.org/show...
Depends on: 812921
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-15 03:54 PDT by Markus Majer
Modified: 2012-11-25 06:32 PST (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments

Description Markus Majer 2012-10-15 03:54:53 PDT
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:16.0) Gecko/20100101 Firefox/16.0
Build ID: 20121010223843

Steps to reproduce:

Typed a line in IRC which was to long for the IRC protocol


Actual results:

The line was cut after 512 characters as described in the IRC specification


Expected results:

A. The input box should not allow more than 512 characters

OR (better)

B. Thunderbird should cut the text in several 512 long lines to meet the IRC specification.

PS: A warning dialog for too long overall text (for example a message who would create more then 10 irc lines) should appear, would be also nice to have, in case of clipboard accidents.
Comment 1 Patrick Cloke [:clokep] 2012-10-15 05:10:45 PDT
(In reply to Markus Majer from comment #0)
> The line was cut after 512 characters as described in the IRC specification

For reference from RFC 2812, Section 2.3:
> IRC messages are always lines of characters terminated with a CR-LF
> (Carriage Return - Line Feed) pair, and these messages SHALL NOT
> exceed 512 characters in length, counting all characters including
> the trailing CR-LF. Thus, there are 510 characters maximum allowed
> for the command and its parameters.  There is no provision for
> continuation of message lines.  See section 6 for more details about
> current implementations.

The tricky part of this is that the message CONTENT isn't what is limited to 512 characters, it is the message itself. (And some servers will do stupid things like if I sent a message that is exactly 512 characters, but it has to send it out in such a way that extra characters are added...it will silently drop the extra characters.)

> B. Thunderbird should cut the text in several 512 long lines to meet the IRC
> specification.

The corresponding Instantbird bug suggests implementing this [2]. (That has a proof of concept code to split a message on spaces, if possible. It should be fairly easy for someone to convert this into a patch.)

> PS: A warning dialog for too long overall text (for example a message who
> would create more then 10 irc lines) should appear, would be also nice to
> have, in case of clipboard accidents.

For what it's worth we do set the maxMessageLength to 512 [1]. I'm unsure of the Thunderbird UI uses this information (Instantbird shows a counter when you get too close, I believe).

Showing a warning dialog seems excessive, we should just be able to handle it gracefully.

[1] http://lxr.instantbird.org/instantbird/source/chat/protocols/irc/irc.js#680
[2] https://bugzilla.instantbird.org/show_bug.cgi?id=1712
Comment 2 Patrick Cloke [:clokep] 2012-11-25 06:32:52 PST
(In reply to Markus Majer from comment #0)
> B. Thunderbird should cut the text in several 512 long lines to meet the IRC
> specification.

This was done as part of bug 812921.

Note You need to log in before you can comment on or make changes to this bug.