mirror of
https://github.com/chatmail/core.git
synced 2026-05-09 01:46:30 +03:00
fix: Scaleup contact on securejoin, send more events, use correct create_blocked
This commit is contained in:
@@ -5195,6 +5195,8 @@ impl Context {
|
|||||||
return contact::set_blocked(self, Nosync, contact_id, false).await;
|
return contact::set_blocked(self, Nosync, contact_id, false).await;
|
||||||
}
|
}
|
||||||
SyncAction::MarkVerified => {
|
SyncAction::MarkVerified => {
|
||||||
|
ContactId::scaleup_origin(self, &[contact_id], Origin::SecurejoinJoined)
|
||||||
|
.await?;
|
||||||
return contact::mark_contact_id_as_verified(
|
return contact::mark_contact_id_as_verified(
|
||||||
self,
|
self,
|
||||||
contact_id,
|
contact_id,
|
||||||
|
|||||||
@@ -1385,6 +1385,7 @@ async fn do_chat_assignment(
|
|||||||
create_or_lookup_mailinglist_or_broadcast(
|
create_or_lookup_mailinglist_or_broadcast(
|
||||||
context,
|
context,
|
||||||
allow_creation,
|
allow_creation,
|
||||||
|
create_blocked,
|
||||||
mailinglist_header,
|
mailinglist_header,
|
||||||
from_id,
|
from_id,
|
||||||
mime_parser,
|
mime_parser,
|
||||||
@@ -3265,6 +3266,7 @@ fn mailinglist_header_listid(list_id_header: &str) -> Result<String> {
|
|||||||
async fn create_or_lookup_mailinglist_or_broadcast(
|
async fn create_or_lookup_mailinglist_or_broadcast(
|
||||||
context: &Context,
|
context: &Context,
|
||||||
allow_creation: bool,
|
allow_creation: bool,
|
||||||
|
create_blocked: Blocked,
|
||||||
list_id_header: &str,
|
list_id_header: &str,
|
||||||
from_id: ContactId,
|
from_id: ContactId,
|
||||||
mime_parser: &MimeMessage,
|
mime_parser: &MimeMessage,
|
||||||
@@ -3297,18 +3299,12 @@ async fn create_or_lookup_mailinglist_or_broadcast(
|
|||||||
p.to_string()
|
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(
|
let chat_id = ChatId::create_multiuser_record(
|
||||||
context,
|
context,
|
||||||
chattype,
|
chattype,
|
||||||
&listid,
|
&listid,
|
||||||
name,
|
name,
|
||||||
blocked,
|
create_blocked,
|
||||||
ProtectionStatus::Unprotected,
|
ProtectionStatus::Unprotected,
|
||||||
param,
|
param,
|
||||||
mime_parser.timestamp_sent,
|
mime_parser.timestamp_sent,
|
||||||
@@ -3330,7 +3326,12 @@ async fn create_or_lookup_mailinglist_or_broadcast(
|
|||||||
)
|
)
|
||||||
.await?;
|
.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 {
|
} else {
|
||||||
info!(context, "Creating list forbidden by caller.");
|
info!(context, "Creating list forbidden by caller.");
|
||||||
Ok(None)
|
Ok(None)
|
||||||
|
|||||||
Reference in New Issue
Block a user