mirror of
https://github.com/chatmail/core.git
synced 2026-05-05 06:16:30 +03:00
refactor: Make Fingerprint not implement Display (#8177)
Currently, the Fingerprint type implements Display, but this doesn't get you the canonical fingerprint representation, but something human-readable. This is confusing, and back when I first used `Fingerprint`, I immediately wrote a bug because of this. So, instead, make a function `human_readable()` on Fingerprint. This comes from the discussion at https://github.com/chatmail/core/pull/8174#discussion_r3143130722.
This commit is contained in:
@@ -1396,7 +1396,7 @@ WHERE addr=?
|
||||
let Some(fingerprint_other) = contact.fingerprint() else {
|
||||
return Ok(stock_str::encr_none(context));
|
||||
};
|
||||
let fingerprint_other = fingerprint_other.to_string();
|
||||
let fingerprint_other = fingerprint_other.human_readable();
|
||||
|
||||
let stock_message = if contact.public_key(context).await?.is_some() {
|
||||
stock_str::messages_are_e2ee(context)
|
||||
@@ -1410,7 +1410,7 @@ WHERE addr=?
|
||||
let fingerprint_self = load_self_public_key(context)
|
||||
.await?
|
||||
.dc_fingerprint()
|
||||
.to_string();
|
||||
.human_readable();
|
||||
if addr < contact.addr {
|
||||
cat_fingerprint(
|
||||
&mut ret,
|
||||
|
||||
Reference in New Issue
Block a user