# HG changeset patch # User Jonas Schäfer # Date 1611242294 -3600 # Node ID 83370df0ce4af6a86697f17f8ad571926f85cd07 # Parent f975a4d31f35c282989f400d200bec5e5592cf98 mod_http_admin_api: do not report OMEMO as ok if no devices exist diff -r f975a4d31f35 -r 83370df0ce4a mod_http_admin_api/mod_http_admin_api.lua --- a/mod_http_admin_api/mod_http_admin_api.lua Thu Jan 21 16:13:29 2021 +0100 +++ b/mod_http_admin_api/mod_http_admin_api.lua Thu Jan 21 16:18:14 2021 +0100 @@ -202,6 +202,7 @@ local function get_user_omemo_info(username) local everything_valid = true; + local any_device = false; local omemo_status = {}; local omemo_devices; local pep_service = mod_pep.get_pep_service(username); @@ -213,6 +214,7 @@ if device_list then omemo_devices = {}; for device_entry in device_list:childtags("device") do + any_device = true; local device_info = {}; local device_id = tonumber(device_entry.attr.id or ""); if device_id then @@ -256,7 +258,7 @@ end end end - omemo_status.valid = everything_valid; + omemo_status.valid = everything_valid and any_device; return { status = omemo_status; devices = omemo_devices;