Closed Bug 955243 Opened 10 years ago Closed 10 years ago

Fix erroneous nickname error message when nick contains spaces

Categories

(Chat Core :: IRC, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: benediktp, Assigned: aleth)

Details

Attachments

(1 file)

*** Original post on bio 1810 at 2012-11-19 11:52:00 UTC ***

It's possible to enter spaces in IRC nicknames and we shouldn't allow that (I've never heard that this would be valid anywhere).

Example:
Setting up an account with nick "Mic 2" on chat.freenode.net results in the error message "Error: Mic is not an allowed nickname" in the account manager and the following error on the console.

Timestamp: 19.11.2012 12:48:05
Error: Erroneous nickname Mic: 2
Source File: resource:///modules/ircBase.jsm
Line: 1182
Source Code:
irc
*** Original post on bio 1810 at 2012-11-19 12:54:56 UTC ***

The error in comment 0 appears when connecting the account, not while setting it up by the way.
It's created from a server response: lxr.instantbird.org/instantbird/source/chat/protocols/irc/ircBase.jsm
*** Original post on bio 1810 at 2012-11-19 13:10:22 UTC ***

The minimal solution would be to fix the error message so it includes the whole nick, i.e. in http://lxr.instantbird.org/instantbird/source/chat/protocols/irc/ircBase.jsm#1177 and following use this._requestedNickname instead of the message parameter.
Attached patch PatchSplinter Review
*** Original post on bio 1810 as attmnt 2147 at 2012-11-30 20:46:00 UTC ***

Fixes the incomplete error message as an immediate improvement.

Maybe we should do better to test for allowed nicknames before connecting, but this would have to be handled across protocols.
Attachment #8353909 - Flags: review?(clokep)
*** Original post on bio 1810 at 2012-11-30 23:43:14 UTC ***

(In reply to comment #3)
> Created attachment 8353909 [details] [diff] [review] (bio-attmnt 2147) [details]
> Patch
> 
> Fixes the incomplete error message as an immediate improvement.
Any chance you have an example message which can be returned? :)

> Maybe we should do better to test for allowed nicknames before connecting, but
> this would have to be handled across protocols.
And...refuse to connect if the nick is invalid? Maybe...(really spaces are the only definitely not allowed character, as far as I know).
*** Original post on bio 1810 at 2012-12-04 14:14:32 UTC ***

(In reply to comment #4)
> (In reply to comment #3)
> > Created attachment 8353909 [details] [diff] [review] (bio-attmnt 2147) [details]
> > Patch
> > 
> > Fixes the incomplete error message as an immediate improvement.
> Any chance you have an example message which can be returned? :)

See the bug description for an example. "Error: Mic is not an allowed nickname" should be "Error: Mic 2 is not an allowed nickname" etc. (It's trivial, just due to the fact that when parsing the message we interpret what's after the space as a new parameter)
Comment on attachment 8353909 [details] [diff] [review]
Patch

*** Original change on bio 1810 attmnt 2147 at 2012-12-04 14:35:29 UTC was without comment, so any subsequent comment numbers will be shifted ***
Attachment #8353909 - Flags: review?(clokep) → review+
*** Original post on bio 1810 at 2012-12-04 14:36:44 UTC ***

What are the expected results of entering an incorrect nick Mic?
Assignee: nobody → aleth
Status: NEW → ASSIGNED
Whiteboard: [checkin-needed]
*** Original post on bio 1810 at 2012-12-05 23:37:41 UTC ***

Committed as http://hg.instantbird.org/instantbird/rev/7e68c90fff6f

I'm going to close this, feel free to reopen if it is inadequate.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [checkin-needed]
Target Milestone: --- → 1.4
*** Original post on bio 1810 at 2012-12-10 09:44:43 UTC ***

(In reply to comment #6)
> What are the expected results of entering an incorrect nick Mic?

This is an acceptable solution in my opinion. I'm changing the bug description to what was actually done here.

(In reply to comment #0)
> It's possible to enter spaces in IRC nicknames and we shouldn't allow that
> (I've never heard that this would be valid anywhere).

Do we want a new bug for this?

--

Do you get the error message when trying to use a nick with space(s) inside? What I've seen is such an account trying to reconnect over and over again. Not even clicking "disconnect" ended it. Might be a problem on my side though.
Summary: Filter spaces from IRC nick-/account names → Fix erroneous nickname error message when nick contains spaces
You need to log in before you can comment on or make changes to this bug.