Skip to content

Commit 7520628

Browse files
committed
Add DC_STR_CONTACT stock string
1 parent 68b9582 commit 7520628

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

deltachat-ffi/deltachat.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7764,6 +7764,11 @@ void dc_event_unref(dc_event_t* event);
77647764
/// Used as the first info messages in newly created classic email threads.
77657765
#define DC_STR_CHAT_UNENCRYPTED_EXPLANATON 230
77667766

7767+
/// "Contact"
7768+
///
7769+
/// Used in summaries.
7770+
#define DC_STR_CONTACT 231
7771+
77677772
/**
77687773
* @}
77697774
*/

src/stock_str.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,9 @@ https://delta.chat/donate"))]
415415

416416
#[strum(props(fallback = "Messages in this chat use classic email and are not encrypted."))]
417417
ChatUnencryptedExplanation = 230,
418+
419+
#[strum(props(fallback = "Contact"))]
420+
Contact = 231,
418421
}
419422

420423
impl StockMessage {
@@ -882,6 +885,11 @@ pub(crate) async fn sticker(context: &Context) -> String {
882885
translated(context, StockMessage::Sticker).await
883886
}
884887

888+
/// Stock string: `Contact`.
889+
pub(crate) async fn contact(context: &Context) -> String {
890+
translated(context, StockMessage::Contact).await
891+
}
892+
885893
/// Stock string: `Device messages`.
886894
pub(crate) async fn device_messages(context: &Context) -> String {
887895
translated(context, StockMessage::DeviceMessages).await
@@ -1251,7 +1259,7 @@ impl Viewtype {
12511259
Viewtype::Video => video(context).await,
12521260
Viewtype::File => file(context).await,
12531261
Viewtype::Webxdc => "Mini App".to_owned(), // TODO stock-string
1254-
Viewtype::Vcard => "Contact".to_owned(), // TODO stock-string
1262+
Viewtype::Vcard => contact(context).await,
12551263
// OPTIONAL TODO - would not be used right now,
12561264
// because this method is only used for metadata on large attachments
12571265
Viewtype::Unknown | Viewtype::Text | Viewtype::Call => self.to_string(),

0 commit comments

Comments
 (0)