File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -1340,7 +1340,11 @@ impl ChatId {
1340
1340
let fingerprint = contact
1341
1341
. fingerprint ( )
1342
1342
. context ( "Contact does not have a fingerprint in encrypted chat" ) ?;
1343
- ret += & format ! ( "\n {addr}\n {fingerprint}\n " ) ;
1343
+ if contact. public_key ( context) . await ?. is_some ( ) {
1344
+ ret += & format ! ( "\n {addr}\n {fingerprint}\n " ) ;
1345
+ } else {
1346
+ ret += & format ! ( "\n {addr}\n (key missing)\n {fingerprint}\n " ) ;
1347
+ }
1344
1348
}
1345
1349
1346
1350
Ok ( ret. trim ( ) . to_string ( ) )
Original file line number Diff line number Diff line change @@ -2765,6 +2765,22 @@ async fn test_chat_get_encryption_info() -> Result<()> {
2765
2765
"No encryption"
2766
2766
) ;
2767
2767
2768
+ alice. sql . execute ( "DELETE FROM public_keys" , ( ) ) . await ?;
2769
+ assert_eq ! (
2770
+ chat_id. get_encryption_info( alice) . await ?,
2771
+ "End-to-end encryption available\n \
2772
+ \n \
2773
+ fiona@example.net\n \
2774
+ (key missing)\n \
2775
+ C8BA 50BF 4AC1 2FAF 38D7\n \
2776
+ F657 DDFC 8E9F 3C79 9195\n \
2777
+ \n \
2778
+ bob@example.net\n \
2779
+ (key missing)\n \
2780
+ CCCB 5AA9 F6E1 141C 9431\n \
2781
+ 65F1 DB18 B18C BCF7 0487"
2782
+ ) ;
2783
+
2768
2784
Ok ( ( ) )
2769
2785
}
2770
2786
You can’t perform that action at this time.
0 commit comments