wrap chatroom isReadOnly method

This commit is contained in:
Benjamin Reis 2017-11-30 14:56:50 +01:00
parent f23cfe2795
commit 286199423f
3 changed files with 12 additions and 1 deletions

View file

@ -273,6 +273,13 @@ LINPHONE_PUBLIC LinphoneChatRoomCbs * linphone_chat_room_get_callbacks (const Li
*/
LINPHONE_PUBLIC LinphoneChatRoomState linphone_chat_room_get_state (const LinphoneChatRoom *cr);
/**
* Return whether or not the chat room is read only.
* @param[in] cr LinphoneChatRoom object
* @return whether or not the chat room is read only
*/
LINPHONE_PUBLIC bool_t linphone_chat_room_is_read_only (const LinphoneChatRoom *cr);
/**
* Add a participant to a chat room. This may fail if this type of chat room does not handle participants.
* Use linphone_chat_room_can_handle_participants() to know if this chat room handles participants.

View file

@ -244,6 +244,10 @@ LinphoneChatRoomState linphone_chat_room_get_state (const LinphoneChatRoom *cr)
return (LinphoneChatRoomState)L_GET_CPP_PTR_FROM_C_OBJECT(cr)->getState();
}
bool_t linphone_chat_room_is_read_only (const LinphoneChatRoom *cr) {
return (bool_t)L_GET_CPP_PTR_FROM_C_OBJECT(cr)->isReadOnly();
}
void linphone_chat_room_add_participant (LinphoneChatRoom *cr, const LinphoneAddress *addr) {
L_GET_CPP_PTR_FROM_C_OBJECT(cr)->addParticipant(
LinphonePrivate::IdentityAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(addr)), nullptr, false

View file

@ -132,7 +132,7 @@ ClientGroupChatRoom::CapabilitiesMask ClientGroupChatRoom::getCapabilities () co
}
bool ClientGroupChatRoom::isReadOnly () const {
return getState() == State::Created;
return getState() != State::Created;
}
bool ClientGroupChatRoom::canHandleParticipants () const {