From 66c385611737fe9e606f80b7949985fd4962a302 Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Mon, 3 Jun 2013 23:11:22 +0300 Subject: [PATCH] subscriptions: fix handling of "resubscribe" notify I noticed that one of my buddy list entries triggered a "resubscribe" notification. The single subscription to that buddy triggered another "resubscribe" notificiation, causing an endless ping-pong. After comparing the messages from the debug log with the examples from [MS-PRES] it turned out that the re-subscription message should not have these headers: Require: adhoclist, categoryList Supported: eventlist --- src/core/sipe-subscriptions.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core/sipe-subscriptions.c b/src/core/sipe-subscriptions.c index efabf1b7..5bbcc0dc 100644 --- a/src/core/sipe-subscriptions.c +++ b/src/core/sipe-subscriptions.c @@ -508,13 +508,11 @@ void sipe_subscribe_presence_single(struct sipe_core_private *sipe_private, gchar *contact = get_contact(sipe_private); gchar *request; gchar *content = NULL; - const gchar *additional; + const gchar *additional = ""; const gchar *content_type = ""; struct sipe_buddy *sbuddy = g_hash_table_lookup(sipe_private->buddies, uri); if (SIPE_CORE_PRIVATE_FLAG_IS(OCS2007)) { - additional = "Require: adhoclist, categoryList\r\n" \ - "Supported: eventlist\r\n"; content_type = "Content-Type: application/msrtc-adrl-categorylist+xml\r\n"; content = g_strdup_printf("\n" "\n" @@ -531,8 +529,12 @@ void sipe_subscribe_presence_single(struct sipe_core_private *sipe_private, sipe_private->username, uri, sbuddy && sbuddy->just_added ? ">" : "/>"); - if (!to) + if (!to) { + additional = "Require: adhoclist, categoryList\r\n" \ + "Supported: eventlist\r\n"; to = self = sip_uri_self(sipe_private); + } + } else { additional = "Supported: com.microsoft.autoextend\r\n"; if (!to) -- 2.11.4.GIT