After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 755722 - Joining channel with capital letters create two entries - one with small letters and one with as you entered
Joining channel with capital letters create two entries - one with small lett...
Status: RESOLVED FIXED
Product: polari
Classification: Applications
Component: general
3.18.x
Other Linux
: Normal normal
: ---
Assigned To: Polari maintainers
Polari maintainers
: 747974 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-09-28 09:52 UTC by Peteris Krisjanis
Modified: 2015-10-10 23:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
room: Minor refactoring (1.65 KB, patch)
2015-10-01 21:25 UTC, Florian Müllner
committed Details | Review
room: Improve channel-name <-> channel matching (2.81 KB, patch)
2015-10-01 21:25 UTC, Florian Müllner
committed Details | Review
app: Factor out _savedChannelIndex() help method (3.03 KB, patch)
2015-10-01 21:25 UTC, Florian Müllner
committed Details | Review
app: Handle case-mismatches when saving/removing channels (1.32 KB, patch)
2015-10-01 21:25 UTC, Florian Müllner
committed Details | Review
chatroomManager: Use contact alias as channel name if available (1.30 KB, patch)
2015-10-01 21:25 UTC, Florian Müllner
committed Details | Review

Description Peteris Krisjanis 2015-09-28 09:52:43 UTC
1. Opening Polari;
2. Adding network connection (for example quakenet.org);
3. Opening room (in this example #Elite-Dangerous);
4. Two 'channels' are opened - one with #Elite-Dangerous, another with #elite-dangerous. Active is with small leters, #Elite-Dangerous is empty;

Should be reproducable all the time, Fedora 23 with updates here.
Comment 1 Florian Müllner 2015-10-01 21:25:04 UTC
Created attachment 312529 [details] [review]
room: Minor refactoring

Turn update_identifier() into a standard property setter for :display-name
instead of tying it directly to :channel-name - the two may soon differ
in case.
Comment 2 Florian Müllner 2015-10-01 21:25:12 UTC
Created attachment 312530 [details] [review]
room: Improve channel-name <-> channel matching

When we request a channel, we currently assume that the resulting
channel's identifier will match the channel name we used in the
request. However as telepathy-idle converts all channel names to
lowercase [0], we fail to match names containing uppercase characters
to their channel and end up creating a second room for the channel
instead. Fix this by using lower-case for both room IDs and channel
matching.

[0]
http://cgit.freedesktop.org/telepathy/telepathy-idle/tree/src/idle-handles.c#n158
Comment 3 Florian Müllner 2015-10-01 21:25:18 UTC
Created attachment 312531 [details] [review]
app: Factor out _savedChannelIndex() help method

We search the list of saved channels for a particular account/channel
combination both when adding a saved channel (to avoid duplicate entries)
and when removing one (to locate the entry to remove).
Consolidate that code in a single place to make future modifications
easier.
Comment 4 Florian Müllner 2015-10-01 21:25:24 UTC
Created attachment 312532 [details] [review]
app: Handle case-mismatches when saving/removing channels

While we now match non-lowercase channel names correctly to their
corresponding channel, we still (wrongly) assume that requested
names match channel identifiers when adding or removing saved
channels. Fix this by making the channel matching case-insensitive.
Comment 5 Florian Müllner 2015-10-01 21:25:30 UTC
Created attachment 312533 [details] [review]
chatroomManager: Use contact alias as channel name if available

We use TpContact:alias to represent other users in the user list
and elsewhere, so for private conversations it makes for a better
channel name than the channel identifier in case the two differ
(which may happen as the latter is always lowercase).
Comment 6 Florian Müllner 2015-10-01 21:26:04 UTC
Attachment 312529 [details] pushed as 3a578c5 - room: Minor refactoring
Attachment 312530 [details] pushed as 597c8c6 - room: Improve channel-name <-> channel matching
Attachment 312531 [details] pushed as dbe2395 - app: Factor out _savedChannelIndex() help method
Attachment 312532 [details] pushed as 1e9a070 - app: Handle case-mismatches when saving/removing channels
Attachment 312533 [details] pushed as 8b4dec5 - chatroomManager: Use contact alias as channel name if available
Comment 7 Florian Müllner 2015-10-10 23:54:26 UTC
*** Bug 747974 has been marked as a duplicate of this bug. ***