1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-16 21:35:24 +00:00

Merge pull request #1576 from DebXWoody/autocomplete-untrust

OMEMO autocomplete untrust
This commit is contained in:
Michael Vetter 2021-07-12 09:20:21 +02:00 committed by GitHub
commit 73571f0aa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2595,6 +2595,33 @@ _omemo_autocomplete(ProfWin* window, const char* const input, gboolean previous)
}
}
}
if (window->type == WIN_CHAT) {
ProfChatWin* chatwin = (ProfChatWin*)window;
assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK);
found = autocomplete_param_with_func(input, "/omemo untrust", omemo_fingerprint_autocomplete, previous, chatwin->barejid);
if (found) {
return found;
}
} else {
found = autocomplete_param_with_func(input, "/omemo untrust", roster_contact_autocomplete, previous, NULL);
if (found) {
return found;
}
int num_tokens = count_tokens(input);
if (num_tokens == 4) {
gboolean result;
gchar** args = parse_args(input, 2, 3, &result);
if (result) {
gchar* jid = g_strdup(args[1]);
found = autocomplete_param_no_with_func(input, "/omemo untrust", 4, omemo_fingerprint_autocomplete, previous, jid);
if (found) {
return found;
}
}
}
}
}
found = autocomplete_param_with_ac(input, "/omemo", omemo_ac, TRUE, previous);