mirror of
https://github.com/chatmail/core.git
synced 2026-04-27 02:16:29 +03:00
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:
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user