From b5a54aa6cf9228bb642b0e44b802c9322e3defbb Mon Sep 17 00:00:00 2001 From: Hocuri Date: Fri, 5 Sep 2025 21:46:26 +0200 Subject: [PATCH] fix: Scaleup contact on securejoin, send more events, use correct create_blocked --- src/chat.rs | 2 ++ src/receive_imf.rs | 17 +++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/chat.rs b/src/chat.rs index 6fc97488f..a6e325bca 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -5195,6 +5195,8 @@ impl Context { return contact::set_blocked(self, Nosync, contact_id, false).await; } SyncAction::MarkVerified => { + ContactId::scaleup_origin(self, &[contact_id], Origin::SecurejoinJoined) + .await?; return contact::mark_contact_id_as_verified( self, contact_id, diff --git a/src/receive_imf.rs b/src/receive_imf.rs index 2d15bda90..cacadb218 100644 --- a/src/receive_imf.rs +++ b/src/receive_imf.rs @@ -1385,6 +1385,7 @@ async fn do_chat_assignment( create_or_lookup_mailinglist_or_broadcast( context, allow_creation, + create_blocked, mailinglist_header, from_id, mime_parser, @@ -3265,6 +3266,7 @@ fn mailinglist_header_listid(list_id_header: &str) -> Result { async fn create_or_lookup_mailinglist_or_broadcast( context: &Context, allow_creation: bool, + create_blocked: Blocked, list_id_header: &str, from_id: ContactId, mime_parser: &MimeMessage, @@ -3297,18 +3299,12 @@ async fn create_or_lookup_mailinglist_or_broadcast( p.to_string() }); - let is_bot = context.get_config_bool(Config::Bot).await?; - let blocked = if is_bot { - Blocked::Not - } else { - Blocked::Request - }; let chat_id = ChatId::create_multiuser_record( context, chattype, &listid, name, - blocked, + create_blocked, ProtectionStatus::Unprotected, param, mime_parser.timestamp_sent, @@ -3330,7 +3326,12 @@ async fn create_or_lookup_mailinglist_or_broadcast( ) .await?; } - Ok(Some((chat_id, blocked))) + + context.emit_event(EventType::ChatModified(chat_id)); + chatlist_events::emit_chatlist_changed(context); + chatlist_events::emit_chatlist_item_changed(context, chat_id); + + Ok(Some((chat_id, create_blocked))) } else { info!(context, "Creating list forbidden by caller."); Ok(None)