aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Barisione <marco.barisione@collabora.co.uk>2013-05-08 22:45:45 +0800
committerMarco Barisione <marco.barisione@collabora.co.uk>2013-08-20 18:03:05 +0800
commit740b695e21016ff7b568b069734b29e780b459e5 (patch)
treee8d3ff545a2e4ef4622058fb4954d0399f3d9819
parent654aaea6780716ff7973530859d2b1b86e2f7ca3 (diff)
downloadgsoc2013-empathy-740b695e21016ff7b568b069734b29e780b459e5.tar
gsoc2013-empathy-740b695e21016ff7b568b069734b29e780b459e5.tar.gz
gsoc2013-empathy-740b695e21016ff7b568b069734b29e780b459e5.tar.bz2
gsoc2013-empathy-740b695e21016ff7b568b069734b29e780b459e5.tar.lz
gsoc2013-empathy-740b695e21016ff7b568b069734b29e780b459e5.tar.xz
gsoc2013-empathy-740b695e21016ff7b568b069734b29e780b459e5.tar.zst
gsoc2013-empathy-740b695e21016ff7b568b069734b29e780b459e5.zip
account-settings: don't set the presence on newly created accounts
What happened before this patch was: 1) tpaw_account_settings_do_create_account() sets the requested presence to the global requested presence in Empathy; 2) If the requested presence is unset, unknown or offline, empathy_connect_new_account() sets it to available; 3) Every process with a TpAccountManager object in memory that was previously used to set the requested presence will try to set the presence on the new account. The first step is a problem as it doesn't work if the account is created by a process that is not Empathy as the other processes have no way of knowing what Empathy's requested presence is. This doesn't matter as, in the third step, both Empathy and gnome-shell (and any other process using a TpAccountManager) will try to set the presence to their own idea of the current requested presence. Of course this is a race condition, see [1], but the behaviour is not changed by this patch. In case there is no process using a TpAccountManager, the second step will still guarantee that the newly created account goes online. [1] https://bugs.freedesktop.org/show_bug.cgi?id=24104 https://bugzilla.gnome.org/show_bug.cgi?id=699492
-rw-r--r--tp-account-widgets/tpaw-account-settings.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/tp-account-widgets/tpaw-account-settings.c b/tp-account-widgets/tpaw-account-settings.c
index 3d27a9951..bb6e092b4 100644
--- a/tp-account-widgets/tpaw-account-settings.c
+++ b/tp-account-widgets/tpaw-account-settings.c
@@ -23,7 +23,6 @@
#include "tpaw-connection-managers.h"
#include "tpaw-keyring.h"
-#include "empathy-presence-manager.h"
#include "empathy-utils.h"
#include "tpaw-utils.h"
@@ -1415,27 +1414,12 @@ tpaw_account_settings_do_create_account (TpawAccountSettings *self)
{
TpawAccountSettingsPriv *priv = GET_PRIV (self);
TpAccountRequest *account_req;
- TpConnectionPresenceType type;
- gchar *status;
- gchar *message;
- EmpathyPresenceManager *presence_mgr;
GHashTableIter iter;
gpointer k, v;
account_req = tp_account_request_new (priv->account_manager, priv->cm_name,
priv->protocol, "New Account");
- presence_mgr = empathy_presence_manager_dup_singleton ();
- type = empathy_presence_manager_get_requested_presence (presence_mgr, &status,
- &message);
- g_object_unref (presence_mgr);
-
- if (type != TP_CONNECTION_PRESENCE_TYPE_UNSET)
- {
- tp_account_request_set_requested_presence (account_req, type,
- status, message);
- }
-
tp_account_request_set_icon_name (account_req, priv->icon_name);
tp_account_request_set_display_name (account_req, priv->display_name);