Open Bug 1318710 Opened 5 years ago Updated 3 years ago

xmpp "auto join" chat does not accommodate a Nick that is two discrete words


(Chat Core :: XMPP, defect)

Not set


(Not tracked)


(Reporter: djo, Unassigned)


User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36

Steps to reproduce:

Set up an XMPP connection to HipChat.

Click "Join Chat"

My username on HipChat is my full first and last name.  HipChat requires that this be my nick when joining chat windows.

* Enter id_roomname (e.g.: 12345_watercooler) for the room.
* Change the Nick field to my full first and last name as it is in HipChat.
* Click Auto-join this Chat Room
* Click OK

The room is successfully joined.

Close Thunderbird, then restart it.

Reopen the chat tab or switch to it.

That chat room is not successfully rejoined.

Checking the error log window shows that Thunderbird only passed my first name, not my first and last name, as the nick after restart.  Consequently, HipChat refused the connection request when Thunderbird was restarted.

Checking the accounts window, the HipChat XMPP account shows that the room was successfully added to the "Auto-Joined Channels" field, including my first and last name.

Actual results:

Thunderbird is unable to rejoin chat channels after a restart if the XMPP nick contains one or more spaces.

Expected results:

Thunderbird should rejoin chat channels after a restart regardless of if the XMPP nick contains one or more spaces or not.
Ever confirmed: true
Component: Instant Messaging → XMPP
Product: Thunderbird → Chat Core
Version: 45 Branch → 45

In prefs.js the entry that holds the nickname is

user_pref("messenger.account.accountNNN.autoJoin", "....");

I tried escaping embedded spaces in the nickname with backslash, like

".../Genghis\\ Khan"

but it did not work: only the first part is used for nickname.

I tried encoding embedded space as %20, like


but then %20 becomes part of the nickname.

So, no workaround found.

If this issue were fixed then a way to represent nicknames with spaces is needed for the

user_pref("messenger.account.accountNNN.autoJoin", "....")

setting in prefs.js. The value string can contain multiple entries separated by commas, where each entry seems to have the format


Assuming that a nickname must not contain commas then a value string like the following could still be parsed:

" Lisa, Ewing"

Is this a reasonable representation? Or should it be done some other way?

(In reply to Rabbe Fogelholm from comment #2)

Is this a reasonable representation? Or should it be done some other way?

The best way would be to store the data as JSON, but this would require building a better UI to add/remove/edit auto-joined rooms.

If we want a minimal fix, url encoding (so that the space becomes %20) would be the thing we could do with the lowest effort.

(In reply to Florian Quèze [:florian] from comment #3)

Ok, url encoding sounds like a good way to go.

I can think of three ways that a user could create a nickname with spaces:

  1. By typing a nickname with spaces in the "Nick" field in the "Join chat" dialog (works today, but not persistently)

  2. By typing /nick Mmm Nnn when already in a room (does not work today, only 'Mmm' is kept)

  3. By editing prefs.js (requiring knowledge of the url encoding scheme)

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