Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
220ab0f1
Commit
220ab0f1
authored
Nov 29, 2017
by
Ronan
Browse files
feat(MainDb): explicit insert of basic chat room
parent
a23c0e4f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
src/db/main-db-p.h
src/db/main-db-p.h
+1
-2
src/db/main-db.cpp
src/db/main-db.cpp
+3
-4
No files found.
src/db/main-db-p.h
View file @
220ab0f1
...
...
@@ -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
insert
Basic
ChatRoom
(
long
long
peerSipAddressId
,
long
long
localSipAddressId
,
int
capabilities
,
const
tm
&
creationTime
);
long
long
insertChatRoom
(
const
std
::
shared_ptr
<
ChatRoom
>
&
chatRoom
);
...
...
src/db/main-db.cpp
View file @
220ab0f1
...
...
@@ -200,10 +200,9 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
return
q
->
getLastInsertId
();
}
long
long
MainDbPrivate
::
insertChatRoom
(
long
long
MainDbPrivate
::
insert
Basic
ChatRoom
(
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
->
insert
Basic
ChatRoom
(
remoteSipAddressId
,
localSipAddressId
,
static_cast
<
int
>
(
ChatRoom
::
Capabilities
::
Basic
),
creationTime
);
const
int
&
isSecured
=
message
.
get
<
int
>
(
LEGACY_MESSAGE_COL_IS_SECURED
,
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment