From 11dd47a8aa2a2fe8a63cbc6ba0ff03e5cc7b35a5 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sun, 7 Jul 2019 19:55:56 -0700 Subject: [PATCH] ircd::m::sync: Add pointer to struct args in struct data. --- include/ircd/m/sync.h | 3 ++- ircd/m.cc | 10 ++++++++-- modules/client/sync.cc | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/include/ircd/m/sync.h b/include/ircd/m/sync.h index df188ad11..dfb389c46 100644 --- a/include/ircd/m/sync.h +++ b/include/ircd/m/sync.h @@ -90,6 +90,7 @@ struct ircd::m::sync::data /// The client. This may be null if sync is being called internally. ircd::client *client {nullptr}; + const sync::args *args {nullptr}; // User related const m::user user; @@ -116,7 +117,7 @@ struct ircd::m::sync::data ircd::client *const &client = nullptr, json::stack *const &out = nullptr, sync::stats *const &stats = nullptr, - const string_view &filter_id = {}); + const sync::args *const &args = nullptr); data(data &&) = delete; data(const data &) = delete; diff --git a/ircd/m.cc b/ircd/m.cc index 92e4d3e25..8e8941bbc 100644 --- a/ircd/m.cc +++ b/ircd/m.cc @@ -1110,7 +1110,7 @@ ircd::m::sync::data::data(const m::user &user, ircd::client *const &client, json::stack *const &out, sync::stats *const &stats, - const string_view &filter_id) + const sync::args *const &args) :range { range @@ -1123,6 +1123,10 @@ ircd::m::sync::data::data(const m::user &user, { client } +,args +{ + args +} ,user { user @@ -1141,7 +1145,9 @@ ircd::m::sync::data::data(const m::user &user, } ,filter_buf { - m::filter::get(filter_id, user) + this->args? + m::filter::get(this->args->filter_id, user): + {} } ,filter { diff --git a/modules/client/sync.cc b/modules/client/sync.cc index efaf84366..8e105d223 100644 --- a/modules/client/sync.cc +++ b/modules/client/sync.cc @@ -218,7 +218,7 @@ ircd::m::sync::handle_get(client &client, &client, nullptr, &stats, - args.filter_id + &args, }; // Determine if this is an initial-sync request.