aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-accounts-dialog.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/empathy-accounts-dialog.c')
-rw-r--r--src/empathy-accounts-dialog.c20
1 files changed, 20 insertions, 0 deletions
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);