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
cc5ebffd
Commit
cc5ebffd
authored
Nov 08, 2017
by
Ghislain MARY
Browse files
Add linphone_chat_room_get_me() API.
parent
ad896ab4
Changes
11
Hide whitespace changes
Inline
Side-by-side
include/linphone/api/c-chat-room.h
View file @
cc5ebffd
...
...
@@ -284,6 +284,7 @@ LINPHONE_PUBLIC bool_t linphone_chat_room_can_handle_participants (const Linphon
* Find a participant of a chat room from its address.
* @param[in] cr A LinphoneChatRoom object
* @param[in] addr The address to search in the list of participants of the chat room
* @return The participant if found, NULL otherwise.
*/
LINPHONE_PUBLIC
LinphoneParticipant
*
linphone_chat_room_find_participant
(
const
LinphoneChatRoom
*
cr
,
const
LinphoneAddress
*
addr
);
...
...
@@ -294,6 +295,13 @@ LINPHONE_PUBLIC LinphoneParticipant *linphone_chat_room_find_participant (const
*/
LINPHONE_PUBLIC
const
LinphoneAddress
*
linphone_chat_room_get_conference_address
(
const
LinphoneChatRoom
*
cr
);
/**
* Get the participant representing myself in the chat room.
* @param[in] cr A LinphoneChatRoom object
* @return The participant representing myself in the conference.
*/
LINPHONE_PUBLIC
LinphoneParticipant
*
linphone_chat_room_get_me
(
const
LinphoneChatRoom
*
cr
);
/**
* Get the number of participants in the chat room (that is without ourselves).
* @param[in] cr A LinphoneChatRoom object
...
...
src/c-wrapper/api/c-chat-room.cpp
View file @
cc5ebffd
...
...
@@ -266,6 +266,10 @@ const LinphoneAddress *linphone_chat_room_get_conference_address (const Linphone
return
cr
->
conferenceAddressCache
;
}
LinphoneParticipant
*
linphone_chat_room_get_me
(
const
LinphoneChatRoom
*
cr
)
{
return
L_GET_C_BACK_PTR
(
L_GET_CPP_PTR_FROM_C_OBJECT
(
cr
)
->
getMe
());
}
int
linphone_chat_room_get_nb_participants
(
const
LinphoneChatRoom
*
cr
)
{
return
L_GET_CPP_PTR_FROM_C_OBJECT
(
cr
)
->
getNbParticipants
();
}
...
...
src/chat/chat-room/basic-chat-room.cpp
View file @
cc5ebffd
...
...
@@ -64,6 +64,11 @@ const Address &BasicChatRoom::getConferenceAddress () const {
return
Utils
::
getEmptyConstRefObject
<
Address
>
();
}
shared_ptr
<
Participant
>
BasicChatRoom
::
getMe
()
const
{
lError
()
<<
"a BasicChatRoom does not handle participants"
;
return
nullptr
;
}
int
BasicChatRoom
::
getNbParticipants
()
const
{
return
1
;
}
...
...
src/chat/chat-room/basic-chat-room.h
View file @
cc5ebffd
...
...
@@ -41,6 +41,7 @@ public:
bool
canHandleParticipants
()
const
override
;
std
::
shared_ptr
<
Participant
>
findParticipant
(
const
Address
&
addr
)
const
override
;
const
Address
&
getConferenceAddress
()
const
override
;
std
::
shared_ptr
<
Participant
>
getMe
()
const
override
;
int
getNbParticipants
()
const
override
;
std
::
list
<
std
::
shared_ptr
<
Participant
>>
getParticipants
()
const
override
;
const
std
::
string
&
getSubject
()
const
override
;
...
...
src/chat/chat-room/client-group-chat-room.cpp
View file @
cc5ebffd
...
...
@@ -145,6 +145,10 @@ const Address &ClientGroupChatRoom::getConferenceAddress () const {
return
RemoteConference
::
getConferenceAddress
();
}
shared_ptr
<
Participant
>
ClientGroupChatRoom
::
getMe
()
const
{
return
RemoteConference
::
getMe
();
}
int
ClientGroupChatRoom
::
getNbParticipants
()
const
{
return
RemoteConference
::
getNbParticipants
();
}
...
...
src/chat/chat-room/client-group-chat-room.h
View file @
cc5ebffd
...
...
@@ -47,6 +47,7 @@ public:
bool
canHandleParticipants
()
const
override
;
std
::
shared_ptr
<
Participant
>
findParticipant
(
const
Address
&
addr
)
const
override
;
const
Address
&
getConferenceAddress
()
const
override
;
std
::
shared_ptr
<
Participant
>
getMe
()
const
override
;
int
getNbParticipants
()
const
override
;
std
::
list
<
std
::
shared_ptr
<
Participant
>>
getParticipants
()
const
override
;
const
std
::
string
&
getSubject
()
const
override
;
...
...
src/chat/chat-room/real-time-text-chat-room.cpp
View file @
cc5ebffd
...
...
@@ -164,6 +164,11 @@ const Address &RealTimeTextChatRoom::getConferenceAddress () const {
return
Utils
::
getEmptyConstRefObject
<
Address
>
();
}
shared_ptr
<
Participant
>
RealTimeTextChatRoom
::
getMe
()
const
{
lError
()
<<
"a RealTimeTextChatRoom does not handle participants"
;
return
nullptr
;
}
int
RealTimeTextChatRoom
::
getNbParticipants
()
const
{
return
1
;
}
...
...
src/chat/chat-room/real-time-text-chat-room.h
View file @
cc5ebffd
...
...
@@ -47,6 +47,7 @@ public:
bool
canHandleParticipants
()
const
override
;
std
::
shared_ptr
<
Participant
>
findParticipant
(
const
Address
&
addr
)
const
override
;
const
Address
&
getConferenceAddress
()
const
override
;
std
::
shared_ptr
<
Participant
>
getMe
()
const
override
;
int
getNbParticipants
()
const
override
;
std
::
list
<
std
::
shared_ptr
<
Participant
>>
getParticipants
()
const
override
;
const
std
::
string
&
getSubject
()
const
override
;
...
...
src/conference/conference-interface.h
View file @
cc5ebffd
...
...
@@ -42,6 +42,7 @@ public:
virtual
bool
canHandleParticipants
()
const
=
0
;
virtual
std
::
shared_ptr
<
Participant
>
findParticipant
(
const
Address
&
addr
)
const
=
0
;
virtual
const
Address
&
getConferenceAddress
()
const
=
0
;
virtual
std
::
shared_ptr
<
Participant
>
getMe
()
const
=
0
;
virtual
int
getNbParticipants
()
const
=
0
;
virtual
std
::
list
<
std
::
shared_ptr
<
Participant
>>
getParticipants
()
const
=
0
;
virtual
const
std
::
string
&
getSubject
()
const
=
0
;
...
...
src/conference/conference.cpp
View file @
cc5ebffd
...
...
@@ -48,11 +48,6 @@ shared_ptr<Participant> Conference::getActiveParticipant () const {
return
d
->
activeParticipant
;
}
shared_ptr
<
Participant
>
Conference
::
getMe
()
const
{
L_D
();
return
d
->
me
;
}
LinphoneCore
*
Conference
::
getCore
()
const
{
L_D
();
return
d
->
core
;
...
...
@@ -84,6 +79,11 @@ const Address &Conference::getConferenceAddress () const {
return
d
->
conferenceAddress
;
}
shared_ptr
<
Participant
>
Conference
::
getMe
()
const
{
L_D
();
return
d
->
me
;
}
int
Conference
::
getNbParticipants
()
const
{
L_D
();
return
static_cast
<
int
>
(
d
->
participants
.
size
());
...
...
src/conference/conference.h
View file @
cc5ebffd
...
...
@@ -40,7 +40,6 @@ public:
virtual
~
Conference
();
std
::
shared_ptr
<
Participant
>
getActiveParticipant
()
const
;
std
::
shared_ptr
<
Participant
>
getMe
()
const
;
LinphoneCore
*
getCore
()
const
;
...
...
@@ -52,6 +51,7 @@ public:
bool
canHandleParticipants
()
const
override
;
std
::
shared_ptr
<
Participant
>
findParticipant
(
const
Address
&
addr
)
const
override
;
const
Address
&
getConferenceAddress
()
const
override
;
std
::
shared_ptr
<
Participant
>
getMe
()
const
override
;
int
getNbParticipants
()
const
override
;
std
::
list
<
std
::
shared_ptr
<
Participant
>>
getParticipants
()
const
override
;
const
std
::
string
&
getSubject
()
const
override
;
...
...
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