diff --git a/deltachat-jsonrpc/src/api/mod.rs b/deltachat-jsonrpc/src/api/mod.rs index bd936406e9..71f97316d8 100644 --- a/deltachat-jsonrpc/src/api/mod.rs +++ b/deltachat-jsonrpc/src/api/mod.rs @@ -793,6 +793,19 @@ impl CommandApi { } Ok(contacts) } + + /// Get encryption info for a contact. + /// Get a multi-line encryption info, containing your fingerprint and the + /// fingerprint of the contact, used e.g. to compare the fingerprints for a simple out-of-band verification. + async fn get_contact_encryption_info( + &self, + account_id: u32, + contact_id: u32, + ) -> Result { + let ctx = self.get_context(account_id).await?; + Contact::get_encrinfo(&ctx, ContactId::new(contact_id)).await + } + // --------------------------------------------- // chat // --------------------------------------------- @@ -858,6 +871,20 @@ impl CommandApi { Ok(ctx.get_connectivity().await as u32) } + /// Get an overview of the current connectivity, and possibly more statistics. + /// Meant to give the user more insight about the current status than + /// the basic connectivity info returned by get_connectivity(); show this + /// e.g., if the user taps on said basic connectivity info. + /// + /// If this page changes, a #DC_EVENT_CONNECTIVITY_CHANGED will be emitted. + /// + /// This comes as an HTML from the core so that we can easily improve it + /// and the improvement instantly reaches all UIs. + async fn get_connectivity_html(&self, account_id: u32) -> Result { + let ctx = self.get_context(account_id).await?; + ctx.get_connectivity_html().await + } + // --------------------------------------------- // webxdc // --------------------------------------------- diff --git a/src/contact.rs b/src/contact.rs index 66b25b7cd8..079b015b0d 100644 --- a/src/contact.rs +++ b/src/contact.rs @@ -896,11 +896,8 @@ impl Contact { EncryptPreference::Reset => stock_str::encr_none(context).await, }; - ret += &format!( - "{}.\n{}:", - stock_message, - stock_str::finger_prints(context).await - ); + let finger_prints = stock_str::finger_prints(context).await; + ret += &format!("{}.\n{}:", stock_message, finger_prints); let fingerprint_self = SignedPublicKey::load_self(context) .await? diff --git a/src/scheduler/connectivity.rs b/src/scheduler/connectivity.rs index 4fe16c90ba..880c2760a6 100644 --- a/src/scheduler/connectivity.rs +++ b/src/scheduler/connectivity.rs @@ -390,7 +390,8 @@ impl Context { // ============================================================================================= let watched_folders = get_watched_folder_configs(self).await?; - ret += &format!("

{}