Improve formatting of ephemeral timer change messages

This adds support for more timer values and better fallback for unknown values.

For example, 90 seconds is formatted as "1.5 minutes".
This commit is contained in:
link2xt
2021-01-30 21:20:22 +03:00
committed by link2xt
parent b53415fed5
commit 93bd9422e7
3 changed files with 157 additions and 18 deletions

View File

@@ -5312,9 +5312,9 @@ void dc_event_unref(dc_event_t* event);
/// Used in status messages.
#define DC_STR_EPHEMERAL_WEEK 80
/// "Message deletion timer is set to 4 weeks."
/// DEPRECATED
///
/// Used in status messages.
/// DC_STR_EPHEMERAL_WEEKS is used instead.
#define DC_STR_EPHEMERAL_FOUR_WEEKS 81
/// "Video chat invitation"
@@ -5376,6 +5376,34 @@ void dc_event_unref(dc_event_t* event);
/// Used as device message text.
#define DC_STR_SERVER_TURNED_OFF 92
/// "Message deletion timer is set to %1$s minutes."
///
/// Used in status messages.
//
/// `%1$s` will be replaced by the number of minutes (alwasy >1) the timer is set to.
#define DC_STR_EPHEMERAL_MINUTES 93
/// "Message deletion timer is set to %1$s hours."
///
/// Used in status messages.
//
/// `%1$s` will be replaced by the number of hours (always >1) the timer is set to.
#define DC_STR_EPHEMERAL_HOURS 94
/// "Message deletion timer is set to %1$s days."
///
/// Used in status messages.
//
/// `%1$s` will be replaced by the number of days (always >1) the timer is set to.
#define DC_STR_EPHEMERAL_DAYS 95
/// "Message deletion timer is set to %1$s weeks."
///
/// Used in status messages.
//
/// `%1$s` will be replaced by the number of weeks (always >1) the timer is set to.
#define DC_STR_EPHEMERAL_WEEKS 96
/**
* @}
*/