comparison mod_debug_omemo/mod_debug_omemo.lua @ 4687:41ddb782320c

mod_debug_omemo: Improve no keys/devices cases
author Matthew Wild <mwild1@gmail.com>
date Mon, 13 Sep 2021 21:10:50 +0100
parents 76af816739f3
children ecfffbbcbf42
comparison
equal deleted inserted replaced
4686:76af816739f3 4687:41ddb782320c
157 157
158 data.message = { 158 data.message = {
159 type = message.attr.type or "normal"; 159 type = message.attr.type or "normal";
160 direction = direction; 160 direction = direction;
161 encryption = is_encrypted and "encrypted" or "unencrypted"; 161 encryption = is_encrypted and "encrypted" or "unencrypted";
162 has_any_keys = not message_rids:empty();
163 has_no_keys = message_rids:empty();
162 }; 164 };
163 165
164 data.omemo = { 166 data.omemo = {
165 sender_id = sender_id; 167 sender_id = sender_id;
166 status = user_omemo_status.status.valid and "no known issues" or "problems"; 168 status = user_omemo_status.status.valid and "no known issues" or "problems";
174 bundle = device_info.have_bundle and "Published" or "Missing"; 176 bundle = device_info.have_bundle and "Published" or "Missing";
175 access_model = access_model_text[device_info.bundle_config and device_info.bundle_config.access_model or nil]; 177 access_model = access_model_text[device_info.bundle_config and device_info.bundle_config.access_model or nil];
176 }; 178 };
177 end 179 end
178 else 180 else
179 data.omemo.devices[false] = { status = "No devices", }; 181 data.omemo.devices[false] = { status = "No devices have published OMEMO keys on this account" };
180 end 182 end
181 183
182 event.response.headers.content_type = "text/html; charset=utf-8"; 184 event.response.headers.content_type = "text/html; charset=utf-8";
183 return render_html_template(tpl, data); 185 return render_html_template(tpl, data);
184 end 186 end