Commit 28619942 authored by Benjamin REIS's avatar Benjamin REIS

wrap chatroom isReadOnly method

parent f23cfe27
......@@ -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.
......
......@@ -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
......
......@@ -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 {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment