From 64229eb7554ba8bbb655ca8af0017fabda66da3b Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Thu, 24 Jan 2019 11:32:57 -0800 Subject: [PATCH] ircd::m::vm: Expose json_source dbs option to vmopts interface. --- include/ircd/m/vm.h | 7 +++++++ modules/vm.cc | 1 + 2 files changed, 8 insertions(+) diff --git a/include/ircd/m/vm.h b/include/ircd/m/vm.h index 28472634e..30800c8af 100644 --- a/include/ircd/m/vm.h +++ b/include/ircd/m/vm.h @@ -161,6 +161,13 @@ struct ircd::m::vm::opts /// replayed through the system (not recommended). bool replays {false}; + /// If the input event has a reference to already-strung json we can use + /// that directly when writing to the DB. When this is false we will + /// re-stringify the event internally either from a referenced source or + /// the tuple if no source is referenced. This should only be set to true + /// if the evaluator already performed this and the json source is good. + bool json_source {false}; + // Verify the origin signature bool verify {true}; diff --git a/modules/vm.cc b/modules/vm.cc index 544710918..4a9976a13 100644 --- a/modules/vm.cc +++ b/modules/vm.cc @@ -687,6 +687,7 @@ ircd::m::vm::_write(eval &eval, wopts.history = opts.history; wopts.head = opts.head; wopts.refs = opts.refs; + wopts.json_source = opts.json_source; wopts.event_idx = eval.sequence; if(at<"type"_>(event) == "m.room.create")