diff --git a/include/mtx/filters.hpp b/include/mtx/filters.hpp new file mode 100644 index 0000000000000000000000000000000000000000..1950f917da7b105df2feecb4c3b016c0d6c62c55 --- /dev/null +++ b/include/mtx/filters.hpp @@ -0,0 +1,30 @@ +#pragma once + +#if __has_include(<nlohmann/json_fwd.hpp>) +#include <nlohmann/json_fwd.hpp> +#else +#include <nlohmann/json.hpp> +#endif + +#include <string> + +//! Filters can be created on the server and can be +//! passed as a parameter to APIs which return events. + +namespace mtx { +namespace filters { + +struct Filter { + //! A string to search for in the room metadata, + //! e.g. name, topic, canonical alias etc. (Optional). + std::string generic_search_term; +}; + +void +from_json(const nlohmann::json &obj, Filter &res); + +void +to_json(nlohmann::json &obj, const Filter &res); + +} // namespace filters +} // namespace mtx