aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-07-14 21:10:22 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-08-12 16:50:48 +0800
commitd21720ea54edc73128bcdcdcc4faee834d7c1c4f (patch)
tree611f19edeb6ff8f5eca9aef6afb3fff4d001da5c /libempathy-gtk
parent12bbcaef96d24f781f1cc12757a09acc15b217ba (diff)
downloadgsoc2013-empathy-d21720ea54edc73128bcdcdcc4faee834d7c1c4f.tar
gsoc2013-empathy-d21720ea54edc73128bcdcdcc4faee834d7c1c4f.tar.gz
gsoc2013-empathy-d21720ea54edc73128bcdcdcc4faee834d7c1c4f.tar.bz2
gsoc2013-empathy-d21720ea54edc73128bcdcdcc4faee834d7c1c4f.tar.lz
gsoc2013-empathy-d21720ea54edc73128bcdcdcc4faee834d7c1c4f.tar.xz
gsoc2013-empathy-d21720ea54edc73128bcdcdcc4faee834d7c1c4f.tar.zst
gsoc2013-empathy-d21720ea54edc73128bcdcdcc4faee834d7c1c4f.zip
log_manager_got_chats_cb: don't rely on the selected account any more
Getting the chats is now an async operation, so the selected account could have changed while we were fetching the chats. So instead of using the currently selected account we use the account we receive from the hit. Note that this depends on this fix in the logger: https://bugs.freedesktop.org/show_bug.cgi?id=29058
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-log-window.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c
index 5dac0e10b..a7799a616 100644
--- a/libempathy-gtk/empathy-log-window.c
+++ b/libempathy-gtk/empathy-log-window.c
@@ -773,8 +773,6 @@ log_manager_got_chats_cb (GObject *manager,
EmpathyLogWindow *window = user_data;
GList *chats;
GList *l;
- EmpathyAccountChooser *account_chooser;
- TpAccount *account;
GtkTreeView *view;
GtkTreeModel *model;
GtkTreeSelection *selection;
@@ -792,9 +790,6 @@ log_manager_got_chats_cb (GObject *manager,
return;
}
- account_chooser = EMPATHY_ACCOUNT_CHOOSER (window->account_chooser_chats);
- account = empathy_account_chooser_dup_account (account_chooser);
-
view = GTK_TREE_VIEW (window->treeview_chats);
model = gtk_tree_view_get_model (view);
selection = gtk_tree_view_get_selection (view);
@@ -805,11 +800,14 @@ log_manager_got_chats_cb (GObject *manager,
hit = l->data;
+ if (hit->account == NULL)
+ continue;
+
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
COL_CHAT_ICON, "empathy-available", /* FIXME */
COL_CHAT_NAME, hit->chat_id,
- COL_CHAT_ACCOUNT, account,
+ COL_CHAT_ACCOUNT, hit->account,
COL_CHAT_ID, hit->chat_id,
COL_CHAT_IS_CHATROOM, hit->is_chatroom,
-1);
@@ -825,8 +823,6 @@ log_manager_got_chats_cb (GObject *manager,
g_signal_handlers_unblock_by_func (selection,
log_window_chats_changed_cb,
window);
-
- g_object_unref (account);
}
static void