mirror of
https://github.com/chatmail/core.git
synced 2026-05-04 22:06:29 +03:00
fix(jsonrpc): Use Core's logic for computing VcardContact.color (#7294)
Before, the color was computed from the address, but as we've switched to fingerprint-based contact colors, this logic became stale. Now `deltachat::contact::get_color()` is used. A test would be nice to have, but as now all the logic is in Core, this isn't critical as there are Core tests at least.
This commit is contained in:
@@ -25,7 +25,7 @@ use crate::tools::{self, time_elapsed};
|
||||
/// This trait is implemented for rPGP's [SignedPublicKey] and
|
||||
/// [SignedSecretKey] types and makes working with them a little
|
||||
/// easier in the deltachat world.
|
||||
pub(crate) trait DcKey: Serialize + Deserializable + Clone {
|
||||
pub trait DcKey: Serialize + Deserializable + Clone {
|
||||
/// Create a key from some bytes.
|
||||
fn from_slice(bytes: &[u8]) -> Result<Self> {
|
||||
let res = <Self as Deserializable>::from_bytes(Cursor::new(bytes));
|
||||
@@ -112,7 +112,10 @@ pub(crate) trait DcKey: Serialize + Deserializable + Clone {
|
||||
/// The fingerprint for the key.
|
||||
fn dc_fingerprint(&self) -> Fingerprint;
|
||||
|
||||
/// Whether the key is private (or public).
|
||||
fn is_private() -> bool;
|
||||
|
||||
/// Returns the OpenPGP Key ID.
|
||||
fn key_id(&self) -> KeyId;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user