Open Bug 363020 Opened 13 years ago Updated 5 years ago

Any server url with a hyphen (dash) in its host or domainname gets the hyphen dropped in favor of a period in ChatZilla Preferences

Categories

(Other Applications :: ChatZilla, defect)

defect
Not set

Tracking

(Not tracked)

People

(Reporter: sp6, Assigned: rginda)

References

()

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20060601 Firefox/2.0 (Ubuntu-edgy)
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20060601 Firefox/2.0 (Ubuntu-edgy)

Something in the translation to user_pref information in prefs.js changes all periods in the domain and hostnames to dashes.  Then the translation back into the Prefs menu in ChatZilla translates the dashes back to a dot but not all of the dashes were dots originally.

What ends up happening is that you get two entries for your server name, one as its name really looks and the other with any dash replaced with a dot.  Both entries have all the automatically connected channels you have connected.  It doesn't appear that a change to a channel preference in one affects the other but I haven't exhaustively tested that.

By the way it is not sufficient to connect to an IRC server such as the one given in the URL.  You must join at least one channel.  Then close and reopen your preferences and you'll see the duplication of the server.  I believe if you then close Chatzilla completely and restart it you'll get the duplication of the channel under both server copies.

Doesn't seem to affect operation -- outside of lots of password prompts if you require a password for the irc server -- but is kind of wierd.

By the way the server I use regularly I'm not at liberty to provide the URL of so since things are reproducable with irc://irc-hispano.org I've provided it.

Reproducible: Always

Steps to Reproduce:
1.  /server irc-hispano.org
2.  /join #magic
3.  open ChatZilla/Prefs
4.  In the server list column you should see both a irc-hispano.org and an irc.hispano.org
5.  It appears that the real name version goes when you disconnect and the one with the dot replacing the original dash stays.

Actual Results:  
Duplicate copies of the server name

Expected Results:  
Only a single copy with the actual irc hostname
confirmed with seamonkey/chatzilla trunk build 2006-12-06-08
Status: UNCONFIRMED → NEW
Ever confirmed: true
This is a known, long-standing issue with how prefs are saved; we turn the "."s into "-"s and ":"s into "_"s so that we don't mess up the hierarchical preference names.

http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/extensions/irc/xul/content/prefs.js&rev=1.40&mark=385-389#384

The preference window then reverses the change, and that's why you get the dot in place of dash. It then adds any currently connected things which, because the names don't match, gives you the 'right' name too. I'm not entirely sure which one, or even if both (if you only change one at a time) will keep changes.
OS: Linux → All
Hardware: Other → All
(In reply to comment #2)
> This is a known, long-standing issue with how prefs are saved; we turn the "."s
> into "-"s and ":"s into "_"s so that we don't mess up the hierarchical
> preference names.
> 
> http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/extensions/irc/xul/content/prefs.js&rev=1.40&mark=385-389#384
> 
> The preference window then reverses the change, and that's why you get the dot
> in place of dash. It then adds any currently connected things which, because
> the names don't match, gives you the 'right' name too. I'm not entirely sure
> which one, or even if both (if you only change one at a time) will keep
> changes.
> 

Thanks for the pointer to the code.  I may try to run it on my PC without the '-' to '.' translation and see how it works.

FYI -- the session manager plugin seems to use hyphens without problem.

user_pref("sessionsaver.static.Main-Session_From_Archive_(1.5.06).zorder", ",ses
sion0");
user_pref("sessionsaver.static.default_(previous-save)_(2.6.06).II.zorder", "ses
sion0");

I'm sorry if I wasn't clear: it's the dots that mess up the preference name, which is why they are converted to something else.
My mistake, sorry for getting it backwards.

Is there any chance that using %2D for the existing hyphens before translating the periods to hyphens would retain the information?

Wish I could change the name of the irc server but its not in my influence.

Thanks for the responses so far -- I understand if it is not a high priority or is  a really thorny issue to solve.

Bob
Using %-escape codes for "." and ":" is the preferred way to do it (then there is no need to convert them to anything else, so the hyphens are safe); I believe the only reason it's not been done to date is the issue of migrating the pref names without simply losing them.
Duplicate of this bug: 384291
QA Contact: samuel → chatzilla
You need to log in before you can comment on or make changes to this bug.