Other: Mitigate double-unlock of user keyring

We need to unlock the user keyring anyway to unlock the address keyring,
so we should just return it instead of re-unlocking the user keyring
when sending a message.
This commit is contained in:
James Houlahan
2022-10-20 15:35:33 +02:00
parent 80d3f7d179
commit 81f4ef609b
9 changed files with 153 additions and 94 deletions

View File

@ -254,7 +254,7 @@ func (conn *imapConnector) CreateMessage(
imported []byte
)
if err := conn.withAddrKR(conn.addrID, func(addrKR *crypto.KeyRing) error {
if err := conn.withAddrKR(conn.addrID, func(_, addrKR *crypto.KeyRing) error {
res, err := stream.Collect(ctx, conn.client.ImportMessages(ctx, addrKR, 1, 1, []liteapi.ImportReq{{
Metadata: liteapi.ImportMetadata{
AddressID: conn.addrID,