diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2012-01-30 21:21:47 +0800 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2012-01-30 21:28:01 +0800 |
commit | 0481b358c7a6c4336690961bb284df1370c0b29c (patch) | |
tree | cceceebd856ef2a23aecb953f0fb4adff0f848e1 | |
parent | e59f04dbfc934003a702d3b3d1b9c24984298007 (diff) | |
download | gsoc2013-empathy-0481b358c7a6c4336690961bb284df1370c0b29c.tar gsoc2013-empathy-0481b358c7a6c4336690961bb284df1370c0b29c.tar.gz gsoc2013-empathy-0481b358c7a6c4336690961bb284df1370c0b29c.tar.bz2 gsoc2013-empathy-0481b358c7a6c4336690961bb284df1370c0b29c.tar.lz gsoc2013-empathy-0481b358c7a6c4336690961bb284df1370c0b29c.tar.xz gsoc2013-empathy-0481b358c7a6c4336690961bb284df1370c0b29c.tar.zst gsoc2013-empathy-0481b358c7a6c4336690961bb284df1370c0b29c.zip |
Don't warn before leaving disconnected chatrooms
https://bugzilla.gnome.org/show_bug.cgi?id=591756
-rw-r--r-- | src/empathy-chat-window.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index 337bae942..634968593 100644 --- a/src/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -342,13 +342,25 @@ confirm_close (EmpathyChatWindow *window, gtk_window_present (GTK_WINDOW (dialog)); } +/* Returns TRUE if we should check if the user really wants to leave. If it's + * a multi-user chat, and it has a TpChat (so there's an underlying channel, so + * the user is actually in the room as opposed to having been kicked or gone + * offline or something), then we should check. + */ +static gboolean +chat_needs_close_confirmation (EmpathyChat *chat) +{ + return (empathy_chat_is_room (chat) + && empathy_chat_get_tp_chat (chat) != NULL); +} + static void maybe_close_chat (EmpathyChatWindow *window, EmpathyChat *chat) { g_return_if_fail (chat != NULL); - if (empathy_chat_is_room (chat)) { + if (chat_needs_close_confirmation (chat)) { confirm_close (window, FALSE, 1, chat); } else { empathy_chat_window_remove_chat (window, chat); @@ -1421,7 +1433,7 @@ chat_window_delete_event_cb (GtkWidget *dialog, DEBUG ("Delete event received"); for (l = priv->chats; l != NULL; l = l->next) { - if (empathy_chat_is_room (l->data)) { + if (chat_needs_close_confirmation (l->data)) { chat = l->data; n_rooms++; } |