Skip to content

Commit 4f18be9

Browse files
committed
get contact- and chat-info for device-messages
1 parent c255db4 commit 4f18be9

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

src/chat.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ impl Chat {
9797

9898
if chat.param.exists(Param::Selftalk) {
9999
chat.name = context.stock_str(StockMessage::SelfMsg).into();
100+
} else if chat.param.exists(Param::Devicetalk) {
101+
chat.name = context.stock_str(StockMessage::DeviceMessages).into();
100102
}
101103
}
102104
}

src/contact.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,16 @@ impl Contact {
153153
blocked: false,
154154
origin: Origin::Unknown,
155155
};
156-
156+
return Ok(contact);
157+
} else if contact_id == DC_CONTACT_ID_DEVICE {
158+
let contact = Contact {
159+
id: contact_id,
160+
name: context.stock_str(StockMessage::DeviceMessages).into(),
161+
authname: "".into(),
162+
addr: "device@localhost".into(),
163+
blocked: false,
164+
origin: Origin::Unknown,
165+
};
157166
return Ok(contact);
158167
}
159168

src/stock.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ pub enum StockMessage {
110110
Location = 66,
111111
#[strum(props(fallback = "Sticker"))]
112112
Sticker = 67,
113+
#[strum(props(fallback = "Device Messages"))]
114+
DeviceMessages = 68,
113115
}
114116

115117
impl StockMessage {

0 commit comments

Comments
 (0)