From 6df5b4d1fa463848e377ef65b7e09a6745a3415c Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Thu, 30 May 2013 20:29:13 +0300 Subject: [PATCH] subscriptions: fix OCS2005 single presence Commit 7ba6310cf0981e44ff00bcc69156e18b046667ec probably broke single presence subscription behaviour for OCS2005. Restore the old behaviour for OCS2005. --- src/core/sipe-subscriptions.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/core/sipe-subscriptions.c b/src/core/sipe-subscriptions.c index 19c2b884..efabf1b7 100644 --- a/src/core/sipe-subscriptions.c +++ b/src/core/sipe-subscriptions.c @@ -490,7 +490,9 @@ static void sipe_subscribe_presence_buddy(struct sipe_core_private *sipe_private } /** - * if to == NULL: initial single subscription -> send to self URI + * if to == NULL: initial single subscription + * OCS2005: send to URI + * OCS2007: send to self URI * * if to != NULL: * Single Category SUBSCRIBE [MS-PRES] ; To send when the server returns a 200 OK message with state="resubscribe" in response. @@ -502,7 +504,7 @@ void sipe_subscribe_presence_single(struct sipe_core_private *sipe_private, const gchar *uri, const gchar *to) { - gchar *self = sip_uri_self(sipe_private); + gchar *self = NULL; gchar *contact = get_contact(sipe_private); gchar *request; gchar *content = NULL; @@ -529,8 +531,12 @@ void sipe_subscribe_presence_single(struct sipe_core_private *sipe_private, sipe_private->username, uri, sbuddy && sbuddy->just_added ? ">" : "/>"); + if (!to) + to = self = sip_uri_self(sipe_private); } else { additional = "Supported: com.microsoft.autoextend\r\n"; + if (!to) + to = uri; } if (sbuddy) @@ -547,7 +553,7 @@ void sipe_subscribe_presence_single(struct sipe_core_private *sipe_private, contact); g_free(contact); - sipe_subscribe_presence_buddy(sipe_private, to ? to : self, request, content); + sipe_subscribe_presence_buddy(sipe_private, to, request, content); g_free(content); g_free(self); -- 2.11.4.GIT