if (insert_db && mutt_autocrypt_db_peer_insert(from, peer))
goto cleanup;
- if (update_db && mutt_autocrypt_db_peer_update(from, peer))
+ if (update_db && mutt_autocrypt_db_peer_update(peer))
goto cleanup;
if (insert_db_history)
if (insert_db && mutt_autocrypt_db_peer_insert(peer_addr, peer))
goto cleanup;
- if (update_db && mutt_autocrypt_db_peer_update(peer_addr, peer))
+ if (update_db && mutt_autocrypt_db_peer_update(peer))
goto cleanup;
if (insert_db_history)
return rv;
}
-int mutt_autocrypt_db_peer_update(struct Address *addr, struct AutocryptPeer *peer)
+int mutt_autocrypt_db_peer_update(struct AutocryptPeer *peer)
{
int rv = -1;
- struct Address *norm_addr = NULL;
-
- norm_addr = copy_normalize_addr(addr);
if (!PeerUpdateStmt)
{
goto cleanup;
if (sqlite3_bind_text(PeerUpdateStmt, 8, peer->gossip_keydata, -1, SQLITE_STATIC) != SQLITE_OK)
goto cleanup;
- if (sqlite3_bind_text(PeerUpdateStmt, 9, norm_addr->mailbox, -1, SQLITE_STATIC) != SQLITE_OK)
+ if (sqlite3_bind_text(PeerUpdateStmt, 9, peer->email_addr, -1, SQLITE_STATIC) != SQLITE_OK)
goto cleanup;
if (sqlite3_step(PeerUpdateStmt) != SQLITE_DONE)
rv = 0;
cleanup:
- mutt_addr_free(&norm_addr);
sqlite3_reset(PeerUpdateStmt);
return rv;
}
void mutt_autocrypt_db_peer_free (struct AutocryptPeer **peer);
int mutt_autocrypt_db_peer_get (struct Address *addr, struct AutocryptPeer **peer);
int mutt_autocrypt_db_peer_insert (struct Address *addr, struct AutocryptPeer *peer);
-int mutt_autocrypt_db_peer_update (struct Address *addr, struct AutocryptPeer *peer);
+int mutt_autocrypt_db_peer_update (struct AutocryptPeer *peer);
struct AutocryptPeerHistory *mutt_autocrypt_db_peer_history_new (void);
void mutt_autocrypt_db_peer_history_free (struct AutocryptPeerHistory **peerhist);