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 643755 - Create Join Chat and Leave chat menu items for the conversation menu in MUCs
Create Join Chat and Leave chat menu items for the conversation menu in MUCs
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: Multi User Chat
unspecified
Other Linux
: Normal normal
: ---
Assigned To: empathy-maint
Depends on: 643295
Blocks:
 
 
Reported: 2011-03-03 07:13 UTC by Chandni Verma
Modified: 2013-07-18 14:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
"Join Chat" and "Leave Chat" menu items for Conversation menu in MUCs (5.57 KB, patch)
2013-06-30 19:56 UTC, Chandni Verma
reviewed Details | Review
"Join Chat" and "Leave Chat" menu items for Conversation menu in MUCs (6.03 KB, patch)
2013-07-09 19:44 UTC, Chandni Verma
reviewed Details | Review
"Join Chat" and "Leave Chat" menu items for Conversation menu in MUCs (5.85 KB, patch)
2013-07-18 13:35 UTC, Chandni Verma
accepted-commit_now Details | Review

Description Chandni Verma 2011-03-03 07:13:51 UTC
This bug branches from 
https://bugzilla.gnome.org/show_bug.cgi?id=599184#c6 and
https://bugzilla.gnome.org/show_bug.cgi?id=599184#c9

These menu-items are needed to make MUCs independent of the open/closed status of the chatroom window. Join option can come handy to a kicked user to reconnect and Leave Chat will give the user ability to leave chat while having the window still open in front of him if he wants to (for some reference maybe).
Comment 2 Chandni Verma 2011-03-15 13:36:58 UTC
I have pushed a patch to my branch which destroys password info-bar on leaving a password protected chatroom to prevent multiple instances from getting displayed on re-joining without closing the chatroom window.
Comment 3 Chandni Verma 2011-05-04 16:22:08 UTC
Since the master is no more frozen, can we have this and the /part message implementation merged now?
Comment 4 Chandni Verma 2011-05-09 12:39:06 UTC
Branch updated to meet the changes in the underlying bug
Comment 5 Chandni Verma 2011-05-13 15:13:32 UTC
Rebased on top of merged moving-part-functionality-to-empathy-chat-window-643295 branch
Comment 6 Guillaume Desmottes 2011-05-18 16:53:17 UTC
+       if ((tp_chat = empathy_chat_get_tp_chat (priv->current_chat)))

once again, please split this.
Comment 7 Chandni Verma 2011-05-18 22:59:11 UTC
ah! done. sorry for missing that out.
Comment 8 Guillaume Desmottes 2011-05-19 07:45:37 UTC
I tried your branch, joined a XMPP muc, tried to leave it and it crashed:



(empathy-chat:5655): empathy-DEBUG: empathy_tp_chat_leave: Leaving channel test@conference.jabber.belnet.be with message ""
(empathy-chat:5655): tp-glib/proxy-DEBUG: tp_proxy_poll_features: 0x7e3150: request 0x13a9520 prepared
(empathy-chat:5655): tp-glib/proxy-DEBUG: tp_proxy_prepare_request_finish: 0x13a9520
(empathy-chat:5655): empathy-DEBUG: chat_window_update_chat_tab_full: Updating chat tab, name=test, account=/org/freedesktop/Telepathy/Account/gabble/jabber/cassidy_2dtest1_40jabber_2ebelnet_2ebe0, subject=(null), remote_contact=(nil)
(empathy-chat:5655): tp-glib/groups-DEBUG: tp_channel_group_members_changed_cb: 0x7e3150 MembersChanged: added 0, removed 1, moved 0 to LP and 0 to RP, actor 9, reason 0, message 
(empathy-chat:5655): tp-glib/groups-DEBUG: handle_members_changed: --- contact#9

Program received signal SIGSEGV, Segmentation fault.
0x000000000045db2c in escape_and_append_len (string=0x13aa360, str=0x0, len=-1) at empathy-theme-adium.c:286
286		while (*str != '\0' && len != 0) {
(gdb) 
(gdb) 
(gdb) 
(gdb) 
(gdb) 
(gdb) 
(gdb) bt
  • #0 escape_and_append_len
    at empathy-theme-adium.c line 286
  • #1 theme_adium_append_html
    at empathy-theme-adium.c line 477
  • #2 theme_adium_append_event_escaped
    at empathy-theme-adium.c line 497
  • #3 theme_adium_append_event
    at empathy-theme-adium.c line 788
  • #4 empathy_chat_view_append_event
    at empathy-chat-view.c line 81
  • #5 chat_members_changed_cb
    at empathy-chat.c line 2341
  • #6 _empathy_marshal_VOID__OBJECT_OBJECT_UINT_STRING_BOOLEAN
    at empathy-marshal.c line 167
  • #7 g_closure_invoke
    at gclosure.c line 771
  • #8 signal_emit_unlocked_R
    at gsignal.c line 3256
  • #9 g_signal_emit_valist
    at gsignal.c line 2987
  • #10 g_signal_emit_by_name
    at gsignal.c line 3081
  • #11 tp_chat_group_members_changed_cb
    at empathy-tp-chat.c line 1120
  • #12 _tp_marshal_VOID__STRING_BOXED_BOXED_BOXED_BOXED_UINT_UINT
    at _gen/signals-marshal.c line 1804
  • #13 g_closure_invoke
    at gclosure.c line 771
  • #14 signal_emit_unlocked_R
    at gsignal.c line 3256
  • #15 g_signal_emit_valist
    at gsignal.c line 2987
  • #16 g_signal_emit_by_name
    at gsignal.c line 3081
  • #17 handle_members_changed
    at channel-group.c line 1081
  • #18 tp_channel_group_members_changed_cb
    at channel-group.c line 1126
  • #19 _tp_cli_channel_interface_group_invoke_callback_for_members_changed
    at _gen/tp-cli-channel-body.h line 2919
  • #20 tp_proxy_signal_invocation_run
    at proxy-signals.c line 266
  • #21 g_idle_dispatch
    at gmain.c line 4854
  • #22 g_main_dispatch
    at gmain.c line 2477
  • #23 g_main_context_dispatch
    at gmain.c line 3050
  • #24 g_main_context_iterate
    at gmain.c line 3128
  • #25 g_main_loop_run
    at gmain.c line 3336
  • #26 gtk_main
    at gtkmain.c line 1358
  • #27 gtk_application_run_mainloop
    at gtkapplication.c line 85
  • #28 g_application_run
    at gapplication.c line 1326
  • #29 main
    at empathy-chat.c line 160

Comment 9 Chandni Verma 2011-05-20 05:20:06 UTC
ok, I didn't expect this. I'll need WebKit to check this.
Comment 10 Chandni Verma 2011-05-21 07:40:12 UTC
Its weird but I tried to produce this crash even with WebKit support but couldn't. Can't see this with branch rebased on master too. I tried it with conference.jabber.org and conference.collabora.co.uk (can't connect to conference.jabber.belnet.be with my gmail account which might be another bug?) Can you please re-check this.

Though I noticed another thing happening once in some ten attempts i.e. channel sometimes gets disconnected long after the user leaves the chatroom, it being an asynchronous call, to solve which I can either
1) Disable both Join and Leave chat menu options when chatroom is already left but not disconnected or
2) Completely disconnect the channel on clicking leave chat by calling tp_channel_close_async instead of tp_channel_leave_async.

whatever you say.
Comment 11 Guillaume Desmottes 2011-05-23 09:05:21 UTC
(In reply to comment #10)
> Its weird but I tried to produce this crash even with WebKit support but
> couldn't. Can't see this with branch rebased on master too. I tried it with
> conference.jabber.org and conference.collabora.co.uk (can't connect to
> conference.jabber.belnet.be with my gmail account which might be another bug?)
> Can you please re-check this.

Humm indeed it seems to work fine now. I guess your rebased fixed it.

> Though I noticed another thing happening once in some ten attempts i.e. channel
> sometimes gets disconnected long after the user leaves the chatroom, it being
> an asynchronous call, to solve which I can either
> 1) Disable both Join and Leave chat menu options when chatroom is already left
> but not disconnected or
> 2) Completely disconnect the channel on clicking leave chat by calling
> tp_channel_close_async instead of tp_channel_leave_async.

What do mean by "channel gets disconnected after user left"? What happen
exactly from a D-Bus pov?
Comment 12 Chandni Verma 2011-05-24 10:05:27 UTC
I meant to say that there is sometimes a lag between the members-changed signal emitted on tp-chat and invalidated signal being emitted on the channel and presently the "Leave Chat" menu option persists until tp-chat is actually destroyed(channel invalidated). What should be the best way to address this in your opinion?
Comment 13 Guillaume Desmottes 2011-05-25 08:24:00 UTC
Humm I think the "Leave Chat" menu should be insensitive as soon as we (our self handle) is removed from the channel members.
Comment 14 Chandni Verma 2011-05-25 09:43:54 UTC
So for that duration (until channel is invalidated and chat is destroyed) both Join chat and Leave chat will be insensitive as one should not even attempt to re-join the chat when a disconnection is on the way..
Comment 15 Guillaume Desmottes 2011-05-25 14:08:33 UTC
I wouldn't worry too much about that tbh. :)
Comment 17 Guillaume Desmottes 2011-05-30 11:40:18 UTC
Your patch doesn't build:


empathy-chat-window.c: In function ‘chat_window_conv_activate_cb’:
empathy-chat-window.c:912:4: error: implicit declaration of function ‘empathy_tp_chat_get_channel’
empathy-chat-window.c:913:5: error: passing argument 1 of ‘tp_channel_group_get_self_handle’ makes pointer from integer without a cast
/home/cassidy/usr/include/telepathy-1.0/telepathy-glib/channel.h:106:10: note: expected ‘struct TpChannel *’ but argument is of type ‘int’



+               gboolean member = (tp_channel_group_get_self_handle (
+                       empathy_tp_chat_get_channel (empathy_chat_get_tp_chat (
+                               priv->current_chat))) != 0);

is a bit scary tbh, best to split it a bit.
Comment 18 Guillaume Desmottes 2011-09-06 07:40:45 UTC
We are past UI freeze so that probably won't make it for 3.2.
Comment 19 Chandni Verma 2011-09-13 11:01:44 UTC
Was this actually needed anymore? I thought it would be useless with the new chat UI coming up for bug#599184 from which this bug was branched. Well I have completed it now if you are still interested in it.

https://gitorious.org/glassrose-gnome/empathy/commits/join-leave-chat-menuitems-643755
Comment 20 Guillaume Desmottes 2012-02-17 12:57:26 UTC
Yeah I'm not convinced either that's a so useful thing to add tbh.
Comment 21 Chandni Verma 2013-06-19 12:31:26 UTC
bug#599184 seems to be stuck for lifelong. I didn't foresee that. We should give this another go. Rebasing on gnome-3.8 branch.
Comment 22 Chandni Verma 2013-06-19 14:23:41 UTC
Updated branch. I am unable to get the menu-items for testing even after setting empathy srcdir using the command  EMPATHY_SRCDIR=./ ./src/empathy-chat 
Also they aren't showing up in the installed empathy-chat.
Comment 23 Chandni Verma 2013-06-30 19:56:52 UTC
Created attachment 248104 [details] [review]
"Join Chat" and "Leave Chat" menu items for Conversation menu in MUCs
Comment 24 Guillaume Desmottes 2013-07-09 08:26:52 UTC
Review of attachment 248104 [details] [review]:

::: src/empathy-chat-window.c
@@ +1141,3 @@
+      remote_contact == NULL);
+  gtk_action_set_visible (self->priv->menu_conv_leave_chat,
+      remote_contact == NULL);

these two set_visible calls are useless as we re-call it in the two branches of the if/else.

@@ +1142,3 @@
+  gtk_action_set_visible (self->priv->menu_conv_leave_chat,
+      remote_contact == NULL);
+

I'd add a comment explaining the logic when we hide/display these 2 menu items as it's not straightforward.

::: src/empathy-chat-window.ui
@@ +190,3 @@
           <menuitem action="menu_conv_invite_participant"/>
           <separator/>
+          <menuitem action="menu_conv_join_chat"/>

I'd move these to the top of the menu.
Comment 25 Chandni Verma 2013-07-09 12:49:56 UTC
Are you able to produce the menu-items when tested? I am not! Maybe because tp_channel_group_get_self_contact is returning me a null value for a non-null value of channel which is weird. I am looking into it.
Comment 26 Chandni Verma 2013-07-09 19:40:51 UTC
(In reply to comment #25)
> Are you able to produce the menu-items when tested? I am not!
Uh, that was when I was trying with one-to-one chats as expected so ignore this.
 
(In reply to comment #24)
> Review of attachment 248104 [details] [review]:
> 
> ::: src/empathy-chat-window.c
> @@ +1141,3 @@
> +      remote_contact == NULL);
> +  gtk_action_set_visible (self->priv->menu_conv_leave_chat,
> +      remote_contact == NULL);
> 
> these two set_visible calls are useless as we re-call it in the two branches of
> the if/else.

No, these deal with visibility of the menus while the ones in the conditional blocks deal with the sensitivity of the menus.

> 
> @@ +1142,3 @@
> +  gtk_action_set_visible (self->priv->menu_conv_leave_chat,
> +      remote_contact == NULL);
> +
> 
> I'd add a comment explaining the logic when we hide/display these 2 menu items
> as it's not straightforward.

Done

> 
> ::: src/empathy-chat-window.ui
> @@ +190,3 @@
>            <menuitem action="menu_conv_invite_participant"/>
>            <separator/>
> +          <menuitem action="menu_conv_join_chat"/>
> 
> I'd move these to the top of the menu.

Done.
Comment 27 Chandni Verma 2013-07-09 19:44:57 UTC
Created attachment 248774 [details] [review]
"Join Chat" and "Leave Chat" menu items for Conversation menu in MUCs
Comment 28 Chandni Verma 2013-07-17 15:12:01 UTC
Is this patch good to go?
Comment 29 Guillaume Desmottes 2013-07-18 12:39:22 UTC
Review of attachment 248774 [details] [review]:

::: src/empathy-chat-window.c
@@ +1142,3 @@
+      remote_contact == NULL);
+  gtk_action_set_visible (self->priv->menu_conv_leave_chat,
+      remote_contact == NULL);

I'd just display the sensitive one actually are they are mutually exclusive. There is no much point displaying the insensitive menu item in this context.

@@ +1297,3 @@
+
+    tp_chat = empathy_chat_get_tp_chat (self->priv->current_chat);
+

if (tp_chat != NULL)
Comment 30 Chandni Verma 2013-07-18 13:35:38 UTC
Created attachment 249506 [details] [review]
"Join Chat" and "Leave Chat" menu items for Conversation menu in MUCs
Comment 31 Guillaume Desmottes 2013-07-18 13:44:21 UTC
Review of attachment 249506 [details] [review]:

++

Thanks for the patch!
Comment 32 Guillaume Desmottes 2013-07-18 13:44:23 UTC
Review of attachment 249506 [details] [review]:

++

Thanks for the patch!