From 198ea9fbac4c07869e45dd02678231eae25deb08 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Mon, 19 Mar 2018 13:47:48 +0100 Subject: [PATCH] add header to discriminate chat room list subscription --- coreapi/linphonecore.c | 2 +- .../handlers/remote-conference-list-event-handler.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 81ff23cd8..336b2a19d 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2163,7 +2163,7 @@ static void linphone_core_internal_notify_received(LinphoneCore *lc, LinphoneEve } static void _linphone_core_conference_subscribe_received(LinphoneCore *lc, LinphoneEvent *lev, const LinphoneContent *body) { - if (body) { + if (body && strcasecmp(linphone_content_get_custom_header(body, "Content-Disposition"), "recipient-list") == 0) { // List subscription L_GET_PRIVATE_FROM_C_OBJECT(lc)->localListEventHandler->subscribeReceived(lev, body); return; diff --git a/src/conference/handlers/remote-conference-list-event-handler.cpp b/src/conference/handlers/remote-conference-list-event-handler.cpp index 3c503bb3a..864e6f961 100644 --- a/src/conference/handlers/remote-conference-list-event-handler.cpp +++ b/src/conference/handlers/remote-conference-list-event-handler.cpp @@ -96,6 +96,15 @@ void RemoteConferenceListEventHandler::subscribe () { bctbx_free(from); linphone_address_unref(rlsAddr); linphone_event_set_internal(lev, TRUE); + linphone_event_add_custom_header(lev, "Require", "recipient-list-subscribe"); + linphone_event_add_custom_header(lev, "Accept", "multipart/related, application/conference-info+xml, application/rlmi+xml"); + linphone_event_add_custom_header(lev, "Content-Disposition", "recipient-list"); + /* TODO: enable compression + if (linphone_core_content_encoding_supported(lc, "deflate")) { + content.setContentEncoding("deflate"); + linphone_event_add_custom_header(lev, "Accept-Encoding", "deflate"); + } + */ linphone_event_set_user_data(lev, this); linphone_event_send_subscribe(lev, content.toLinphoneContent()); }