diff --git a/include/ircd/m/txn.h b/include/ircd/m/txn.h index 51a6bd875..8a68db45c 100644 --- a/include/ircd/m/txn.h +++ b/include/ircd/m/txn.h @@ -28,7 +28,7 @@ struct ircd::m::txn json::property > { - using array = std::pair; + using array = vector_view; static string_view create_id(const mutable_buffer &out, const string_view &txn); static std::string create(const array &pdu, const array &edu, const array &pdu_failure = {}); diff --git a/ircd/m/m.cc b/ircd/m/m.cc index 8072ffc1b..c8b72efe3 100644 --- a/ircd/m/m.cc +++ b/ircd/m/m.cc @@ -1193,25 +1193,25 @@ ircd::m::txn::create(const array &pdu, const json::iov::add_if _pdus { - iov, pdu.second, + iov, !empty(pdu), { - "pdus", { pdu.first, pdu.second } + "pdus", { data(pdu), size(pdu) } } }; const json::iov::add_if _edus { - iov, edu.second, + iov, !empty(edu), { - "edus", { edu.first, edu.second } + "edus", { data(edu), size(edu) } } }; const json::iov::add_if _pdu_failures { - iov, pdu_failure.second, + iov, !empty(pdu_failure), { - "pdu_failures", { pdu_failure.first, pdu_failure.second } + "pdu_failures", { data(pdu_failure), size(pdu_failure) } } }; @@ -1403,7 +1403,6 @@ const return true; } - // // hook::site //