feat(EventsDb): add new table => message_participant

This commit is contained in:
Ronan Abhamon 2017-10-09 11:04:59 +02:00
parent f8abe9ad07
commit e5c3a5a96a
3 changed files with 21 additions and 5 deletions

View file

@ -127,7 +127,7 @@ constexpr T *getPublicHelper (Object *object, const ObjectPrivate *) {
friend class CLASS;
#define L_DISABLE_COPY(CLASS) \
CLASS(const CLASS &) = delete; \
CLASS (const CLASS &) = delete; \
CLASS &operator= (const CLASS &) = delete;
#define L_D() decltype(std::declval<decltype(*this)>().getPrivate()) const d = getPrivate();

View file

@ -30,7 +30,7 @@ class ContentTypePrivate;
class LINPHONE_PUBLIC ContentType : public ClonableObject {
public:
ContentType (const std::string &contentType = "");
explicit ContentType (const std::string &contentType = "");
ContentType (const std::string &type, const std::string &subType);
ContentType (const std::string &type, const std::string &subType, const std::string &parameter);
ContentType (const ContentType &src);

View file

@ -305,9 +305,10 @@ EventsDb::EventsDb () : AbstractDb(*new EventsDbPrivate) {}
{ content }
);
const bool noAppData = false;
const string appData = getValueFromLegacyMessage<string>(message, 10, const_cast<bool &>(noAppData));
(void)appData;
bool noAppData = false;
const string appData = getValueFromLegacyMessage<string>(message, 10, noAppData);
if (!noAppData)
return;
}
tr.commit();
@ -385,6 +386,21 @@ EventsDb::EventsDb () : AbstractDb(*new EventsDbPrivate) {}
" ON DELETE CASCADE"
")";
*session <<
"CREATE TABLE IF NOT EXISTS message_participant ("
" message_event_id INT UNSIGNED NOT NULL,"
" sip_address_id INT UNSIGNED NOT NULL,"
" state TINYINT UNSIGNED NOT NULL,"
" PRIMARY KEY (message_event_id, sip_address_id),"
" FOREIGN KEY (message_event_id)"
" REFERENCES message_event(id)"
" ON DELETE CASCADE,"
" FOREIGN KEY (sip_address_id)"
" REFERENCES sip_address(id)"
" ON DELETE CASCADE,"
")";
*session <<
"CREATE TABLE IF NOT EXISTS message_content ("
" id" + primaryKeyAutoIncrementStr() + ","