Skip to content

Commit 8fda2de

Browse files
committed
Remove another unnecessary function
1 parent 640d810 commit 8fda2de

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/chat.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,11 +1658,6 @@ impl Chat {
16581658
self.typ == Chattype::Mailinglist
16591659
}
16601660

1661-
/// Returns true if chat is an outgoing broadcast channel.
1662-
pub fn is_out_broadcast(&self) -> bool {
1663-
self.typ == Chattype::OutBroadcast
1664-
}
1665-
16661661
/// Returns None if user can send messages to this chat.
16671662
///
16681663
/// Otherwise returns a reason useful for logging.
@@ -4095,7 +4090,7 @@ pub(crate) async fn add_contact_to_chat_ex(
40954090
msg.viewtype = Viewtype::Text;
40964091

40974092
let contact_addr = contact.get_addr().to_lowercase();
4098-
let added_by = if from_handshake && chat.is_out_broadcast() {
4093+
let added_by = if from_handshake && chat.typ == Chattype::OutBroadcast {
40994094
// The contact was added via a QR code rather than explicit user action,
41004095
// and there is no useful information in saying 'You added member Alice'
41014096
// if self is the only one who can add members.
@@ -4109,7 +4104,7 @@ pub(crate) async fn add_contact_to_chat_ex(
41094104
msg.param.set_int(Param::Arg2, from_handshake.into());
41104105
msg.param
41114106
.set_int(Param::ContactAddedRemoved, contact.id.to_u32() as i32);
4112-
if chat.is_out_broadcast() {
4107+
if chat.typ == Chattype::OutBroadcast {
41134108
let secret = load_broadcast_shared_secret(context, chat_id)
41144109
.await?
41154110
.context("Failed to find broadcast shared secret")?;

src/mimefactory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1920,7 +1920,7 @@ fn should_encrypt_with_auth_token(msg: &Message) -> bool {
19201920
}
19211921

19221922
fn should_encrypt_with_broadcast_secret(msg: &Message, chat: &Chat) -> bool {
1923-
chat.is_out_broadcast()
1923+
chat.typ == Chattype::OutBroadcast
19241924
&& msg.param.get_cmd() != SystemMessage::SecurejoinMessage
19251925
// The member-added message in a broadcast must be asymmetrically encrypted,
19261926
// because the newly-added member doesn't know the broadcast shared secret yet:

0 commit comments

Comments
 (0)