mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-30 01:39:20 +00:00
feat(MainDb): explicit insert of basic chat room
This commit is contained in:
parent
a23c0e4f20
commit
220ab0f123
2 changed files with 4 additions and 6 deletions
|
|
@ -54,10 +54,9 @@ private:
|
|||
void insertContent (long long messageEventId, const Content &content);
|
||||
void updateContent (long long messageEventId, long long messageContentId, const Content &content);
|
||||
long long insertContentType (const std::string &contentType);
|
||||
long long insertChatRoom (
|
||||
long long insertBasicChatRoom (
|
||||
long long peerSipAddressId,
|
||||
long long localSipAddressId,
|
||||
int capabilities,
|
||||
const tm &creationTime
|
||||
);
|
||||
long long insertChatRoom (const std::shared_ptr<ChatRoom> &chatRoom);
|
||||
|
|
|
|||
|
|
@ -200,10 +200,9 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
|
|||
return q->getLastInsertId();
|
||||
}
|
||||
|
||||
long long MainDbPrivate::insertChatRoom (
|
||||
long long MainDbPrivate::insertBasicChatRoom (
|
||||
long long peerSipAddressId,
|
||||
long long localSipAddressId,
|
||||
int capabilities,
|
||||
const tm &creationTime
|
||||
) {
|
||||
L_Q();
|
||||
|
|
@ -214,6 +213,7 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
|
|||
if (id >= 0)
|
||||
return id;
|
||||
|
||||
static const int capabilities = static_cast<int>(ChatRoom::Capabilities::Basic);
|
||||
lInfo() << "Insert new chat room in database: (peer=" << peerSipAddressId <<
|
||||
", local=" << localSipAddressId << ", capabilities=" << capabilities << ").";
|
||||
*session << "INSERT INTO chat_room ("
|
||||
|
|
@ -1989,10 +1989,9 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
|
|||
const long long &eventId = getLastInsertId();
|
||||
const long long &localSipAddressId = d->insertSipAddress(message.get<string>(LEGACY_MESSAGE_COL_LOCAL_ADDRESS));
|
||||
const long long &remoteSipAddressId = d->insertSipAddress(message.get<string>(LEGACY_MESSAGE_COL_REMOTE_ADDRESS));
|
||||
const long long &chatRoomId = d->insertChatRoom(
|
||||
const long long &chatRoomId = d->insertBasicChatRoom(
|
||||
remoteSipAddressId,
|
||||
localSipAddressId,
|
||||
static_cast<int>(ChatRoom::Capabilities::Basic),
|
||||
creationTime
|
||||
);
|
||||
const int &isSecured = message.get<int>(LEGACY_MESSAGE_COL_IS_SECURED, 0);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue