mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
fix how to send multiârt notify
This commit is contained in:
parent
d2fd296e8c
commit
91196256ce
3 changed files with 23 additions and 8 deletions
|
|
@ -51,6 +51,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
#include "chat/chat-room/client-group-chat-room-p.h"
|
||||
#include "chat/chat-room/server-group-chat-room-p.h"
|
||||
#include "conference/handlers/remote-conference-event-handler.h"
|
||||
#include "content/content-manager.h"
|
||||
#include "content/content-type.h"
|
||||
#include "core/core-p.h"
|
||||
|
||||
// For migration purpose.
|
||||
|
|
@ -2138,11 +2140,17 @@ static void linphone_core_internal_notify_received(LinphoneCore *lc, LinphoneEve
|
|||
));
|
||||
|
||||
if (chatRoom) {
|
||||
if (linphone_content_is_multipart(body))
|
||||
L_GET_PRIVATE(static_pointer_cast<ClientGroupChatRoom>(chatRoom))->multipartNotifyReceived(
|
||||
linphone_content_get_string_buffer(body)
|
||||
);
|
||||
else
|
||||
if (linphone_content_is_multipart(body)) {
|
||||
// TODO : migrate to c++ 'Content'.
|
||||
int i = 0;
|
||||
LinphoneContent *part = NULL;
|
||||
while ((part = linphone_content_get_part(body, i))) {
|
||||
i++;
|
||||
L_GET_PRIVATE(static_pointer_cast<ClientGroupChatRoom>(chatRoom))->notifyReceived(
|
||||
linphone_content_get_string_buffer(part)
|
||||
);
|
||||
}
|
||||
} else
|
||||
L_GET_PRIVATE(static_pointer_cast<ClientGroupChatRoom>(chatRoom))->notifyReceived(
|
||||
linphone_content_get_string_buffer(body)
|
||||
);
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ private:
|
|||
std::string createNotify (Xsd::ConferenceInfo::ConferenceType confInfo, int notifyId = -1, bool isFullState = false);
|
||||
std::string createNotifySubjectChanged (const std::string &subject, int notifyId = -1);
|
||||
void notifyParticipant (const std::string ¬ify, const std::shared_ptr<Participant> &participant);
|
||||
void notifyParticipantDevice (const std::string ¬ify, const std::shared_ptr<ParticipantDevice> &device);
|
||||
void notifyParticipantDevice (const std::string ¬ify, const std::shared_ptr<ParticipantDevice> &device, bool multipart = false);
|
||||
|
||||
L_DECLARE_PUBLIC(LocalConferenceEventHandler);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -67,11 +67,18 @@ void LocalConferenceEventHandlerPrivate::notifyParticipant (const string ¬ify
|
|||
notifyParticipantDevice(notify, device);
|
||||
}
|
||||
|
||||
void LocalConferenceEventHandlerPrivate::notifyParticipantDevice (const string ¬ify, const shared_ptr<ParticipantDevice> &device) {
|
||||
void LocalConferenceEventHandlerPrivate::notifyParticipantDevice (const string ¬ify, const shared_ptr<ParticipantDevice> &device, bool multipart) {
|
||||
if (device->isSubscribedToConferenceEventPackage() && !notify.empty()) {
|
||||
LinphoneEvent *ev = device->getConferenceSubscribeEvent();
|
||||
LinphoneContent *content = linphone_core_create_content(ev->lc);
|
||||
linphone_content_set_buffer(content, (const uint8_t *)notify.c_str(), strlen(notify.c_str()));
|
||||
if (multipart) {
|
||||
linphone_content_set_type(content, "multipart");
|
||||
linphone_content_set_subtype(content, "mixed;boundary=---------------------------14737809831466499882746641449");
|
||||
} else {
|
||||
linphone_content_set_type(content, "application");
|
||||
linphone_content_set_subtype(content, "conference-info");
|
||||
}
|
||||
linphone_event_notify(ev, content);
|
||||
linphone_content_unref(content);
|
||||
}
|
||||
|
|
@ -394,7 +401,7 @@ void LocalConferenceEventHandler::subscribeReceived (LinphoneEvent *lev) {
|
|||
lInfo() << "Sending all missed notify [" << lastNotify << "-" << d->lastNotify <<
|
||||
"] for conference:" << d->conf->getConferenceAddress().asString() <<
|
||||
" to: " << participant->getAddress().asString();
|
||||
d->notifyParticipantDevice(d->createNotifyMultipart(static_cast<int>(lastNotify)), device);
|
||||
d->notifyParticipantDevice(d->createNotifyMultipart(static_cast<int>(lastNotify)), device, true);
|
||||
} else if (lastNotify > d->lastNotify) {
|
||||
lError() << "last notify received by client: [" << lastNotify <<"] for conference:" <<
|
||||
d->conf->getConferenceAddress().asString() <<
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue