Commit a225f7cf authored by Ronan's avatar Ronan

fix(MainDb): add a workaround to define sql filters on Windows

parent 3ee89b9d
......@@ -17,7 +17,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "linphone/api/c-api.h"
#include "linphone/core.h"
#include "linphone/event.h"
#include "linphone/proxy_config.h"
......
......@@ -153,27 +153,35 @@ struct SqlEventFilterBuilder<Type> {
// -----------------------------------------------------------------------------
namespace {
constexpr auto ConferenceCallFilter = SqlEventFilterBuilder<
EventLog::Type::ConferenceCallStart,
EventLog::Type::ConferenceCallEnd
>::get();
constexpr auto ConferenceChatMessageFilter = SqlEventFilterBuilder<EventLog::Type::ConferenceChatMessage>::get();
constexpr auto ConferenceInfoNoDeviceFilter = SqlEventFilterBuilder<
EventLog::Type::ConferenceCreated,
EventLog::Type::ConferenceTerminated,
EventLog::Type::ConferenceParticipantAdded,
EventLog::Type::ConferenceParticipantRemoved,
EventLog::Type::ConferenceParticipantSetAdmin,
EventLog::Type::ConferenceParticipantUnsetAdmin,
EventLog::Type::ConferenceSubjectChanged
>::get();
constexpr auto ConferenceInfoFilter = ConferenceInfoNoDeviceFilter + "," + SqlEventFilterBuilder<
EventLog::Type::ConferenceParticipantDeviceAdded,
EventLog::Type::ConferenceParticipantDeviceRemoved
>::get();
#ifdef _WIN32
// TODO: Find a workaround to deal with StaticString concatenation!!!
constexpr char ConferenceCallFilter[] = "3,4";
constexpr char ConferenceChatMessageFilter[] = "5";
constexpr char ConferenceInfoNoDeviceFilter[] = "1,2,6,7,8,9,12";
constexpr char ConferenceInfoFilter[] = "1,2,6,7,8,9,10,11,12";
#else
constexpr auto ConferenceCallFilter = SqlEventFilterBuilder<
EventLog::Type::ConferenceCallStart,
EventLog::Type::ConferenceCallEnd
>::get();
constexpr auto ConferenceChatMessageFilter = SqlEventFilterBuilder<EventLog::Type::ConferenceChatMessage>::get();
constexpr auto ConferenceInfoNoDeviceFilter = SqlEventFilterBuilder<
EventLog::Type::ConferenceCreated,
EventLog::Type::ConferenceTerminated,
EventLog::Type::ConferenceParticipantAdded,
EventLog::Type::ConferenceParticipantRemoved,
EventLog::Type::ConferenceParticipantSetAdmin,
EventLog::Type::ConferenceParticipantUnsetAdmin,
EventLog::Type::ConferenceSubjectChanged
>::get();
constexpr auto ConferenceInfoFilter = ConferenceInfoNoDeviceFilter + "," + SqlEventFilterBuilder<
EventLog::Type::ConferenceParticipantDeviceAdded,
EventLog::Type::ConferenceParticipantDeviceRemoved
>::get();
#endif // ifdef _WIN32
constexpr EnumToSql<MainDb::Filter> EventFilterToSql[] = {
{ MainDb::ConferenceCallFilter, ConferenceCallFilter },
......
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