telepathy-gabble: X-TELEPATHY-PASSWORD is not supported if username isn' t known

Xavier Claessens xclaesse at kemper.freedesktop.org
Wed May 8 04:53:25 PDT 2013


Module: telepathy-gabble
Branch: master
Commit: 3157284e58195cab12a404752f7d96e3c4ea650b
URL:    http://cgit.freedesktop.org/telepathy/telepathy-gabble/commit/?id=3157284e58195cab12a404752f7d96e3c4ea650b

Author: Xavier Claessens <xavier.claessens at collabora.co.uk>
Date:   Wed May  8 13:07:34 2013 +0200

X-TELEPATHY-PASSWORD is not supported if username isn't known

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=64354

---

 src/auth-manager.c |   25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/auth-manager.c b/src/auth-manager.c
index 992645e..ad60d08 100644
--- a/src/auth-manager.c
+++ b/src/auth-manager.c
@@ -320,6 +320,17 @@ gabble_auth_manager_start_auth_async (WockyAuthRegistry *registry,
       GPtrArray *mech_array = g_ptr_array_new ();
       GSList *iter;
 
+      if (username == NULL)
+        {
+          g_object_get (self->priv->conn,
+              "username", &self->priv->username,
+              NULL);
+        }
+      else
+        {
+          self->priv->username = g_strdup (username);
+        }
+
       for (iter = mechanisms; iter != NULL; iter = iter->next)
         {
           self->priv->mechanisms = g_slist_prepend (self->priv->mechanisms,
@@ -330,7 +341,8 @@ gabble_auth_manager_start_auth_async (WockyAuthRegistry *registry,
             g_ptr_array_add (mech_array, iter->data);
         }
 
-      if (wocky_auth_registry_supports_one_of (registry, mechanisms,
+      if (self->priv->username != NULL &&
+          wocky_auth_registry_supports_one_of (registry, mechanisms,
               allow_plain))
         g_ptr_array_add (mech_array, X_TELEPATHY_PASSWORD);
 
@@ -344,17 +356,6 @@ gabble_auth_manager_start_auth_async (WockyAuthRegistry *registry,
       self->priv->server = g_strdup (server);
       self->priv->session_id = g_strdup (session_id);
 
-      if (username == NULL)
-        {
-          g_object_get (self->priv->conn,
-              "username", &self->priv->username,
-              NULL);
-        }
-      else
-        {
-          self->priv->username = g_strdup (username);
-        }
-
       self->priv->channel = gabble_server_sasl_channel_new (self->priv->conn,
           (GStrv) mech_array->pdata, is_secure_channel, session_id);
       g_ptr_array_unref (mech_array);



More information about the telepathy-commits mailing list