[telepathy-sofiasip/master] Support the SIPS scheme in handle normalization

Mikhail Zabaluev mikhail.zabaluev at nokia.com
Wed Aug 26 09:45:32 PDT 2009


---
 src/sip-connection-helpers.c |   23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/src/sip-connection-helpers.c b/src/sip-connection-helpers.c
index 319a437..c95ad60 100644
--- a/src/sip-connection-helpers.c
+++ b/src/sip-connection-helpers.c
@@ -795,13 +795,32 @@ tpsip_handle_normalize (TpHandleRepoIface *repo,
               TPSIP_RESERVED_CHARS_ALLOWED_IN_USERNAME, FALSE);
         }
 
-      url = url_format (home, "sip:%s@%s",
-          user, base_url->url_host);
+      if (base_url->url_type == url_sips)
+        url = url_format (home, "sips:%s@%s",
+            user, base_url->url_host);
+      else
+        url = url_format (home, "sip:%s@%s",
+            user, base_url->url_host);
 
       g_free (user);
 
       if (!url) goto error;
     }
+  else if (url->url_scheme == NULL)
+    {
+      /* Set the scheme to SIP or SIPS accordingly to the connection's
+       * transport preference */
+      if (g_ascii_strcasecmp (priv->transport, "tls") == 0)
+        {
+          url->url_type = url_sips;
+          url->url_scheme = "sips";
+        }
+      else
+        {
+          url->url_type = url_sip;
+          url->url_scheme = "sip";
+        }
+    }
 
   if (url_sanitize (url) != 0) goto error;
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list