File tree Expand file tree Collapse file tree 1 file changed +25
-7
lines changed Expand file tree Collapse file tree 1 file changed +25
-7
lines changed Original file line number Diff line number Diff line change @@ -394,13 +394,31 @@ async fn get_to_and_past_contact_ids(
394
394
// This is an encrypted 1:1 chat.
395
395
to_ids = pgp_to_ids
396
396
} else if let Some ( chat_id) = chat_id {
397
- to_ids = lookup_key_contacts_by_address_list (
398
- context,
399
- & mime_parser. recipients ,
400
- to_member_fingerprints,
401
- Some ( chat_id) ,
402
- )
403
- . await ?;
397
+ to_ids = match mime_parser. was_encrypted ( ) {
398
+ true => {
399
+ lookup_key_contacts_by_address_list (
400
+ context,
401
+ & mime_parser. recipients ,
402
+ to_member_fingerprints,
403
+ Some ( chat_id) ,
404
+ )
405
+ . await ?
406
+ }
407
+ false => {
408
+ add_or_lookup_contacts_by_address_list (
409
+ context,
410
+ & mime_parser. recipients ,
411
+ if !mime_parser. incoming {
412
+ Origin :: OutgoingTo
413
+ } else if incoming_origin. is_known ( ) {
414
+ Origin :: IncomingTo
415
+ } else {
416
+ Origin :: IncomingUnknownTo
417
+ } ,
418
+ )
419
+ . await ?
420
+ }
421
+ }
404
422
} else {
405
423
let ids = match mime_parser. was_encrypted ( ) {
406
424
true => {
You can’t perform that action at this time.
0 commit comments