more jsonrpc porting (#3645)

* Port setChatVisbility to jsonrpc

* jsonrpc add functions

- setChatEphemeralTimer
- getChatEphemeralTimer
and changelog

* add pr number to changelog

* jsonrpc: getLocations function

* Port imex() to jsonrpc

* autogenerate types

* jsonrpc: add `getAccountFileSize()`

* jsonrpc: `estimateAutodeleteCount`

* jsonrpc: setStockStrings

* Refactor imex into exportSelfKeys and importSelfKeys

* generate typings

* rustformat

* fix clippy

* update changelog

Co-authored-by: jikstra <jikstra@disroot.org>
This commit is contained in:
Simon Laux
2022-10-10 17:14:17 +02:00
committed by GitHub
parent 8b6290120e
commit 3fab9e4cec
11 changed files with 294 additions and 9 deletions

View File

@@ -26,7 +26,7 @@ pub struct Accounts {
///
/// This way changing a translation for one context automatically
/// changes it for all other contexts.
stockstrings: StockStrings,
pub(crate) stockstrings: StockStrings,
}
impl Accounts {

View File

@@ -8,6 +8,7 @@ use strum::EnumProperty as EnumPropertyTrait;
use strum_macros::EnumProperty;
use tokio::sync::RwLock;
use crate::accounts::Accounts;
use crate::blob::BlobObject;
use crate::chat::{self, Chat, ChatId, ProtectionStatus};
use crate::config::Config;
@@ -1302,6 +1303,17 @@ impl Context {
}
}
impl Accounts {
/// Set the stock string for the [StockMessage].
///
pub async fn set_stock_translation(&self, id: StockMessage, stockstring: String) -> Result<()> {
self.stockstrings
.set_stock_translation(id, stockstring)
.await?;
Ok(())
}
}
#[cfg(test)]
mod tests {
use num_traits::ToPrimitive;