Vine/Server/Notification/
OutputReplace.rs1use serde_json::{Value, json};
6
7use crate::{Host::VineHost, dev_log};
8
9pub async fn OutputReplace(Host:&dyn VineHost, Parameter:&Value) {
10 let Channel = Parameter.get("channel").and_then(Value::as_str).unwrap_or("");
11
12 let Text = Parameter.get("text").and_then(Value::as_str).unwrap_or("");
13
14 Host.EmitToRenderer("sky://output/clear", json!({ "channel": Channel }));
15
16 Host.EmitToRenderer(
17 "sky://output/append",
18 json!({
19 "channel": Channel,
20 "text": Text,
21 }),
22 );
23
24 dev_log!("grpc", "[Output] replace channel={} bytes={}", Channel, Text.len());
25}