mirror of
https://github.com/chatmail/core.git
synced 2026-09-22 13:01:21 +03:00
feat: stop creating info messages for old broadcast lists
Creating QR code or sending a message will still fail with a shorter error, but no info message will be created anymore. Most users should have migrated the channels by recreating them by now. This change is needed for moving loading of the shared secret to earlier stages of message preparation, otherwise mimefactory will have to create these info messages when loading the message into memory.
This commit is contained in:
@@ -4,13 +4,9 @@ use anyhow::{Context as _, Error, Result, bail, ensure};
|
||||
use deltachat_contact_tools::ContactAddress;
|
||||
use percent_encoding::{AsciiSet, utf8_percent_encode};
|
||||
|
||||
use crate::chat::{
|
||||
self, Chat, ChatId, ChatIdBlocked, add_info_msg, get_chat_id_by_grpid, load_broadcast_secret,
|
||||
};
|
||||
use crate::chat::{self, Chat, ChatId, ChatIdBlocked, get_chat_id_by_grpid, load_broadcast_secret};
|
||||
use crate::config::Config;
|
||||
use crate::constants::{
|
||||
BROADCAST_INCOMPATIBILITY_MSG, Blocked, Chattype, NON_ALPHANUMERIC_WITHOUT_DOT,
|
||||
};
|
||||
use crate::constants::{Blocked, Chattype, NON_ALPHANUMERIC_WITHOUT_DOT};
|
||||
use crate::contact::mark_contact_id_as_verified;
|
||||
use crate::contact::{Contact, ContactId, Origin};
|
||||
use crate::context::Context;
|
||||
@@ -111,14 +107,11 @@ pub async fn get_securejoin_qr(context: &Context, chat: Option<ChatId>) -> Resul
|
||||
// If the user created the broadcast before updating Delta Chat,
|
||||
// then the secret will be missing, and the user needs to recreate the broadcast:
|
||||
if load_broadcast_secret(context, chat.id).await?.is_none() {
|
||||
error!(
|
||||
context,
|
||||
"Not creating securejoin QR for old broadcast {}, see chat for more info.",
|
||||
chat.id,
|
||||
let err = format!(
|
||||
"Can't create QR code for old broadcast list {id} without a shared secret"
|
||||
);
|
||||
let text = BROADCAST_INCOMPATIBILITY_MSG;
|
||||
add_info_msg(context, chat.id, text).await?;
|
||||
bail!(text.to_string());
|
||||
error!(context, "get_securejoin_qr: {err}.");
|
||||
bail!(err);
|
||||
}
|
||||
}
|
||||
Some(chat)
|
||||
|
||||
Reference in New Issue
Block a user