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 631236 - Adding # on mistyping of channel names
Adding # on mistyping of channel names
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: Chat
2.30.x
Other Linux
: Normal enhancement
: ---
Assigned To: empathy-maint
Depends on:
Blocks:
 
 
Reported: 2010-10-03 15:38 UTC by Yaron Shahrabani
Modified: 2012-01-09 23:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
I added "#" when user is trying to enter a room when the protocol is irc (1.07 KB, patch)
2012-01-06 13:06 UTC, Jovanka
committed Details | Review
disable join button (851 bytes, patch)
2012-01-08 22:39 UTC, Jovanka
none Details | Review
disable join button (1.38 KB, patch)
2012-01-09 00:30 UTC, Jovanka
reviewed Details | Review
Disable join button (1.09 KB, patch)
2012-01-09 23:19 UTC, Jovanka
committed Details | Review

Description Yaron Shahrabani 2010-10-03 15:38:25 UTC
There were many times when I forgot the # before the channel name in IRC and empathy simply did nothing instead of notifying me that the # sign is missing or adding it automtically like every other normal chatting app does.

Can this be fixed?

Kind regards,
Yaron Shahrabani.
Comment 1 Guillaume Desmottes 2010-10-04 08:22:20 UTC
I just tried using xchat-gnome and it doesn't automatically add the # prefix? Which client is doing that? If we start doing that would be only with IRC but I'd prefer to be sure that won't add any nasty side effect.
Comment 2 Yaron Shahrabani 2010-10-04 09:01:27 UTC
I just tried pidgin and I got an error message displaying that the channel I typed does not exist... that's a progress...

In mIRC for Windows it works, I don't know whether it works in the current version but when I tried it several years ago it worked perfectly...
Comment 3 Jovanka 2011-12-22 22:46:18 UTC
I wanted to ask what do you think about solving this problem? 
Should there be  # in the textbox that can be erased or display an error message saying that the user should have # in front of the name of the channel? 
For example XChat has # in the textbox.
Comment 4 Danielle Madeley 2011-12-23 00:28:57 UTC
I like the first idea. On IRC connections we should put a # in the textbox.

Ideally we should also display a useful error returned by the CM (surely we do already?). Then if the CM returns InvalidHandle as the reason it couldn't handle the channel request, for IRC we could add that valid rooms typically begin with a #, e.g. #empathy.
Comment 5 Jovanka 2012-01-06 13:06:59 UTC
Created attachment 204742 [details] [review]
I added "#" when user is trying to enter a room when the protocol is irc

It makes easy for the user to know that there should be "#" in front of the name of the room (irc). This is solving the problem because there wasn't any kind of error showing the user that he made a mistake.
Comment 6 Jovanka 2012-01-06 13:16:24 UTC
Should I also disable join button until the user enters name of room?
Comment 7 Guillaume Desmottes 2012-01-06 14:26:47 UTC
Review of attachment 204742 [details] [review]:

Looks good, I'll do some cosmetic tweaks and push the patch. thanks!
Comment 8 Danielle Madeley 2012-01-08 00:53:53 UTC
(In reply to comment #6)
> Should I also disable join button until the user enters name of room?

I think so :)
Comment 9 Jovanka 2012-01-08 22:39:35 UTC
Created attachment 204843 [details] [review]
disable join button

Because adding # in textbox made join button enabled with this join button is disabled untill user starts to enter rooms name
Comment 10 Jovanka 2012-01-09 00:30:51 UTC
Created attachment 204846 [details] [review]
disable join button

Checks if the protocol is irc, then if the first sign in textbox is "#" or "&" and disables join button
Comment 11 Danielle Madeley 2012-01-09 00:52:33 UTC
Review of attachment 204846 [details] [review]:

Looks good. Only style things and one bit of commit cruft.

::: src/empathy-new-chatroom-dialog.c
@@ +405,3 @@
 		goto out;
 
+	if (g_strcmp0 (protocol, "irc") == 0)

tp_strdiff() is preferred.

@@ +407,3 @@
+	if (g_strcmp0 (protocol, "irc") == 0)
+	{
+		if (!(tp_strdiff (room, "#")) || !(tp_strdiff (room, "&")))

Brackets inside ! are not required here.

@@ +408,3 @@
+	{
+		if (!(tp_strdiff (room, "#")) || !(tp_strdiff (room, "&")))
+		{

These braces are optional, so I would personally leave them out to match the style of the surrounding code.

@@ +466,3 @@
 	gtk_widget_grab_focus (dialog->entry_room);
 	gtk_editable_set_position (GTK_EDITABLE (dialog->entry_room), -1);
+

This looks like your previous patch being removed. You should squash unwanted commits away either with 'git commit --amend' or 'git rebase -i'
Comment 12 Jovanka 2012-01-09 23:19:39 UTC
Created attachment 204912 [details] [review]
Disable join button

Disables join button if protocol is irc and the first character in the textbox is "#" or "&"
Comment 13 Danielle Madeley 2012-01-09 23:23:37 UTC
Review of attachment 204912 [details] [review]:

++