fix: add missing omemo_is_jid_trusted(), auto_gerror macro, and titlebar variable declarations
Some checks failed
CI Code / Check coding style (pull_request) Failing after 12s
CI Code / Check spelling (pull_request) Successful in 23s
CI Code / Linux (debian) (pull_request) Failing after 5m42s
CI Code / Linux (ubuntu) (pull_request) Failing after 6m3s
CI Code / Code Coverage (pull_request) Successful in 7m2s
CI Code / Linux (arch) (pull_request) Failing after 8m20s
Some checks failed
CI Code / Check coding style (pull_request) Failing after 12s
CI Code / Check spelling (pull_request) Successful in 23s
CI Code / Linux (debian) (pull_request) Failing after 5m42s
CI Code / Linux (ubuntu) (pull_request) Failing after 6m3s
CI Code / Code Coverage (pull_request) Successful in 7m2s
CI Code / Linux (arch) (pull_request) Failing after 8m20s
Fixes build errors from cherry-picked upstream patches: - Add omemo_is_jid_trusted() function (from upstream trust indicator feature) - Add auto_gerror/PROF_GERROR_MESSAGE macros (needed by /changes command) - Add trusted_attrs/untrusted_attrs declarations in _show_muc_privacy() - Remove stale 'error' reference in omemo_receive_message()
This commit is contained in:
@@ -1136,6 +1136,53 @@ omemo_is_trusted_identity(const char* const jid, const char* const fingerprint)
|
||||
return trusted;
|
||||
}
|
||||
|
||||
gboolean
|
||||
omemo_is_jid_trusted(const char* const jid)
|
||||
{
|
||||
if (!omemo_loaded()) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
GList* device_list = g_hash_table_lookup(omemo_ctx.device_list, jid);
|
||||
if (!device_list) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
GList* device_id_iter;
|
||||
for (device_id_iter = device_list; device_id_iter != NULL; device_id_iter = device_id_iter->next) {
|
||||
uint32_t device_id = GPOINTER_TO_UINT(device_id_iter->data);
|
||||
if (device_id == omemo_ctx.device_id && equals_our_barejid(jid)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
GHashTable* known_identities = g_hash_table_lookup(omemo_ctx.known_devices, jid);
|
||||
if (!known_identities) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean found = FALSE;
|
||||
GList* fp_list = g_hash_table_get_keys(known_identities);
|
||||
GList* fp_iter;
|
||||
for (fp_iter = fp_list; fp_iter != NULL; fp_iter = fp_iter->next) {
|
||||
if (device_id == GPOINTER_TO_UINT(g_hash_table_lookup(known_identities, fp_iter->data))) {
|
||||
if (!omemo_is_trusted_identity(jid, fp_iter->data)) {
|
||||
g_list_free(fp_list);
|
||||
return FALSE;
|
||||
}
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
g_list_free(fp_list);
|
||||
|
||||
if (!found) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static char*
|
||||
_omemo_fingerprint(ec_public_key* identity, gboolean formatted)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user