aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-accounts-dialog.c
diff options
context:
space:
mode:
authorFelix Kaser <f.kaser@gmx.net>2009-12-10 07:28:34 +0800
committerFelix Kaser <f.kaser@gmx.net>2009-12-15 20:52:45 +0800
commitca5fc936fb56cb00ebb436872697585d46d2c0df (patch)
treeee7cd74e4bdac51dcb96c4bd399ba345cf9e134c /src/empathy-accounts-dialog.c
parentb54fd8c9d094ff6fc162b1d30b118185207d9f04 (diff)
downloadgsoc2013-empathy-ca5fc936fb56cb00ebb436872697585d46d2c0df.tar
gsoc2013-empathy-ca5fc936fb56cb00ebb436872697585d46d2c0df.tar.gz
gsoc2013-empathy-ca5fc936fb56cb00ebb436872697585d46d2c0df.tar.bz2
gsoc2013-empathy-ca5fc936fb56cb00ebb436872697585d46d2c0df.tar.lz
gsoc2013-empathy-ca5fc936fb56cb00ebb436872697585d46d2c0df.tar.xz
gsoc2013-empathy-ca5fc936fb56cb00ebb436872697585d46d2c0df.tar.zst
gsoc2013-empathy-ca5fc936fb56cb00ebb436872697585d46d2c0df.zip
update infobar only on selected account
previously the infobar contained wrong statuses sometimes, if the auto reconnect on a faulty account triggered the update
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);