diff --git a/src/db/main-db.cpp b/src/db/main-db.cpp index e0a116ee5..1a4c515cf 100644 --- a/src/db/main-db.cpp +++ b/src/db/main-db.cpp @@ -109,7 +109,7 @@ MainDb::MainDb (const shared_ptr &core) : AbstractDb(*new MainDbPrivate), bool isStart = true; string sql; for (const auto &filter : filters) { - if (!(mask & filter)) + if (!mask.isSet(filter)) continue; if (isStart) { @@ -1505,7 +1505,7 @@ static constexpr string &blobToString (string &in) { int count = 0; DurationLogger durationLogger( - "Get events count with mask=" + Utils::toString(static_cast(mask)) + "." + "Get events count with mask=" + Utils::toString(mask) + "." ); L_BEGIN_LOG_EXCEPTION @@ -1999,7 +1999,7 @@ static constexpr string &blobToString (string &in) { DurationLogger durationLogger( "Clean history of: (peer=" + chatRoomId.getPeerAddress().asString() + ", local=" + chatRoomId.getLocalAddress().asString() + - ", mask=" + Utils::toString(static_cast(mask)) + ")." + ", mask=" + Utils::toString(mask) + ")." ); L_BEGIN_LOG_EXCEPTION @@ -2422,7 +2422,7 @@ static constexpr string &blobToString (string &in) { return list>(); } - int getHistorySize (const ChatRoomId &, FilterMask) const { + int MainDb::getHistorySize (const ChatRoomId &, FilterMask) const { return 0; } diff --git a/src/db/main-db.h b/src/db/main-db.h index 5a7f04540..a82fd4a45 100644 --- a/src/db/main-db.h +++ b/src/db/main-db.h @@ -22,6 +22,8 @@ #include +#include "linphone/utils/enum-mask.h" + #include "abstract/abstract-db.h" #include "chat/chat-room/chat-room-id.h" #include "core/core-accessor.h" @@ -49,7 +51,7 @@ public: ConferenceInfoFilter = 0x4 }; - typedef int FilterMask; + typedef EnumMask FilterMask; MainDb (const std::shared_ptr &core);