Commit 89ed9cae authored by Ghislain MARY's avatar Ghislain MARY

Rename isReadOnly() to hasBeenLeft() in ChatRoom.

parent 57e9fbd1
......@@ -274,11 +274,11 @@ 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.
* Return whether or not the chat room has been left.
* @param[in] cr LinphoneChatRoom object
* @return whether or not the chat room is read only
* @return whether or not the chat room has been left
*/
LINPHONE_PUBLIC bool_t linphone_chat_room_is_read_only (const LinphoneChatRoom *cr);
LINPHONE_PUBLIC bool_t linphone_chat_room_has_been_left (const LinphoneChatRoom *cr);
/**
* Add a participant to a chat room. This may fail if this type of chat room does not handle participants.
......
......@@ -244,8 +244,8 @@ 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();
bool_t linphone_chat_room_has_been_left (const LinphoneChatRoom *cr) {
return (bool_t)L_GET_CPP_PTR_FROM_C_OBJECT(cr)->hasBeenLeft();
}
void linphone_chat_room_add_participant (LinphoneChatRoom *cr, const LinphoneAddress *addr) {
......
......@@ -51,7 +51,7 @@ BasicChatRoom::CapabilitiesMask BasicChatRoom::getCapabilities () const {
return static_cast<CapabilitiesMask>(Capabilities::Basic);
}
bool BasicChatRoom::isReadOnly () const {
bool BasicChatRoom::hasBeenLeft () const {
return false;
}
......
......@@ -33,7 +33,7 @@ class LINPHONE_PUBLIC BasicChatRoom : public ChatRoom {
public:
CapabilitiesMask getCapabilities () const override;
bool isReadOnly () const override;
bool hasBeenLeft () const override;
const IdentityAddress &getConferenceAddress () const override;
......
......@@ -57,7 +57,7 @@ public:
time_t getLastUpdateTime () const;
virtual CapabilitiesMask getCapabilities () const = 0;
virtual bool isReadOnly () const = 0;
virtual bool hasBeenLeft () const = 0;
std::shared_ptr<ChatMessage> getLastMessageInHistory () const;
......
......@@ -104,7 +104,7 @@ ClientGroupChatRoom::ClientGroupChatRoom (
const string &subject,
list<shared_ptr<Participant>> &&participants,
unsigned int lastNotifyId,
bool isReadOnly
bool hasBeenLeft
) : ChatRoom(*new ClientGroupChatRoomPrivate, core, ChatRoomId(peerAddress, me->getAddress())),
RemoteConference(core, me->getAddress(), nullptr) {
L_D();
......@@ -115,7 +115,7 @@ RemoteConference(core, me->getAddress(), nullptr) {
dConference->subject = subject;
dConference->participants = move(participants);
d->state = isReadOnly ? ChatRoom::State::Terminated : ChatRoom::State::Created;
d->state = hasBeenLeft ? ChatRoom::State::Terminated : ChatRoom::State::Created;
getMe()->getPrivate()->setAdmin(me->isAdmin());
......@@ -131,7 +131,7 @@ ClientGroupChatRoom::CapabilitiesMask ClientGroupChatRoom::getCapabilities () co
return static_cast<CapabilitiesMask>(Capabilities::Conference);
}
bool ClientGroupChatRoom::isReadOnly () const {
bool ClientGroupChatRoom::hasBeenLeft () const {
return getState() != State::Created;
}
......
......@@ -46,13 +46,13 @@ public:
const std::string &subject,
std::list<std::shared_ptr<Participant>> &&participants,
unsigned int lastNotifyId,
bool isReadOnly
bool hasBeenLeft
);
std::shared_ptr<Core> getCore () const;
CapabilitiesMask getCapabilities () const override;
bool isReadOnly () const override;
bool hasBeenLeft () const override;
const IdentityAddress &getConferenceAddress () const override;
......
......@@ -85,7 +85,7 @@ int ServerGroupChatRoom::getCapabilities () const {
return 0;
}
bool ServerGroupChatRoom::isReadOnly () const {
bool ServerGroupChatRoom::hasBeenLeft () const {
return true;
}
......
......@@ -40,7 +40,7 @@ public:
ServerGroupChatRoom (const std::shared_ptr<Core> &core, SalCallOp *op);
CapabilitiesMask getCapabilities () const override;
bool isReadOnly () const override;
bool hasBeenLeft () const override;
const IdentityAddress &getConferenceAddress () const override;
......
......@@ -247,7 +247,7 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
const tm &creationTime = Utils::getTimeTAsTm(chatRoom->getCreationTime());
const int &capabilities = static_cast<int>(chatRoom->getCapabilities());
const string &subject = chatRoom->getSubject();
const int &flags = chatRoom->isReadOnly();
const int &flags = chatRoom->hasBeenLeft();
*session << "INSERT INTO chat_room ("
" peer_sip_address_id, local_sip_address_id, creation_time, last_update_time, capabilities, subject, flags"
") VALUES (:peerSipAddressId, :localSipAddressId, :creationTime, :lastUpdateTime, :capabilities, :subject, :flags)",
......
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