diff --git a/include/ircd/m/m.h b/include/ircd/m/m.h index 31ce69ae0..cede82696 100644 --- a/include/ircd/m/m.h +++ b/include/ircd/m/m.h @@ -80,6 +80,7 @@ namespace ircd::m #include "fetch.h" #include "breadcrumb_rooms.h" #include "media.h" +#include "search.h" struct ircd::m::init { diff --git a/include/ircd/m/name.h b/include/ircd/m/name.h index 4ec0f91f1..3f39b271a 100644 --- a/include/ircd/m/name.h +++ b/include/ircd/m/name.h @@ -171,4 +171,11 @@ struct ircd::m::name static constexpr const char *const prev_id {"prev_id"}; static constexpr const char *const deleted {"deleted"}; static constexpr const char *const access_token_id {"access_token_id"}; + + static constexpr const char *const search_term {"search_term"}; + static constexpr const char *const order_by {"order_by"}; + static constexpr const char *const event_context {"event_context"}; + static constexpr const char *const include_state {"include_state"}; + static constexpr const char *const groupings {"groupings"}; + static constexpr const char *const filter {"filter"}; }; diff --git a/include/ircd/m/search.h b/include/ircd/m/search.h new file mode 100644 index 000000000..49f043950 --- /dev/null +++ b/include/ircd/m/search.h @@ -0,0 +1,49 @@ +// Matrix Construct +// +// Copyright (C) Matrix Construct Developers, Authors & Contributors +// Copyright (C) 2016-2019 Jason Volk +// +// Permission to use, copy, modify, and/or distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice is present in all copies. The +// full license for this software is available in the LICENSE file. + +#pragma once +#define HAVE_IRCD_M_SEARCH_H + +namespace ircd::m::search +{ + struct room_events; +} + +struct ircd::m::search::room_events +:json::tuple +< + /// Required. The string to search events for + json::property, + + /// The keys to search. Defaults to all. One of: ["content.body", + /// "content.name", "content.topic"] + json::property, + + /// This takes a filter + json::property, + + /// The order in which to search for results. By default, this is "rank". + /// One of: ["recent", "rank"] + json::property, + + /// Configures whether any context for the events returned are included + /// in the response. + json::property, + + /// Requests the server return the current state for each room returned. + json::property, + + /// Requests that the server partitions the result set based on the + /// provided list of keys. + json::property +> +{ + using super_type::tuple; +}; diff --git a/ircd/m_name.cc b/ircd/m_name.cc index bfb5681d0..72d9c03e6 100644 --- a/ircd/m_name.cc +++ b/ircd/m_name.cc @@ -150,3 +150,10 @@ constexpr const char *const ircd::m::name::stream_id; constexpr const char *const ircd::m::name::prev_id; constexpr const char *const ircd::m::name::deleted; constexpr const char *const ircd::m::name::access_token_id; + +constexpr const char *const ircd::m::name::search_term; +constexpr const char *const ircd::m::name::order_by; +constexpr const char *const ircd::m::name::event_context; +constexpr const char *const ircd::m::name::include_state; +constexpr const char *const ircd::m::name::groupings; +constexpr const char *const ircd::m::name::filter;