Commit 52d7652e authored by Ronan's avatar Ronan

feat(EventLog): provide a way to delete event in public interface

parent 91a64a74
......@@ -61,6 +61,12 @@ LINPHONE_PUBLIC LinphoneEventLogType linphone_event_log_get_type (const Linphone
*/
LINPHONE_PUBLIC time_t linphone_event_log_get_creation_time (const LinphoneEventLog *event_log);
/**
* Delete event log from database.
* @param[in] event_log A #LinphoneEventLog object
*/
LINPHONE_PUBLIC void linphone_event_log_delete_from_database (LinphoneEventLog *event_log);
// -----------------------------------------------------------------------------
// ConferenceEvent.
// -----------------------------------------------------------------------------
......
......@@ -190,6 +190,10 @@ time_t linphone_event_log_get_creation_time (const LinphoneEventLog *event_log)
return L_GET_CPP_PTR_FROM_C_OBJECT(event_log)->getCreationTime();
}
void linphone_event_log_delete_from_database (LinphoneEventLog *event_log) {
LinphonePrivate::EventLog::deleteFromDatabase(L_GET_CPP_PTR_FROM_C_OBJECT(event_log));
}
// -----------------------------------------------------------------------------
// ConferenceEvent.
// -----------------------------------------------------------------------------
......
......@@ -17,10 +17,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "db/main-db.h"
#include "event-log-p.h"
// =============================================================================
using namespace std;
LINPHONE_BEGIN_NAMESPACE
EventLog::EventLog () : BaseObject(*new EventLogPrivate) {}
......@@ -41,4 +44,8 @@ time_t EventLog::getCreationTime () const {
return d->creationTime;
}
void EventLog::deleteFromDatabase (const shared_ptr<EventLog> &eventLog) {
MainDb::deleteEvent(eventLog);
}
LINPHONE_END_NAMESPACE
......@@ -21,6 +21,7 @@
#define _EVENT_LOG_H_
#include <ctime>
#include <memory>
#include "linphone/enums/event-log-enums.h"
#include "linphone/utils/enum-generator.h"
......@@ -45,6 +46,8 @@ public:
Type getType () const;
time_t getCreationTime () const;
static void deleteFromDatabase (const std::shared_ptr<EventLog> &eventLog);
protected:
EventLog (EventLogPrivate &p, Type type, time_t creationTime);
......
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