Skip to content

Commit 9c5552e

Browse files
committed
do not notify the call with a normal notification
1 parent 1deb830 commit 9c5552e

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/calls.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ impl Context {
111111
match mime_message.is_system_message {
112112
SystemMessage::IncomingCall => {
113113
let call = self.load_call_by_root_id(call_or_child_id).await?;
114+
self.emit_msgs_changed(call.msg.chat_id, call_or_child_id);
114115
if call.incoming {
115116
self.emit_event(EventType::IncomingCall {
116117
msg_id: call.msg.id,
@@ -119,6 +120,7 @@ impl Context {
119120
}
120121
SystemMessage::CallAccepted => {
121122
let call = self.load_call_by_child_id(call_or_child_id).await?;
123+
self.emit_msgs_changed(call.msg.chat_id, call_or_child_id);
122124
if call.incoming {
123125
self.emit_event(EventType::IncomingCallAccepted {
124126
msg_id: call.msg.id,
@@ -131,6 +133,7 @@ impl Context {
131133
}
132134
SystemMessage::CallEnded => {
133135
let call = self.load_call_by_child_id(call_or_child_id).await?;
136+
self.emit_msgs_changed(call.msg.chat_id, call_or_child_id);
134137
self.emit_event(EventType::CallEnded {
135138
msg_id: call.msg.id,
136139
});

src/receive_imf.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,12 @@ pub(crate) async fn receive_imf_inner(
622622
}
623623
}
624624

625-
if received_msg.hidden {
625+
if mime_parser.is_system_message == SystemMessage::IncomingCall
626+
|| mime_parser.is_system_message == SystemMessage::CallAccepted
627+
|| mime_parser.is_system_message == SystemMessage::CallEnded
628+
{
629+
context.handle_call_msg(&mime_parser, insert_msg_id).await?;
630+
} else if received_msg.hidden {
626631
// No need to emit an event about the changed message
627632
} else if let Some(replace_chat_id) = replace_chat_id {
628633
context.emit_msgs_changed_without_msg_id(replace_chat_id);
@@ -634,13 +639,6 @@ pub(crate) async fn receive_imf_inner(
634639
}
635640
context.new_msgs_notify.notify_one();
636641

637-
if mime_parser.is_system_message == SystemMessage::IncomingCall
638-
|| mime_parser.is_system_message == SystemMessage::CallAccepted
639-
|| mime_parser.is_system_message == SystemMessage::CallEnded
640-
{
641-
context.handle_call_msg(&mime_parser, insert_msg_id).await?;
642-
}
643-
644642
mime_parser
645643
.handle_reports(context, from_id, &mime_parser.parts)
646644
.await;

0 commit comments

Comments
 (0)