Commit f94554d7 authored by Ronan's avatar Ronan

feat(chat-room): CapabilitiesMask is now an EnumMask type

parent 41a4a345
...@@ -40,8 +40,6 @@ public: ...@@ -40,8 +40,6 @@ public:
std::is_signed<typename std::underlying_type<T>::type>::value, int, unsigned int std::is_signed<typename std::underlying_type<T>::type>::value, int, unsigned int
>::type StorageType; >::type StorageType;
typedef std::integral_constant<int, 0> Zero;
// Zero initializer: Take 0 value or no value. // Zero initializer: Take 0 value or no value.
constexpr EnumMask (int *zero = 0) : mMask(0) {} constexpr EnumMask (int *zero = 0) : mMask(0) {}
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
#ifndef _ABSTRACT_CHAT_ROOM_H_ #ifndef _ABSTRACT_CHAT_ROOM_H_
#define _ABSTRACT_CHAT_ROOM_H_ #define _ABSTRACT_CHAT_ROOM_H_
#include "linphone/utils/enum-mask.h"
#include "chat/chat-message/chat-message.h" #include "chat/chat-message/chat-message.h"
#include "conference/conference-interface.h" #include "conference/conference-interface.h"
#include "core/core-accessor.h" #include "core/core-accessor.h"
...@@ -43,7 +45,7 @@ public: ...@@ -43,7 +45,7 @@ public:
L_DECLARE_ENUM(Capabilities, L_ENUM_VALUES_CHAT_ROOM_CAPABILITIES); L_DECLARE_ENUM(Capabilities, L_ENUM_VALUES_CHAT_ROOM_CAPABILITIES);
L_DECLARE_ENUM(State, L_ENUM_VALUES_CHAT_ROOM_STATE); L_DECLARE_ENUM(State, L_ENUM_VALUES_CHAT_ROOM_STATE);
typedef int CapabilitiesMask; typedef EnumMask<Capabilities> CapabilitiesMask;
virtual const ChatRoomId &getChatRoomId () const = 0; virtual const ChatRoomId &getChatRoomId () const = 0;
......
...@@ -44,7 +44,7 @@ BasicChatRoom::BasicChatRoom ( ...@@ -44,7 +44,7 @@ BasicChatRoom::BasicChatRoom (
} }
BasicChatRoom::CapabilitiesMask BasicChatRoom::getCapabilities () const { BasicChatRoom::CapabilitiesMask BasicChatRoom::getCapabilities () const {
return static_cast<CapabilitiesMask>(Capabilities::Basic); return Capabilities::Basic;
} }
bool BasicChatRoom::hasBeenLeft () const { bool BasicChatRoom::hasBeenLeft () const {
......
...@@ -159,7 +159,7 @@ shared_ptr<Core> ClientGroupChatRoom::getCore () const { ...@@ -159,7 +159,7 @@ shared_ptr<Core> ClientGroupChatRoom::getCore () const {
} }
ClientGroupChatRoom::CapabilitiesMask ClientGroupChatRoom::getCapabilities () const { ClientGroupChatRoom::CapabilitiesMask ClientGroupChatRoom::getCapabilities () const {
return static_cast<CapabilitiesMask>(Capabilities::Conference); return Capabilities::Conference;
} }
bool ClientGroupChatRoom::hasBeenLeft () const { bool ClientGroupChatRoom::hasBeenLeft () const {
......
...@@ -107,7 +107,7 @@ RealTimeTextChatRoom::RealTimeTextChatRoom (const shared_ptr<Core> &core, const ...@@ -107,7 +107,7 @@ RealTimeTextChatRoom::RealTimeTextChatRoom (const shared_ptr<Core> &core, const
BasicChatRoom(*new RealTimeTextChatRoomPrivate, core, chatRoomId) {} BasicChatRoom(*new RealTimeTextChatRoomPrivate, core, chatRoomId) {}
RealTimeTextChatRoom::CapabilitiesMask RealTimeTextChatRoom::getCapabilities () const { RealTimeTextChatRoom::CapabilitiesMask RealTimeTextChatRoom::getCapabilities () const {
return BasicChatRoom::getCapabilities() | static_cast<CapabilitiesMask>(Capabilities::RealTimeText); return BasicChatRoom::getCapabilities() | Capabilities::RealTimeText;
} }
uint32_t RealTimeTextChatRoom::getChar () const { uint32_t RealTimeTextChatRoom::getChar () const {
......
...@@ -103,7 +103,7 @@ ServerGroupChatRoom::ServerGroupChatRoom ( ...@@ -103,7 +103,7 @@ ServerGroupChatRoom::ServerGroupChatRoom (
) : ChatRoom(*new ServerGroupChatRoomPrivate, core, ChatRoomId(peerAddress, peerAddress)), ) : ChatRoom(*new ServerGroupChatRoomPrivate, core, ChatRoomId(peerAddress, peerAddress)),
LocalConference(core, peerAddress, nullptr) {} LocalConference(core, peerAddress, nullptr) {}
int ServerGroupChatRoom::getCapabilities () const { ServerGroupChatRoom::CapabilitiesMask ServerGroupChatRoom::getCapabilities () const {
return 0; return 0;
} }
......
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