From d40960bcfd83ae334d2d5494a34c7dec6754fd4c Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Mon, 4 Jul 2022 12:45:48 +0200 Subject: [PATCH] show webxdc information in repl tool --- examples/repl/cmdline.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/examples/repl/cmdline.rs b/examples/repl/cmdline.rs index aaff0ba66..ef4397e15 100644 --- a/examples/repl/cmdline.rs +++ b/examples/repl/cmdline.rs @@ -215,6 +215,14 @@ async fn log_msg(context: &Context, prefix: impl AsRef, msg: &Message) { msg.get_videochat_url().unwrap_or_default(), msg.get_videochat_type().unwrap_or_default() ) + } else if msg.get_viewtype() == Viewtype::Webxdc { + match msg.get_webxdc_info(context).await { + Ok(info) => format!( + "[WEBXDC: {}, icon={}, document={}, summary={}, source_code_url={}]", + info.name, info.icon, info.document, info.summary, info.source_code_url + ), + Err(err) => format!("[get_webxdc_info() failed: {}]", err), + } } else { "".to_string() },