mirror of
https://github.com/chatmail/core.git
synced 2026-05-09 01:46:30 +03:00
repl realtime
This commit is contained in:
@@ -19,6 +19,7 @@ use deltachat::location;
|
|||||||
use deltachat::log::LogExt;
|
use deltachat::log::LogExt;
|
||||||
use deltachat::message::{self, Message, MessageState, MsgId, Viewtype};
|
use deltachat::message::{self, Message, MessageState, MsgId, Viewtype};
|
||||||
use deltachat::mimeparser::SystemMessage;
|
use deltachat::mimeparser::SystemMessage;
|
||||||
|
use deltachat::peer_channels::{send_webxdc_realtime_advertisement, send_webxdc_realtime_data};
|
||||||
use deltachat::peerstate::*;
|
use deltachat::peerstate::*;
|
||||||
use deltachat::qr::*;
|
use deltachat::qr::*;
|
||||||
use deltachat::reaction::send_reaction;
|
use deltachat::reaction::send_reaction;
|
||||||
@@ -642,6 +643,30 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu
|
|||||||
println!("{cnt} chats");
|
println!("{cnt} chats");
|
||||||
println!("{time_needed:?} to create this list");
|
println!("{time_needed:?} to create this list");
|
||||||
}
|
}
|
||||||
|
"start-realtime" => {
|
||||||
|
if arg1.is_empty() {
|
||||||
|
bail!("missing msgid");
|
||||||
|
}
|
||||||
|
let msg_id = MsgId::new(arg1.parse()?);
|
||||||
|
let res = send_webxdc_realtime_advertisement(&context, msg_id).await?;
|
||||||
|
|
||||||
|
if let Some(res) = res {
|
||||||
|
println!("waiting for peer channel join");
|
||||||
|
res.await?;
|
||||||
|
}
|
||||||
|
println!("joined peer channel");
|
||||||
|
}
|
||||||
|
"send-realtime" => {
|
||||||
|
if arg1.is_empty() {
|
||||||
|
bail!("missing msgid");
|
||||||
|
}
|
||||||
|
if arg2.is_empty() {
|
||||||
|
bail!("no message");
|
||||||
|
}
|
||||||
|
let msg_id = MsgId::new(arg1.parse()?);
|
||||||
|
send_webxdc_realtime_data(&context, msg_id, arg2.as_bytes().to_vec()).await?;
|
||||||
|
println!("sent realtime message");
|
||||||
|
}
|
||||||
"chat" => {
|
"chat" => {
|
||||||
if sel_chat.is_none() && arg1.is_empty() {
|
if sel_chat.is_none() && arg1.is_empty() {
|
||||||
bail!("Argument [chat-id] is missing.");
|
bail!("Argument [chat-id] is missing.");
|
||||||
|
|||||||
@@ -457,7 +457,7 @@ impl Context {
|
|||||||
};
|
};
|
||||||
|
|
||||||
tracing_subscriber::registry()
|
tracing_subscriber::registry()
|
||||||
// .with(tracing_subscriber::fmt::layer().with_writer(std::io::stdout))
|
.with(tracing_subscriber::fmt::layer().with_writer(std::io::stdout))
|
||||||
.with(DeltaLayer(ctx.clone()))
|
.with(DeltaLayer(ctx.clone()))
|
||||||
.with(
|
.with(
|
||||||
EnvFilter::builder()
|
EnvFilter::builder()
|
||||||
|
|||||||
Reference in New Issue
Block a user