aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-account-widget.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-03-02 17:25:46 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-03-02 23:37:32 +0800
commitb7329ee88d54447ed5b8a0de32a6b26a25ef5024 (patch)
tree253ba191b96681b0e6aeeb83883fbe3e44c92c54 /libempathy-gtk/empathy-account-widget.c
parent2af6c1375e1465566d57170d8090e1b425de88fa (diff)
downloadgsoc2013-empathy-b7329ee88d54447ed5b8a0de32a6b26a25ef5024.tar
gsoc2013-empathy-b7329ee88d54447ed5b8a0de32a6b26a25ef5024.tar.gz
gsoc2013-empathy-b7329ee88d54447ed5b8a0de32a6b26a25ef5024.tar.bz2
gsoc2013-empathy-b7329ee88d54447ed5b8a0de32a6b26a25ef5024.tar.lz
gsoc2013-empathy-b7329ee88d54447ed5b8a0de32a6b26a25ef5024.tar.xz
gsoc2013-empathy-b7329ee88d54447ed5b8a0de32a6b26a25ef5024.tar.zst
gsoc2013-empathy-b7329ee88d54447ed5b8a0de32a6b26a25ef5024.zip
factor out empathy_connect_new_account
Diffstat (limited to 'libempathy-gtk/empathy-account-widget.c')
-rw-r--r--libempathy-gtk/empathy-account-widget.c28
1 files changed, 1 insertions, 27 deletions
diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c
index a7b272c58..8ce6b5f52 100644
--- a/libempathy-gtk/empathy-account-widget.c
+++ b/libempathy-gtk/empathy-account-widget.c
@@ -668,9 +668,6 @@ account_widget_account_enabled_cb (GObject *source_object,
TpAccount *account = TP_ACCOUNT (source_object);
EmpathyAccountWidget *widget = EMPATHY_ACCOUNT_WIDGET (user_data);
EmpathyAccountWidgetPriv *priv = GET_PRIV (widget);
- TpConnectionPresenceType presence;
- gchar *message = NULL;
- gchar *status = NULL;
tp_account_set_enabled_finish (account, res, &error);
@@ -681,34 +678,11 @@ account_widget_account_enabled_cb (GObject *source_object,
}
else
{
- /* only force presence if presence was offline, unknown or unset */
- presence = tp_account_get_requested_presence (account, NULL, NULL);
- switch (presence)
- {
- case TP_CONNECTION_PRESENCE_TYPE_OFFLINE:
- case TP_CONNECTION_PRESENCE_TYPE_UNKNOWN:
- case TP_CONNECTION_PRESENCE_TYPE_UNSET:
- presence = tp_account_manager_get_most_available_presence (
- priv->account_manager, &status, &message);
-
- if (presence == TP_CONNECTION_PRESENCE_TYPE_OFFLINE)
- /* Global presence is offline; we force it so user doesn't have to
- * manually change the presence to connect his new account. */
- presence = TP_CONNECTION_PRESENCE_TYPE_AVAILABLE;
-
- tp_account_request_presence_async (account, presence,
- status, NULL, NULL, NULL);
- break;
- default:
- /* do nothing if the presence is not offline */
- break;
- }
+ empathy_connect_new_account (account, priv->account_manager);
}
/* unref widget - part of the workaround */
g_object_unref (widget);
- g_free (message);
- g_free (status);
}
static void