[empathy] account-settings: don't set the presence on newly created accounts
- From: Marco Barisione <mbari src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] account-settings: don't set the presence on newly created accounts
- Date: Tue, 20 Aug 2013 11:19:59 +0000 (UTC)
commit 740b695e21016ff7b568b069734b29e780b459e5
Author: Marco Barisione <marco barisione collabora co uk>
Date: Wed May 8 15:45:45 2013 +0100
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
tp-account-widgets/tpaw-account-settings.c | 16 ----------------
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 3d27a99..bb6e092 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]