mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 05:16:28 +03:00
Add check_qr function to jsonrpc
This commit is contained in:
@@ -22,6 +22,7 @@ pub mod events;
|
||||
pub mod types;
|
||||
|
||||
use crate::api::types::chat_list::{get_chat_list_item_by_id, ChatListItemFetchResult};
|
||||
use crate::api::types::QrObject;
|
||||
|
||||
use types::account::Account;
|
||||
use types::chat::FullChat;
|
||||
@@ -202,6 +203,14 @@ impl CommandApi {
|
||||
qr::set_config_from_qr(&ctx, &qr_content).await
|
||||
}
|
||||
|
||||
async fn check_qr(&self, account_id: u32, qr_content: String) -> Result<QrObject> {
|
||||
println!("HELLO FROM CHECK_QR");
|
||||
let ctx = self.get_context(account_id).await?;
|
||||
let qr = qr::check_qr(&ctx, &qr_content).await?;
|
||||
let qr_object = QrObject::from(qr);
|
||||
Ok(qr_object)
|
||||
}
|
||||
|
||||
async fn get_config(&self, account_id: u32, key: String) -> Result<Option<String>> {
|
||||
let ctx = self.get_context(account_id).await?;
|
||||
get_config(&ctx, &key).await
|
||||
|
||||
Reference in New Issue
Block a user