Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
BC
public
liblinphone
Commits
d7f31689
Commit
d7f31689
authored
Nov 09, 2017
by
Ronan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(MainDb): fetch conference chat rooms
parent
b0bf790f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
src/db/main-db.cpp
src/db/main-db.cpp
+10
-6
No files found.
src/db/main-db.cpp
View file @
d7f31689
...
...
@@ -28,6 +28,7 @@
#include "chat/chat-message/chat-message-p.h"
#include "chat/chat-room/chat-room.h"
#include "chat/chat-room/client-group-chat-room.h"
#include "conference/participant.h"
#include "content/content-type.h"
#include "content/content.h"
...
...
@@ -1275,10 +1276,9 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
soci
::
rowset
<
soci
::
row
>
rows
=
(
session
->
prepare
<<
query
);
for
(
const
auto
&
row
:
rows
)
{
string
sip
Address
=
row
.
get
<
string
>
(
0
);
shared_ptr
<
ChatRoom
>
chatRoom
=
core
->
findChatRoom
(
Address
(
sip
Address
)
)
;
Address
peer
Address
=
Address
(
row
.
get
<
string
>
(
0
)
)
;
shared_ptr
<
ChatRoom
>
chatRoom
=
core
->
findChatRoom
(
peer
Address
);
if
(
chatRoom
)
{
lInfo
()
<<
"Don't fetch chat room from database: `"
<<
sipAddress
<<
"`, it already exists."
;
chatRooms
.
push_back
(
chatRoom
);
continue
;
}
...
...
@@ -1292,16 +1292,20 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
// TODO: Use me.
(
void
)
creationDate
;
(
void
)
lastUpdateDate
;
(
void
)
subject
;
(
void
)
lastNotifyId
;
if
(
capabilities
&
static_cast
<
int
>
(
ChatRoom
::
Capabilities
::
Basic
))
{
chatRoom
=
core
->
getPrivate
()
->
createBasicChatRoom
(
Address
(
sip
Address
)
,
peer
Address
,
capabilities
&
static_cast
<
int
>
(
ChatRoom
::
Capabilities
::
RealTimeText
)
);
}
else
if
(
capabilities
&
static_cast
<
int
>
(
ChatRoom
::
Capabilities
::
Conference
))
{
// TODO: Set sip address and participants.
chatRoom
=
make_shared
<
ClientGroupChatRoom
>
(
getCore
(),
Address
(
"sip:titi@sip.linphone.org"
),
// TODO: Fix me!!!
peerAddress
.
asStringUriOnly
(),
subject
);
}
if
(
!
chatRoom
)
...
...
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