Unlike get and insert, there is no need for an addres parameter that
needs to be normalized, since the address is already in the peer
object.
goto cleanup;
if (update_db &&
- mutt_autocrypt_db_peer_update (env->from, peer))
+ mutt_autocrypt_db_peer_update (peer))
goto cleanup;
if (insert_db_history)
goto cleanup;
if (update_db &&
- mutt_autocrypt_db_peer_update (peer_addr, peer))
+ mutt_autocrypt_db_peer_update (peer))
goto cleanup;
if (insert_db_history)
return rv;
}
-int mutt_autocrypt_db_peer_update (ADDRESS *addr, AUTOCRYPT_PEER *peer)
+int mutt_autocrypt_db_peer_update (AUTOCRYPT_PEER *peer)
{
int rv = -1;
- ADDRESS *norm_addr = NULL;
-
- norm_addr = copy_normalize_addr (addr);
if (!PeerUpdateStmt)
{
goto cleanup;
if (sqlite3_bind_text (PeerUpdateStmt,
9,
- norm_addr->mailbox,
+ peer->email_addr,
-1,
SQLITE_STATIC) != SQLITE_OK)
goto cleanup;
rv = 0;
cleanup:
- rfc822_free_address (&norm_addr);
sqlite3_reset (PeerUpdateStmt);
return rv;
}
void mutt_autocrypt_db_peer_free (AUTOCRYPT_PEER **peer);
int mutt_autocrypt_db_peer_get (ADDRESS *addr, AUTOCRYPT_PEER **peer);
int mutt_autocrypt_db_peer_insert (ADDRESS *addr, AUTOCRYPT_PEER *peer);
-int mutt_autocrypt_db_peer_update (ADDRESS *addr, AUTOCRYPT_PEER *peer);
+int mutt_autocrypt_db_peer_update (AUTOCRYPT_PEER *peer);
AUTOCRYPT_PEER_HISTORY *mutt_autocrypt_db_peer_history_new (void);
void mutt_autocrypt_db_peer_history_free (AUTOCRYPT_PEER_HISTORY **peerhist);