GNOME Bugzilla – Bug 631236
Adding # on mistyping of channel names
Last modified: 2012-01-09 23:27:24 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.
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.
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...
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.
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.
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.
Should I also disable join button until the user enters name of room?
Review of attachment 204742 [details] [review]: Looks good, I'll do some cosmetic tweaks and push the patch. thanks!
(In reply to comment #6) > Should I also disable join button until the user enters name of room? I think so :)
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
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
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'
Created attachment 204912 [details] [review] Disable join button Disables join button if protocol is irc and the first character in the textbox is "#" or "&"
Review of attachment 204912 [details] [review]: ++