diff --git a/deltachat-repl/src/cmdline.rs b/deltachat-repl/src/cmdline.rs index feee46bd4..2ead64b6e 100644 --- a/deltachat-repl/src/cmdline.rs +++ b/deltachat-repl/src/cmdline.rs @@ -19,6 +19,7 @@ use deltachat::location; use deltachat::log::LogExt; use deltachat::message::{self, Message, MessageState, MsgId, Viewtype}; use deltachat::mimeparser::SystemMessage; +use deltachat::peer_channels::{send_webxdc_realtime_advertisement, send_webxdc_realtime_data}; use deltachat::peerstate::*; use deltachat::qr::*; 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!("{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" => { if sel_chat.is_none() && arg1.is_empty() { bail!("Argument [chat-id] is missing."); diff --git a/src/context.rs b/src/context.rs index 56dc5df56..2fdc7fd87 100644 --- a/src/context.rs +++ b/src/context.rs @@ -457,7 +457,7 @@ impl Context { }; 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( EnvFilter::builder()