diff --git a/src/chat.rs b/src/chat.rs index c98be6328..50debaada 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -97,6 +97,8 @@ impl Chat { if chat.param.exists(Param::Selftalk) { chat.name = context.stock_str(StockMessage::SelfMsg).into(); + } else if chat.param.exists(Param::Devicetalk) { + chat.name = context.stock_str(StockMessage::DeviceMessages).into(); } } } diff --git a/src/contact.rs b/src/contact.rs index f0c765c4c..e0d882128 100644 --- a/src/contact.rs +++ b/src/contact.rs @@ -153,7 +153,16 @@ impl Contact { blocked: false, origin: Origin::Unknown, }; - + return Ok(contact); + } else if contact_id == DC_CONTACT_ID_DEVICE { + let contact = Contact { + id: contact_id, + name: context.stock_str(StockMessage::DeviceMessages).into(), + authname: "".into(), + addr: "device@localhost".into(), + blocked: false, + origin: Origin::Unknown, + }; return Ok(contact); } diff --git a/src/stock.rs b/src/stock.rs index af24bac01..f5d27f0ed 100644 --- a/src/stock.rs +++ b/src/stock.rs @@ -110,6 +110,8 @@ pub enum StockMessage { Location = 66, #[strum(props(fallback = "Sticker"))] Sticker = 67, + #[strum(props(fallback = "Device Messages"))] + DeviceMessages = 68, } impl StockMessage {