get contact- and chat-info for device-messages

This commit is contained in:
B. Petersen
2019-11-04 20:35:25 +01:00
committed by holger krekel
parent 89bb2d0ffe
commit f8afefa2c1
3 changed files with 14 additions and 1 deletions

View File

@@ -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();
}
}
}

View File

@@ -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);
}

View File

@@ -110,6 +110,8 @@ pub enum StockMessage {
Location = 66,
#[strum(props(fallback = "Sticker"))]
Sticker = 67,
#[strum(props(fallback = "Device Messages"))]
DeviceMessages = 68,
}
impl StockMessage {