Commit 43e775bf authored by Ronan's avatar Ronan
Browse files

feat(MainDb): FilterMask is now an EnumMask type

parent fd191aa6
...@@ -109,7 +109,7 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate), ...@@ -109,7 +109,7 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
bool isStart = true; bool isStart = true;
string sql; string sql;
for (const auto &filter : filters) { for (const auto &filter : filters) {
if (!(mask & filter)) if (!mask.isSet(filter))
continue; continue;
if (isStart) { if (isStart) {
...@@ -1505,7 +1505,7 @@ static constexpr string &blobToString (string &in) { ...@@ -1505,7 +1505,7 @@ static constexpr string &blobToString (string &in) {
int count = 0; int count = 0;
DurationLogger durationLogger( DurationLogger durationLogger(
"Get events count with mask=" + Utils::toString(static_cast<int>(mask)) + "." "Get events count with mask=" + Utils::toString(mask) + "."
); );
L_BEGIN_LOG_EXCEPTION L_BEGIN_LOG_EXCEPTION
...@@ -1999,7 +1999,7 @@ static constexpr string &blobToString (string &in) { ...@@ -1999,7 +1999,7 @@ static constexpr string &blobToString (string &in) {
DurationLogger durationLogger( DurationLogger durationLogger(
"Clean history of: (peer=" + chatRoomId.getPeerAddress().asString() + "Clean history of: (peer=" + chatRoomId.getPeerAddress().asString() +
", local=" + chatRoomId.getLocalAddress().asString() + ", local=" + chatRoomId.getLocalAddress().asString() +
", mask=" + Utils::toString(static_cast<int>(mask)) + ")." ", mask=" + Utils::toString(mask) + ")."
); );
L_BEGIN_LOG_EXCEPTION L_BEGIN_LOG_EXCEPTION
...@@ -2422,7 +2422,7 @@ static constexpr string &blobToString (string &in) { ...@@ -2422,7 +2422,7 @@ static constexpr string &blobToString (string &in) {
return list<shared_ptr<EventLog>>(); return list<shared_ptr<EventLog>>();
} }
int getHistorySize (const ChatRoomId &, FilterMask) const { int MainDb::getHistorySize (const ChatRoomId &, FilterMask) const {
return 0; return 0;
} }
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
#include <list> #include <list>
#include "linphone/utils/enum-mask.h"
#include "abstract/abstract-db.h" #include "abstract/abstract-db.h"
#include "chat/chat-room/chat-room-id.h" #include "chat/chat-room/chat-room-id.h"
#include "core/core-accessor.h" #include "core/core-accessor.h"
...@@ -49,7 +51,7 @@ public: ...@@ -49,7 +51,7 @@ public:
ConferenceInfoFilter = 0x4 ConferenceInfoFilter = 0x4
}; };
typedef int FilterMask; typedef EnumMask<Filter> FilterMask;
MainDb (const std::shared_ptr<Core> &core); MainDb (const std::shared_ptr<Core> &core);
......
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