When creating a message with no text, create an empty Content so we can use it to store an appData

This commit is contained in:
Sylvain Berfini 2018-03-15 15:57:59 +01:00
parent f58ba4083e
commit 032f6cd91a

View file

@ -113,12 +113,7 @@ const LinphoneAddress *linphone_chat_room_get_local_address (LinphoneChatRoom *c
}
LinphoneChatMessage *linphone_chat_room_create_message (LinphoneChatRoom *cr, const char *message) {
shared_ptr<LinphonePrivate::ChatMessage> cppPtr;
if (message && strlen(message) > 0) {
cppPtr = L_GET_CPP_PTR_FROM_C_OBJECT(cr)->createChatMessage(L_C_TO_STRING(message));
} else {
cppPtr = L_GET_CPP_PTR_FROM_C_OBJECT(cr)->createChatMessage();
}
shared_ptr<LinphonePrivate::ChatMessage> cppPtr = L_GET_CPP_PTR_FROM_C_OBJECT(cr)->createChatMessage(L_C_TO_STRING(message));
LinphoneChatMessage *object = L_INIT(ChatMessage);
L_SET_CPP_PTR_FROM_C_OBJECT(object, cppPtr);
return object;