mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
feat: remove email address from 'add second device' qr code (#6760)
for tuning down email address everywhere, that bit is missing in core. it was never useful, as it was never shown on the receivers side. and for the sender side, the context the qr code is opened is clear --------- Co-authored-by: Hocuri <hocuri@gmx.de>
This commit is contained in:
@@ -1340,20 +1340,19 @@ pub(crate) async fn new_group_send_first_message(context: &Context) -> String {
|
||||
|
||||
/// Text to put in the [`Qr::Backup2`] rendered SVG image.
|
||||
///
|
||||
/// The default is "Scan to set up second device for <account name (account addr)>". The
|
||||
/// account name and address are looked up from the context.
|
||||
/// The default is "Scan to set up second device for NAME".
|
||||
/// The account name (or address as fallback) are looked up from the context.
|
||||
///
|
||||
/// [`Qr::Backup2`]: crate::qr::Qr::Backup2
|
||||
pub(crate) async fn backup_transfer_qr(context: &Context) -> Result<String> {
|
||||
let contact = Contact::get_by_id(context, ContactId::SELF).await?;
|
||||
let addr = contact.get_addr();
|
||||
let full_name = match context.get_config(Config::Displayname).await? {
|
||||
Some(name) if name != addr => format!("{name} ({addr})"),
|
||||
_ => addr.to_string(),
|
||||
let name = if let Some(name) = context.get_config(Config::Displayname).await? {
|
||||
name
|
||||
} else {
|
||||
context.get_primary_self_addr().await?
|
||||
};
|
||||
Ok(translated(context, StockMessage::BackupTransferQr)
|
||||
.await
|
||||
.replace1(&full_name))
|
||||
.replace1(&name))
|
||||
}
|
||||
|
||||
pub(crate) async fn backup_transfer_msg_body(context: &Context) -> String {
|
||||
|
||||
Reference in New Issue
Block a user