From ca5fc936fb56cb00ebb436872697585d46d2c0df Mon Sep 17 00:00:00 2001 From: Felix Kaser Date: Thu, 10 Dec 2009 00:28:34 +0100 Subject: update infobar only on selected account previously the infobar contained wrong statuses sometimes, if the auto reconnect on a faulty account triggered the update --- src/empathy-accounts-dialog.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c index 97ec23b20..1040d7018 100644 --- a/src/empathy-accounts-dialog.c +++ b/src/empathy-accounts-dialog.c @@ -184,6 +184,26 @@ accounts_dialog_update_status_infobar (EmpathyAccountsDialog *dialog, guint reason; guint presence; EmpathyConnectivity *connectivity; + GtkTreeView *view; + GtkTreeModel *model; + GtkTreeSelection *selection; + GtkTreeIter iter; + TpAccount *selected_account; + + view = GTK_TREE_VIEW (priv->treeview); + selection = gtk_tree_view_get_selection (view); + + if (!gtk_tree_selection_get_selected (selection, &model, &iter)) + return; + + gtk_tree_model_get (model, &iter, + COL_ACCOUNT_POINTER, &selected_account, -1); + + /* do not update the infobar when the account is not selected */ + if (account != selected_account) + { + return; + } status = tp_account_get_connection_status (account, &reason); presence = tp_account_get_current_presence (account, NULL, &status_message); -- cgit v1.2.3