diff options
author | Paul Fariello <paul@fariello.eu> | 2019-03-13 18:04:45 +0140 |
---|---|---|
committer | Paul Fariello <paul@fariello.eu> | 2019-04-10 17:12:31 +0200 |
commit | dbf96dcfc62d5bbfb1770a78a945d9822204d93f (patch) | |
tree | b783360cc74640bd8a65006a5f3cce18780b3a6c /src | |
parent | 063a5d1c52862065a62b07ec96ca3cde2b4d2955 (diff) | |
download | profani-tty-dbf96dcfc62d5bbfb1770a78a945d9822204d93f.tar.gz |
Allow to trust own device id
Diffstat (limited to 'src')
-rw-r--r-- | src/command/cmd_funcs.c | 3 | ||||
-rw-r--r-- | src/omemo/omemo.c | 9 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 63c3df1b..ba55243c 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -8049,7 +8049,8 @@ cmd_omemo_trust(ProfWin *window, const char *const command, gchar **args) assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK); barejid = chatwin->barejid; } else { - char *contact = args[2]; + fingerprint = args[2]; + char *contact = args[1]; barejid = roster_barejid_from_name(contact); if (barejid == NULL) { barejid = contact; diff --git a/src/omemo/omemo.c b/src/omemo/omemo.c index 3cae3315..b45e1834 100644 --- a/src/omemo/omemo.c +++ b/src/omemo/omemo.c @@ -440,6 +440,15 @@ omemo_start_device_session(const char *const jid, uint32_t device_id, gboolean trusted = is_trusted_identity(&address, (uint8_t *)identity_key_raw, identity_key_len, &omemo_ctx.identity_key_store); + xmpp_ctx_t * const ctx = connection_get_ctx(); + char *ownjid = xmpp_jid_bare(ctx, session_get_account_name()); + if (g_strcmp0(jid, ownjid) == 0) { + char *fingerprint = omemo_fingerprint(identity_key, TRUE); + + cons_show("Available device identity: %s%s", fingerprint, trusted ? " (trusted)" : ""); + free(fingerprint); + } + ProfChatWin *chatwin = wins_get_chat(jid); if (chatwin) { char *fingerprint = omemo_fingerprint(identity_key, TRUE); |