Fixed issue with /otr myfp when no key loaded

This commit is contained in:
James Booth
2014-02-23 20:34:27 +00:00
parent d25245a286
commit 18e0884f5f
6 changed files with 40 additions and 3 deletions

View File

@@ -2618,9 +2618,13 @@ cmd_otr(gchar **args, struct cmd_help_t help)
otr_keygen(account);
return TRUE;
} else if (strcmp(args[0], "myfp") == 0) {
char *fingerprint = otr_get_my_fingerprint();
ui_current_print_formatted_line('!', 0, "Your OTR fingerprint: %s", fingerprint);
free(fingerprint);
if (!otr_key_loaded()) {
ui_current_print_formatted_line('!', 0, "You have not generated or loaded a private key, use '/otr gen'");
} else {
char *fingerprint = otr_get_my_fingerprint();
ui_current_print_formatted_line('!', 0, "Your OTR fingerprint: %s", fingerprint);
free(fingerprint);
}
return TRUE;
} else if (strcmp(args[0], "theirfp") == 0) {
win_type_t win_type = ui_current_win_type();