Commit bea54120 authored by Benjamin REIS's avatar Benjamin REIS Committed by Benjamin REIS

do not convert notify body

parent 6f400dd4
Pipeline #492 canceled with stage
in 0 seconds
......@@ -193,7 +193,7 @@ string LocalConferenceEventHandlerPrivate::createNotifyMultipart (int notifyId)
list<Content *> contentPtrs;
for (auto &content : contents)
contentPtrs.push_back(&content);
string multipart = ContentManager::contentListToMultipart(contentPtrs).getBodyAsString();
string multipart = ContentManager::contentListToMultipart(contentPtrs).getBodyAsUtf8String();
return multipart;
}
......@@ -373,7 +373,7 @@ void LocalConferenceEventHandlerPrivate::notifyParticipantDevice (const string &
linphone_event_cbs_set_notify_response(cbs, notifyResponseCb);
Content content;
content.setBody(notify);
content.setBodyFromUtf8(notify);
ContentType contentType;
if (multipart) {
contentType = ContentType(ContentType::Multipart);
......
......@@ -158,7 +158,7 @@ void LocalConferenceListEventHandler::subscribeReceived (LinphoneEvent *lev, con
} else
content->setContentType(ContentType::ConferenceInfo);
content->setBody(notifyBody);
content->setBodyFromUtf8(notifyBody);
char token[17];
belle_sip_random_token(token, sizeof(token));
content->addHeader("Content-Id", token);
......@@ -183,7 +183,7 @@ void LocalConferenceListEventHandler::subscribeReceived (LinphoneEvent *lev, con
Xsd::XmlSchema::NamespaceInfomap map;
stringstream rlmiBody;
Xsd::Rlmi::serializeList(rlmiBody, list, map);
rlmiContent->setBody(rlmiBody.str());
rlmiContent->setBodyFromUtf8(rlmiBody.str());
contents.push_front(rlmiContent);
Content multipart = ContentManager::contentListToMultipart(contents, MultipartBoundaryListEventHandler);
......
......@@ -296,13 +296,13 @@ void RemoteConferenceEventHandler::multipartNotifyReceived (const string &xmlBod
lInfo() << "multipart NOTIFY received for conference: " << d->conferenceId;
Content multipart;
multipart.setBody(xmlBody);
multipart.setBodyFromUtf8(xmlBody);
ContentType contentType(ContentType::Multipart);
contentType.addParameter("boundary", MultipartBoundary);
multipart.setContentType(contentType);
for (const auto &content : ContentManager::multipartToContentList(multipart))
d->simpleNotifyReceived(content.getBodyAsString());
d->simpleNotifyReceived(content.getBodyAsUtf8String());
}
// -----------------------------------------------------------------------------
......
......@@ -137,7 +137,7 @@ void RemoteConferenceListEventHandler::notifyReceived (const Content *notifyCont
if (notifyContent->getContentType().weakEqual(ContentType::ConferenceInfo)) {
// Simple notify received directly from a chat-room
const string &xmlBody = notifyContent->getBodyAsString();
const string &xmlBody = notifyContent->getBodyAsUtf8String();
istringstream data(xmlBody);
unique_ptr<Xsd::ConferenceInfo::ConferenceType> confInfo = Xsd::ConferenceInfo::parseConferenceInfo(data, Xsd::XmlSchema::Flags::dont_validate);
......@@ -153,7 +153,7 @@ void RemoteConferenceListEventHandler::notifyReceived (const Content *notifyCont
bctbx_free(from);
map<string, IdentityAddress> addresses;
for (const auto &content : contents) {
const string &body = content.getBodyAsString();
const string &body = content.getBodyAsUtf8String();
const ContentType &contentType = content.getContentType();
if (contentType == ContentType::Rlmi) {
addresses = parseRlmi(body);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment