From 1d58cd2266cfac220d910bfb17d36588e18c0850 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Mon, 6 Mar 2023 18:42:37 -0800 Subject: [PATCH] modules/federation/send_leave: Implement v2. --- modules/federation/send_leave.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/federation/send_leave.cc b/modules/federation/send_leave.cc index 14dcb485f..13d6ebf31 100644 --- a/modules/federation/send_leave.cc +++ b/modules/federation/send_leave.cc @@ -113,14 +113,22 @@ put__send_leave(client &client, event, vmopts }; - static const json::array &response + static const json::value responses[] { - "[200,{}]" + { "[200,{}]", json::ARRAY }, + { "{}", json::OBJECT }, + }; + + const json::value &response + { + request.version == "v1"? + responses[0]: + responses[1] }; return m::resource::response { - client, http::OK, response + client, response }; }