Commit cea7ca8b authored by Ronan's avatar Ronan
Browse files

fix(c-chat-room): delete correctly chat message

parent 52d7652e
......@@ -23,8 +23,9 @@
#include "linphone/api/c-chat-room.h"
#include "linphone/wrapper_utils.h"
#include "c-wrapper/c-wrapper.h"
#include "address/identity-address.h"
#include "c-wrapper/c-wrapper.h"
#include "chat/chat-message/chat-message-p.h"
#include "chat/chat-room/basic-chat-room.h"
#include "chat/chat-room/client-group-chat-room.h"
#include "chat/chat-room/real-time-text-chat-room-p.h"
......@@ -183,7 +184,11 @@ int linphone_chat_room_get_history_size (LinphoneChatRoom *cr) {
}
void linphone_chat_room_delete_message (LinphoneChatRoom *cr, LinphoneChatMessage *msg) {
L_GET_CPP_PTR_FROM_C_OBJECT(cr)->deleteMessage(L_GET_CPP_PTR_FROM_C_OBJECT(msg));
shared_ptr<LinphonePrivate::EventLog> event = LinphonePrivate::MainDb::getEventFromKey(
L_GET_PRIVATE_FROM_C_OBJECT(msg)->dbKey
);
if (event)
LinphonePrivate::EventLog::deleteFromDatabase(event);
}
void linphone_chat_room_delete_history (LinphoneChatRoom *cr) {
......
......@@ -383,10 +383,6 @@ void ChatRoom::deleteHistory () {
// TODO: history.
}
void ChatRoom::deleteMessage (const shared_ptr<ChatMessage> &msg) {
// TODO: history.
}
shared_ptr<ChatMessage> ChatRoom::findMessage (const string &messageId) {
L_D();
shared_ptr<ChatMessage> cm = nullptr;
......
......@@ -66,7 +66,6 @@ public:
std::shared_ptr<ChatMessage> createMessage (const std::string &msg);
std::shared_ptr<ChatMessage> createMessage ();
void deleteHistory ();
void deleteMessage (const std::shared_ptr<ChatMessage> &msg);
std::shared_ptr<ChatMessage> findMessage (const std::string &messageId);
std::shared_ptr<ChatMessage> findMessageWithDirection (const std::string &messageId, ChatMessage::Direction direction);
std::list<std::shared_ptr<ChatMessage>> getHistory (int nbMessages);
......
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