mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-18 11:38:08 +00:00
feat(EventsDb): supports message file info
This commit is contained in:
parent
3d283b2953
commit
77b35ea4fc
2 changed files with 22 additions and 2 deletions
|
|
@ -184,13 +184,18 @@ EventsDb::EventsDb () : AbstractDb(*new EventsDbPrivate) {}
|
|||
*session <<
|
||||
"CREATE TABLE IF NOT EXISTS message_event ("
|
||||
" id" + primaryKeyAutoIncrementStr() + ","
|
||||
" event_id INT UNSIGNED NOT NULL,"
|
||||
" dialog_id INT UNSIGNED NOT NULL,"
|
||||
" state_id TINYINT UNSIGNED NOT NULL,"
|
||||
" direction_id TINYINT UNSIGNED NOT NULL,"
|
||||
" imdn_message_id VARCHAR(255) NOT NULL," // See: https://tools.ietf.org/html/rfc5438#section-6.3
|
||||
" content_type VARCHAR(255) NOT NULL," // Content type of text. (Html or text for example.)
|
||||
" is_secured BOOLEAN NOT NULL,"
|
||||
" content_type VARCHAR(255) NOT NULL," // Content type of text. (Html or text for example.)
|
||||
" text TEXT,"
|
||||
" app_data VARCHAR(2048)," // App user data.
|
||||
" FOREIGN KEY (event_id)"
|
||||
" REFERENCES event(id)"
|
||||
" ON DELETE CASCADE,"
|
||||
" FOREIGN KEY (dialog_id)"
|
||||
" REFERENCES dialog(id)"
|
||||
" ON DELETE CASCADE,"
|
||||
|
|
@ -202,6 +207,21 @@ EventsDb::EventsDb () : AbstractDb(*new EventsDbPrivate) {}
|
|||
" ON DELETE CASCADE"
|
||||
")";
|
||||
|
||||
*session <<
|
||||
"CREATE TABLE IF NOT EXISTS message_file_info ("
|
||||
" id" + primaryKeyAutoIncrementStr() + ","
|
||||
" message_id INT UNSIGNED NOT NULL,"
|
||||
" content_type VARCHAR(255) NOT NULL," // File content type.
|
||||
" name VARCHAR(255) NOT NULL," // File name.
|
||||
" size INT UNSIGNED NOT NULL," // File size.
|
||||
" url VARCHAR(255) NOT NULL," // File url.
|
||||
" key VARCHAR(4096),"
|
||||
" key_size INT UNSIGNED,"
|
||||
" FOREIGN KEY (message_id)"
|
||||
" REFERENCES message(id)"
|
||||
" ON DELETE CASCADE"
|
||||
")";
|
||||
|
||||
{
|
||||
string query = getBackend() == Mysql
|
||||
? "INSERT INTO event_type (id, value)"
|
||||
|
|
@ -252,7 +272,7 @@ EventsDb::EventsDb () : AbstractDb(*new EventsDbPrivate) {}
|
|||
bool EventsDb::addEvent (const EventLog &eventLog) {
|
||||
if (!isConnected()) {
|
||||
lWarning() << "Unable to add event. Not connected.";
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO.
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Add table
Reference in a new issue