diff --git a/assets/icon-device.png b/assets/icon-device.png new file mode 100644 index 000000000..ff2d545bf Binary files /dev/null and b/assets/icon-device.png differ diff --git a/src/chat.rs b/src/chat.rs index d21f4333e..92ae61d55 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -592,6 +592,12 @@ pub fn set_blocking(context: &Context, chat_id: u32, new_blocking: Blocked) -> b .is_ok() } +fn copy_device_icon_to_blobs(context: &Context) -> Result { + let icon = include_bytes!("../assets/icon-device.png"); + let blob = BlobObject::create(context, "icon-device.png".to_string(), icon)?; + Ok(blob.as_name().to_string()) +} + pub fn create_or_lookup_by_contact_id( context: &Context, contact_id: u32, @@ -616,9 +622,12 @@ pub fn create_or_lookup_by_contact_id( 100, chat_name, match contact_id { - DC_CONTACT_ID_SELF => "K=1", // K = Param::Selftalk - DC_CONTACT_ID_DEVICE => "D=1", // K = Param::Devicetalk - _ => "" + DC_CONTACT_ID_SELF => "K=1".to_string(), // K = Param::Selftalk + DC_CONTACT_ID_DEVICE => { + let icon = copy_device_icon_to_blobs(context)?; + format!("D=1\ni={}", icon) // D = Param::Devicetalk, i = Param::ProfileImage + }, + _ => "".to_string() }, create_blocked as u8, contact.get_addr(),