mirror of
https://github.com/chatmail/core.git
synced 2026-04-19 22:46:29 +03:00
Don't let blocking be bypassed using groups (#4316)
* Don't let blocking be bypassed using groups Fix #4313 * Fix another bug: A blocked group was sometimes not unblocked when an unblocked contact sent a message into it.
This commit is contained in:
@@ -18,7 +18,10 @@ use tokio::runtime::Handle;
|
||||
use tokio::sync::RwLock;
|
||||
use tokio::task;
|
||||
|
||||
use crate::chat::{self, Chat, ChatId, MessageListOptions};
|
||||
use crate::chat::{
|
||||
self, add_to_chat_contacts_table, create_group_chat, Chat, ChatId, MessageListOptions,
|
||||
ProtectionStatus,
|
||||
};
|
||||
use crate::chatlist::Chatlist;
|
||||
use crate::config::Config;
|
||||
use crate::constants::Chattype;
|
||||
@@ -702,6 +705,25 @@ impl TestContext {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn create_group_with_members(
|
||||
&self,
|
||||
protect: ProtectionStatus,
|
||||
chat_name: &str,
|
||||
members: &[&TestContext],
|
||||
) -> ChatId {
|
||||
let chat_id = create_group_chat(self, protect, chat_name).await.unwrap();
|
||||
let mut to_add = vec![];
|
||||
for member in members {
|
||||
let contact = self.add_or_lookup_contact(member).await;
|
||||
to_add.push(contact.id);
|
||||
}
|
||||
add_to_chat_contacts_table(self, chat_id, &to_add)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
chat_id
|
||||
}
|
||||
}
|
||||
|
||||
impl Deref for TestContext {
|
||||
|
||||
Reference in New Issue
Block a user