aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorDanielle Madeley <danielle.madeley@collabora.co.uk>2011-03-18 08:37:50 +0800
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-04-08 18:41:30 +0800
commitd9c04f6c68083c5c2193aece3bd182a5408c3b6d (patch)
treeb9a976d123fef41caad9ed0178561a59cee0dc50 /libempathy-gtk
parent563630a2afed64a18df0936a5da7aa178ef8e474 (diff)
downloadgsoc2013-empathy-d9c04f6c68083c5c2193aece3bd182a5408c3b6d.tar
gsoc2013-empathy-d9c04f6c68083c5c2193aece3bd182a5408c3b6d.tar.gz
gsoc2013-empathy-d9c04f6c68083c5c2193aece3bd182a5408c3b6d.tar.bz2
gsoc2013-empathy-d9c04f6c68083c5c2193aece3bd182a5408c3b6d.tar.lz
gsoc2013-empathy-d9c04f6c68083c5c2193aece3bd182a5408c3b6d.tar.xz
gsoc2013-empathy-d9c04f6c68083c5c2193aece3bd182a5408c3b6d.tar.zst
gsoc2013-empathy-d9c04f6c68083c5c2193aece3bd182a5408c3b6d.zip
Abstract out is_other_psyke_account()
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-account-widget-skype.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/libempathy-gtk/empathy-account-widget-skype.c b/libempathy-gtk/empathy-account-widget-skype.c
index 439c373cc..7c2da8727 100644
--- a/libempathy-gtk/empathy-account-widget-skype.c
+++ b/libempathy-gtk/empathy-account-widget-skype.c
@@ -958,6 +958,17 @@ empathy_account_widget_skype_show_eula (GtkWindow *parent)
return (result == GTK_RESPONSE_ACCEPT);
}
+static gboolean
+is_other_psyke_account (TpAccount *ours,
+ TpAccount *other)
+{
+ return (tp_strdiff (
+ tp_proxy_get_object_path (ours),
+ tp_proxy_get_object_path (other)) &&
+ tp_account_is_enabled (other) &&
+ !tp_strdiff (tp_account_get_connection_manager (other), "psyke"));
+}
+
gboolean
empathy_accounts_dialog_skype_disable_other_accounts (TpAccount *account,
GtkWindow *parent)
@@ -973,11 +984,7 @@ empathy_accounts_dialog_skype_disable_other_accounts (TpAccount *account,
{
TpAccount *a = ptr->data;
- if (tp_strdiff (
- tp_proxy_get_object_path (account),
- tp_proxy_get_object_path (a)) &&
- tp_account_is_enabled (a) &&
- !tp_strdiff (tp_account_get_connection_manager (a), "psyke"))
+ if (is_other_psyke_account (account, a))
{
other_psyke_accounts = TRUE;
break;
@@ -1014,11 +1021,7 @@ empathy_accounts_dialog_skype_disable_other_accounts (TpAccount *account,
{
TpAccount *a = ptr->data;
- if (tp_strdiff (
- tp_proxy_get_object_path (account),
- tp_proxy_get_object_path (a)) &&
- tp_account_is_enabled (a) &&
- !tp_strdiff (tp_account_get_connection_manager (a), "psyke"))
+ if (is_other_psyke_account (account, a))
{
tp_account_set_enabled_async (a, FALSE, NULL, NULL);
}