Fixed issue in local-conference-event-handler related to Contents

This commit is contained in:
Sylvain Berfini 2018-04-05 12:26:23 +02:00
parent 797d7e3f64
commit 601a3aad5a

View file

@ -109,8 +109,8 @@ string LocalConferenceEventHandlerPrivate::createNotifyMultipart (int notifyId)
list<Content *> contents;
for (const auto &eventLog : events) {
Content content;
content.setContentType(ContentType("application","conference-info"));
Content *content = new Content();
content->setContentType(ContentType("application","conference-info"));
string body;
shared_ptr<ConferenceNotifiedEvent> notifiedEvent = static_pointer_cast<ConferenceNotifiedEvent>(eventLog);
int eventNotifyId = static_cast<int>(notifiedEvent->getNotifyId());
@ -180,13 +180,15 @@ string LocalConferenceEventHandlerPrivate::createNotifyMultipart (int notifyId)
L_ASSERT(false);
continue;
}
content.setBody(body);
contents.push_back(&content);
content->setBody(body);
contents.push_back(content);
}
if (contents.empty())
return "";
return ContentManager::contentListToMultipart(contents).getBodyAsString();
string multipart = ContentManager::contentListToMultipart(contents).getBodyAsString();
contents.clear();
return multipart;
}
string LocalConferenceEventHandlerPrivate::createNotifyParticipantAdded (const Address &addr, int notifyId) {