From b7d8f9c2116c2b0c76a1f5d78195d85f2eccb0e1 Mon Sep 17 00:00:00 2001 From: Jason Volk <jason@zemos.net> Date: Mon, 11 May 2020 02:10:54 -0700 Subject: [PATCH] modules/client/room_keys/version: Throw coded 404 for no version found. --- modules/client/room_keys/version.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/modules/client/room_keys/version.cc b/modules/client/room_keys/version.cc index 46f3d1f29..823e61e63 100644 --- a/modules/client/room_keys/version.cc +++ b/modules/client/room_keys/version.cc @@ -238,12 +238,9 @@ ircd::m::get_room_keys_version(client &client, } if(!event_idx) - return resource::response + throw m::NOT_FOUND { - client, json::members - { - { "version", 0L }, - } + "No version found.", }; if(m::room_id(event_idx) != user_room.room_id) @@ -254,9 +251,9 @@ ircd::m::get_room_keys_version(client &client, }; if(m::redacted(event_idx)) - return resource::response + throw m::NOT_FOUND { - client, http::NOT_FOUND + "No version found.", }; m::get(event_idx, "content", [&client, &event_idx]