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
f92da345
Commit
f92da345
authored
Dec 06, 2017
by
Ghislain MARY
Browse files
Keep the gruu address of the client group chat room focus participant.
parent
59f9c18b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
13 deletions
+23
-13
src/chat/chat-room/client-group-chat-room.cpp
src/chat/chat-room/client-group-chat-room.cpp
+7
-3
src/conference/participant-p.h
src/conference/participant-p.h
+3
-1
src/conference/participant.cpp
src/conference/participant.cpp
+13
-9
No files found.
src/chat/chat-room/client-group-chat-room.cpp
View file @
f92da345
...
...
@@ -66,7 +66,7 @@ shared_ptr<CallSession> ClientGroupChatRoomPrivate::createSession () {
const
Address
&
myAddress
=
q
->
getMe
()
->
getAddress
();
Address
myCleanedAddress
(
myAddress
);
myCleanedAddress
.
setUriParam
(
"gr"
);
// Remove gr parameter for INVITE
session
->
configure
(
LinphoneCallOutgoing
,
nullptr
,
nullptr
,
myCleanedAddress
,
focus
->
getAddress
());
session
->
configure
(
LinphoneCallOutgoing
,
nullptr
,
nullptr
,
myCleanedAddress
,
focus
->
getPrivate
()
->
getDevices
().
front
()
->
getAddress
());
session
->
initiateOutgoing
();
return
session
;
}
...
...
@@ -87,13 +87,15 @@ void ClientGroupChatRoomPrivate::onChatMessageReceived (const shared_ptr<ChatMes
ClientGroupChatRoom
::
ClientGroupChatRoom
(
const
shared_ptr
<
Core
>
&
core
,
const
string
&
factoryU
ri
,
const
string
&
u
ri
,
const
IdentityAddress
&
me
,
const
string
&
subject
)
:
ChatRoom
(
*
new
ClientGroupChatRoomPrivate
,
core
,
ChatRoomId
(
IdentityAddress
(),
me
)),
RemoteConference
(
core
,
me
,
nullptr
)
{
L_D_T
(
RemoteConference
,
dConference
);
dConference
->
focus
=
make_shared
<
Participant
>
(
Address
(
factoryUri
));
IdentityAddress
focusAddr
(
uri
);
dConference
->
focus
=
make_shared
<
Participant
>
(
focusAddr
);
dConference
->
focus
->
getPrivate
()
->
addDevice
(
focusAddr
);
RemoteConference
::
setSubject
(
subject
);
}
...
...
@@ -298,6 +300,8 @@ void ClientGroupChatRoom::onConferenceCreated (const IdentityAddress &addr) {
L_D_T
(
RemoteConference
,
dConference
);
dConference
->
conferenceAddress
=
addr
;
dConference
->
focus
->
getPrivate
()
->
setAddress
(
addr
);
dConference
->
focus
->
getPrivate
()
->
clearDevices
();
dConference
->
focus
->
getPrivate
()
->
addDevice
(
addr
);
d
->
chatRoomId
=
ChatRoomId
(
addr
,
d
->
chatRoomId
.
getLocalAddress
());
getCore
()
->
getPrivate
()
->
insertChatRoom
(
getSharedFromThis
());
}
...
...
src/conference/participant-p.h
View file @
f92da345
...
...
@@ -40,10 +40,12 @@ public:
inline
void
removeSession
()
{
session
.
reset
();
}
inline
void
setAddress
(
const
IdentityAddress
&
newAddr
)
{
addr
=
newAddr
;
}
inline
void
setAdmin
(
bool
isAdmin
)
{
this
->
isAdmin
=
isAdmin
;
}
std
::
shared_ptr
<
ParticipantDevice
>
addDevice
(
const
IdentityAddress
&
gruu
);
void
clearDevices
();
std
::
shared_ptr
<
ParticipantDevice
>
findDevice
(
const
IdentityAddress
&
gruu
)
const
;
std
::
shared_ptr
<
ParticipantDevice
>
findDevice
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
);
const
std
::
list
<
std
::
shared_ptr
<
ParticipantDevice
>>
&
getDevices
()
const
;
std
::
shared_ptr
<
ParticipantDevice
>
addDevice
(
const
IdentityAddress
&
gruu
);
void
removeDevice
(
const
IdentityAddress
&
gruu
);
private:
...
...
src/conference/participant.cpp
View file @
f92da345
...
...
@@ -46,6 +46,19 @@ shared_ptr<CallSession> ParticipantPrivate::createSession (
// -----------------------------------------------------------------------------
shared_ptr
<
ParticipantDevice
>
ParticipantPrivate
::
addDevice
(
const
IdentityAddress
&
gruu
)
{
shared_ptr
<
ParticipantDevice
>
device
=
findDevice
(
gruu
);
if
(
device
)
return
device
;
device
=
make_shared
<
ParticipantDevice
>
(
gruu
);
devices
.
push_back
(
device
);
return
device
;
}
void
ParticipantPrivate
::
clearDevices
()
{
devices
.
clear
();
}
shared_ptr
<
ParticipantDevice
>
ParticipantPrivate
::
findDevice
(
const
IdentityAddress
&
gruu
)
const
{
for
(
const
auto
&
device
:
devices
)
{
if
(
device
->
getAddress
()
==
gruu
)
...
...
@@ -66,15 +79,6 @@ const list<shared_ptr<ParticipantDevice>> &ParticipantPrivate::getDevices () con
return
devices
;
}
shared_ptr
<
ParticipantDevice
>
ParticipantPrivate
::
addDevice
(
const
IdentityAddress
&
gruu
)
{
shared_ptr
<
ParticipantDevice
>
device
=
findDevice
(
gruu
);
if
(
device
)
return
device
;
device
=
make_shared
<
ParticipantDevice
>
(
gruu
);
devices
.
push_back
(
device
);
return
device
;
}
void
ParticipantPrivate
::
removeDevice
(
const
IdentityAddress
&
gruu
)
{
for
(
auto
it
=
devices
.
begin
();
it
!=
devices
.
end
();
it
++
)
{
if
((
*
it
)
->
getAddress
()
==
gruu
)
{
...
...
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