diff --git a/deltachat-jsonrpc/src/api.rs b/deltachat-jsonrpc/src/api.rs index fe6d2e744..8c97e56c3 100644 --- a/deltachat-jsonrpc/src/api.rs +++ b/deltachat-jsonrpc/src/api.rs @@ -999,7 +999,7 @@ impl CommandApi { .await } - /// Create a new **broadcast channel** + /// Create a new, outgoing **broadcast channel** /// (called "Channel" in the UI). /// /// Broadcast channels are similar to groups on the sending device, diff --git a/deltachat-rpc-client/src/deltachat_rpc_client/account.py b/deltachat-rpc-client/src/deltachat_rpc_client/account.py index b5a002ae9..478c45df5 100644 --- a/deltachat-rpc-client/src/deltachat_rpc_client/account.py +++ b/deltachat-rpc-client/src/deltachat_rpc_client/account.py @@ -324,7 +324,7 @@ class Account: return Chat(self, self._rpc.create_group_chat(self.id, name, protect)) def create_broadcast(self, name: str) -> Chat: - """Create a new **broadcast channel** + """Create a new, outgoing **broadcast channel** (called "Channel" in the UI). Broadcast channels are similar to groups on the sending device, diff --git a/src/chat.rs b/src/chat.rs index 0be76285d..595353b33 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -3800,7 +3800,7 @@ pub async fn create_group_ex( Ok(chat_id) } -/// Create a new **broadcast channel** +/// Create a new, outgoing **broadcast channel** /// (called "Channel" in the UI). /// /// Broadcast channels are similar to groups on the sending device, @@ -3818,22 +3818,20 @@ pub async fn create_group_ex( pub async fn create_broadcast(context: &Context, chat_name: String) -> Result { let grpid = create_id(); let secret = create_broadcast_shared_secret(); - create_broadcast_ex(context, Sync, grpid, chat_name, secret).await + create_out_broadcast_ex(context, Sync, grpid, chat_name, secret).await } const SQL_INSERT_BROADCAST_SECRET: &str = "INSERT INTO broadcasts_shared_secrets (chat_id, secret) VALUES (?, ?) ON CONFLICT(chat_id) DO UPDATE SET secret=excluded.secret"; -pub(crate) async fn create_broadcast_ex( +pub(crate) async fn create_out_broadcast_ex( context: &Context, sync: sync::Sync, grpid: String, chat_name: String, secret: String, ) -> Result { - // TODO check why create_group() is duplicated in receive_imf.rs, but this fn here is not - // e.g. do we need a create_blocked param? let chat_name = sanitize_single_line(&chat_name); if chat_name.is_empty() { bail!("Invalid broadcast channel name: {chat_name}."); @@ -5251,7 +5249,7 @@ impl Context { chat_name, shared_secret, } => { - create_broadcast_ex( + create_out_broadcast_ex( self, Nosync, grpid.to_string(), diff --git a/src/chat/chat_tests.rs b/src/chat/chat_tests.rs index 103cf3639..c5bdb44e3 100644 --- a/src/chat/chat_tests.rs +++ b/src/chat/chat_tests.rs @@ -3320,7 +3320,7 @@ async fn test_encrypt_decrypt_broadcast() -> Result<()> { let alice_bob_contact_id = alice.add_or_lookup_contact_id(bob).await; tcm.section("Create a broadcast channel with Bob, and send a message"); - let alice_chat_id = create_broadcast_ex( + let alice_chat_id = create_out_broadcast_ex( alice, Sync, "My Channel".to_string(), diff --git a/src/receive_imf.rs b/src/receive_imf.rs index ab71ed362..5d30850a8 100644 --- a/src/receive_imf.rs +++ b/src/receive_imf.rs @@ -1578,7 +1578,8 @@ async fn do_chat_assignment( let name = compute_mailinglist_name(mailinglist_header, &listid, mime_parser); let secret = create_broadcast_shared_secret(); - chat::create_broadcast_ex(context, Nosync, listid, name, secret).await? + chat::create_out_broadcast_ex(context, Nosync, listid, name, secret) + .await? }, ); }