/msg foo tries to send the message "foo" to a blank nick

RESOLVED FIXED in 1.6

Status

Chat Core
IRC
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: nhnt11, Assigned: nhnt11)

Tracking

trunk
x86
Mac OS X

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

3 years ago
Typing |/msg  foo| (two spaces between /msg and foo) in a conversation window is expected to open a conversation with foo, but instead tries to send the message "foo" to a blank nick. This results in the following error:

Timestamp: 06/06/14 5:25:55 am
Error: ERR_NOTEXTTOSEND: No text to send for PRIVMSG.
Source File: resource://gre/modules/ircBase.jsm
Line: 1127
Source Code:
prpl-irc: ircBase.commands[412]

This makes me think that when sending the raw message, IRC sees it as sending a message to a nick "foo" but there's no message (I'm thinking the line is something like |PRIVMSG  foo|).
(Assignee)

Comment 1

3 years ago
Created attachment 8435396 [details] [diff] [review]
Patch

Trim leading whitespace in messageCommand().
Attachment #8435396 - Flags: review?(clokep)
Comment on attachment 8435396 [details] [diff] [review]
Patch

Review of attachment 8435396 [details] [diff] [review]:
-----------------------------------------------------------------

::: chat/protocols/irc/ircCommands.jsm
@@ +43,5 @@
>  // aMsg is <user> <message>
>  // aReturnedConv is optional and returns the resulting conversation.
>  function messageCommand(aMsg, aConv, aReturnedConv) {
> +  // Trim leading whitespace.
> +  aMsg = aMsg.replace(/^\s+/, "");

Seems that there is a trimLeft function. I imagine this has better performance than a regexp: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimLeft
Attachment #8435396 - Flags: review?(clokep) → review-
(Assignee)

Comment 3

3 years ago
Created attachment 8436066 [details] [diff] [review]
Patch v2 - use trimLeft
Attachment #8435396 - Attachment is obsolete: true
Attachment #8436066 - Flags: review?(clokep)
Attachment #8436066 - Flags: review?(clokep) → review+
(Assignee)

Updated

3 years ago
Keywords: checkin-needed
https://hg.mozilla.org/comm-central/rev/4775099e4d95
Assignee: nobody → nhnt11
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 1.6
You need to log in before you can comment on or make changes to this bug.