diff options
author | Chandni Verma <chandniverma2112@gmail.com> | 2013-08-03 23:13:01 +0800 |
---|---|---|
committer | Chandni Verma <chandniverma2112@gmail.com> | 2013-08-03 23:13:49 +0800 |
commit | 63e3a649a5a00aa0f36434f42aae8f68bc3a2394 (patch) | |
tree | 2945031e7636384c7a8fbd59a15a08c05efa56e4 | |
parent | b9065d414976bf126494fb1c0cfcc055c55856e0 (diff) | |
download | gsoc2013-empathy-63e3a649a5a00aa0f36434f42aae8f68bc3a2394.tar gsoc2013-empathy-63e3a649a5a00aa0f36434f42aae8f68bc3a2394.tar.gz gsoc2013-empathy-63e3a649a5a00aa0f36434f42aae8f68bc3a2394.tar.bz2 gsoc2013-empathy-63e3a649a5a00aa0f36434f42aae8f68bc3a2394.tar.lz gsoc2013-empathy-63e3a649a5a00aa0f36434f42aae8f68bc3a2394.tar.xz gsoc2013-empathy-63e3a649a5a00aa0f36434f42aae8f68bc3a2394.tar.zst gsoc2013-empathy-63e3a649a5a00aa0f36434f42aae8f68bc3a2394.zip |
Fix assertion failure on opening conversation menu in 1-1 chats
-rw-r--r-- | src/empathy-chat-window.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index a906b24b8..b373b9c4e 100644 --- a/src/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -1144,18 +1144,27 @@ chat_window_conv_activate_cb (GtkAction *action, else { TpChannel *channel = NULL; + TpContact *self_contact = NULL; TpHandle self_handle = 0; channel = (TpChannel *) (empathy_chat_get_tp_chat ( self->priv->current_chat)); - self_handle = tp_contact_get_handle (tp_channel_group_get_self_contact ( - channel)); - /* There is sometimes a lag between the members-changed signal - emitted on tp-chat and invalidated signal being emitted on the channel. - Leave Chat menu-item should be sensitive only till our self-handle is - a part of channel-members */ - gtk_action_set_visible (self->priv->menu_conv_leave_chat, - self_handle != 0); + self_contact = tp_channel_group_get_self_contact (channel); + if (self_contact == NULL) + { + /* The channel may not be a group */ + gtk_action_set_visible (self->priv->menu_conv_leave_chat, FALSE); + } + else + { + self_handle = tp_contact_get_handle (self_contact); + /* There is sometimes a lag between the members-changed signal + emitted on tp-chat and invalidated signal being emitted on the channel. + Leave Chat menu-item should be sensitive only till our self-handle is + a part of channel-members */ + gtk_action_set_visible (self->priv->menu_conv_leave_chat, + self_handle != 0); + } /* Join Chat is insensitive for a connected chat */ gtk_action_set_visible (self->priv->menu_conv_join_chat, FALSE); |