Add AEAP device message (#3505)

This commit is contained in:
Hocuri
2022-07-15 16:16:12 +02:00
committed by GitHub
parent 9926804f1b
commit 5f779ca9b2
4 changed files with 86 additions and 26 deletions

View File

@@ -335,6 +335,11 @@ pub enum StockMessage {
#[strum(props(fallback = "%1$s changed their address from %2$s to %3$s"))]
AeapAddrChanged = 122,
#[strum(props(
fallback = "You changed your email address from %1$s to %2$s.\n\nIf you now send a message to a group, contacts there will automatically replace the old with your new address.\n\nIt's highly advised to set up your old email provider to forward all emails to your new email address. Otherwise you might miss messages of contacts who did not get your new address yet."
))]
AeapExplanationAndLink = 123,
}
impl StockMessage {
@@ -1104,6 +1109,17 @@ pub(crate) async fn aeap_addr_changed(
.replace3(new_addr)
}
pub(crate) async fn aeap_explanation_and_link(
context: &Context,
old_addr: impl AsRef<str>,
new_addr: impl AsRef<str>,
) -> String {
translated(context, StockMessage::AeapExplanationAndLink)
.await
.replace1(old_addr)
.replace2(new_addr)
}
impl Context {
/// Set the stock string for the [StockMessage].
///