Skip to content

Commit 159068c

Browse files
r10sHocuri
andauthored
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>
1 parent f8841a8 commit 159068c

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/stock_str.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,20 +1340,19 @@ pub(crate) async fn new_group_send_first_message(context: &Context) -> String {
13401340

13411341
/// Text to put in the [`Qr::Backup2`] rendered SVG image.
13421342
///
1343-
/// The default is "Scan to set up second device for <account name (account addr)>". The
1344-
/// account name and address are looked up from the context.
1343+
/// The default is "Scan to set up second device for NAME".
1344+
/// The account name (or address as fallback) are looked up from the context.
13451345
///
13461346
/// [`Qr::Backup2`]: crate::qr::Qr::Backup2
13471347
pub(crate) async fn backup_transfer_qr(context: &Context) -> Result<String> {
1348-
let contact = Contact::get_by_id(context, ContactId::SELF).await?;
1349-
let addr = contact.get_addr();
1350-
let full_name = match context.get_config(Config::Displayname).await? {
1351-
Some(name) if name != addr => format!("{name} ({addr})"),
1352-
_ => addr.to_string(),
1348+
let name = if let Some(name) = context.get_config(Config::Displayname).await? {
1349+
name
1350+
} else {
1351+
context.get_primary_self_addr().await?
13531352
};
13541353
Ok(translated(context, StockMessage::BackupTransferQr)
13551354
.await
1356-
.replace1(&full_name))
1355+
.replace1(&name))
13571356
}
13581357

13591358
pub(crate) async fn backup_transfer_msg_body(context: &Context) -> String {

0 commit comments

Comments
 (0)