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
3bcf6e35
Commit
3bcf6e35
authored
Sep 22, 2017
by
Benjamin REIS
Browse files
add parseResouceLists method to local conference
parent
8d075bbd
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/conference/local-conference.cpp
View file @
3bcf6e35
...
...
@@ -18,8 +18,10 @@
#include "local-conference.h"
#include "participant-p.h"
#include "xml/resource-lists.h"
using
namespace
std
;
using
namespace
LinphonePrivate
::
Xsd
::
ResourceLists
;
LINPHONE_BEGIN_NAMESPACE
...
...
@@ -57,4 +59,22 @@ void LocalConference::removeParticipant (const shared_ptr<const Participant> &pa
}
}
list
<
shared_ptr
<
Address
>>
LocalConference
::
parseResourceLists
(
string
xmlBody
)
{
istringstream
data
(
xmlBody
);
unique_ptr
<
ResourceLists
>
rl
=
LinphonePrivate
::
Xsd
::
ResourceLists
::
parseResourceLists
(
data
,
Xsd
::
XmlSchema
::
Flags
::
dont_validate
);
list
<
shared_ptr
<
Address
>>
addresses
=
list
<
shared_ptr
<
Address
>>
();
for
(
const
auto
&
l
:
rl
->
getList
())
{
for
(
const
auto
&
entry
:
l
.
getEntry
())
{
shared_ptr
<
Address
>
addr
=
make_shared
<
Address
>
(
Address
(
entry
.
getUri
()));
// TODO : set display name when possible
/*if(!entry.getDisplayName()->present()) {
addr->setDisplayName(entry.getDisplayName()->get());
}*/
addresses
.
push_back
(
addr
);
}
}
return
addresses
;
}
LINPHONE_END_NAMESPACE
src/conference/local-conference.h
View file @
3bcf6e35
...
...
@@ -38,6 +38,8 @@ public:
std
::
shared_ptr
<
Participant
>
addParticipant
(
const
Address
&
addr
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
override
;
void
removeParticipant
(
const
std
::
shared_ptr
<
const
Participant
>
&
participant
)
override
;
std
::
list
<
std
::
shared_ptr
<
Address
>>
parseResourceLists
(
std
::
string
xmlBody
);
private:
L_DISABLE_COPY
(
LocalConference
);
...
...
src/conference/remote-conference.cpp
View file @
3bcf6e35
...
...
@@ -65,7 +65,7 @@ string RemoteConference::getResourceLists(const list<shared_ptr<const Address>>
ListType
l
=
ListType
();
for
(
const
auto
&
addr
:
addresses
)
{
EntryType
entry
=
EntryType
(
addr
->
asStringUriOnly
());
if
(
addr
->
getDisplayName
()
!=
""
)
{
if
(
!
addr
->
getDisplayName
()
.
empty
()
)
{
entry
.
setDisplayName
(
DisplayName
(
addr
->
getDisplayName
()));
}
l
.
getEntry
().
push_back
(
entry
);
...
...
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