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
05271e86
Commit
05271e86
authored
Dec 04, 2017
by
Ghislain MARY
Browse files
Change the state of ClientGroupChatRoom and ServerGroupChatRoom outside of their constructors.
parent
a57290db
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
11 deletions
+14
-11
src/chat/chat-room/client-group-chat-room.cpp
src/chat/chat-room/client-group-chat-room.cpp
+1
-5
src/chat/chat-room/client-group-chat-room.h
src/chat/chat-room/client-group-chat-room.h
+1
-2
src/db/main-db.cpp
src/db/main-db.cpp
+12
-4
No files found.
src/chat/chat-room/client-group-chat-room.cpp
View file @
05271e86
...
...
@@ -103,11 +103,9 @@ ClientGroupChatRoom::ClientGroupChatRoom (
shared_ptr
<
Participant
>
&
me
,
const
string
&
subject
,
list
<
shared_ptr
<
Participant
>>
&&
participants
,
unsigned
int
lastNotifyId
,
bool
hasBeenLeft
unsigned
int
lastNotifyId
)
:
ChatRoom
(
*
new
ClientGroupChatRoomPrivate
,
core
,
ChatRoomId
(
peerAddress
,
me
->
getAddress
())),
RemoteConference
(
core
,
me
->
getAddress
(),
nullptr
)
{
L_D
();
L_D_T
(
RemoteConference
,
dConference
);
dConference
->
focus
=
make_shared
<
Participant
>
(
peerAddress
);
...
...
@@ -115,8 +113,6 @@ RemoteConference(core, me->getAddress(), nullptr) {
dConference
->
subject
=
subject
;
dConference
->
participants
=
move
(
participants
);
d
->
state
=
hasBeenLeft
?
ChatRoom
::
State
::
Terminated
:
ChatRoom
::
State
::
Created
;
getMe
()
->
getPrivate
()
->
setAdmin
(
me
->
isAdmin
());
dConference
->
eventHandler
->
setLastNotify
(
lastNotifyId
);
...
...
src/chat/chat-room/client-group-chat-room.h
View file @
05271e86
...
...
@@ -45,8 +45,7 @@ public:
std
::
shared_ptr
<
Participant
>
&
me
,
const
std
::
string
&
subject
,
std
::
list
<
std
::
shared_ptr
<
Participant
>>
&&
participants
,
unsigned
int
lastNotifyId
,
bool
hasBeenLeft
unsigned
int
lastNotifyId
);
std
::
shared_ptr
<
Core
>
getCore
()
const
;
...
...
src/db/main-db.cpp
View file @
05271e86
...
...
@@ -1906,17 +1906,22 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
continue
;
}
if
(
!
linphone_core_conference_server_enabled
(
core
->
getCCore
()))
if
(
!
linphone_core_conference_server_enabled
(
core
->
getCCore
()))
{
bool
hasBeenLeft
=
!!
row
.
get
<
int
>
(
8
,
0
);
chatRoom
=
make_shared
<
ClientGroupChatRoom
>
(
core
,
chatRoomId
.
getPeerAddress
(),
me
,
subject
,
move
(
participants
),
lastNotifyId
,
!!
row
.
get
<
int
>
(
8
,
0
)
lastNotifyId
);
chatRoom
->
getPrivate
()
->
setState
(
LinphonePrivate
::
ChatRoom
::
State
::
Instantiated
);
chatRoom
->
getPrivate
()
->
setState
(
hasBeenLeft
?
ChatRoom
::
State
::
Terminated
:
ChatRoom
::
State
::
Created
);
else
}
else
{
chatRoom
=
make_shared
<
ServerGroupChatRoom
>
(
core
,
chatRoomId
.
getPeerAddress
(),
...
...
@@ -1924,6 +1929,9 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
move
(
participants
),
lastNotifyId
);
chatRoom
->
getPrivate
()
->
setState
(
LinphonePrivate
::
ChatRoom
::
State
::
Instantiated
);
chatRoom
->
getPrivate
()
->
setState
(
LinphonePrivate
::
ChatRoom
::
State
::
Created
);
}
}
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