Skip to content

Commit 4bb2871

Browse files
committed
do not notify the call with a normal notification
1 parent bff7e15 commit 4bb2871

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
@@ -626,7 +626,12 @@ pub(crate) async fn receive_imf_inner(
626626
}
627627
}
628628

629-
if received_msg.hidden {
629+
if mime_parser.is_system_message == SystemMessage::IncomingCall
630+
|| mime_parser.is_system_message == SystemMessage::CallAccepted
631+
|| mime_parser.is_system_message == SystemMessage::CallEnded
632+
{
633+
context.handle_call_msg(&mime_parser, insert_msg_id).await?;
634+
} else if received_msg.hidden {
630635
// No need to emit an event about the changed message
631636
} else if let Some(replace_chat_id) = replace_chat_id {
632637
context.emit_msgs_changed_without_msg_id(replace_chat_id);
@@ -638,13 +643,6 @@ pub(crate) async fn receive_imf_inner(
638643
}
639644
context.new_msgs_notify.notify_one();
640645

641-
if mime_parser.is_system_message == SystemMessage::IncomingCall
642-
|| mime_parser.is_system_message == SystemMessage::CallAccepted
643-
|| mime_parser.is_system_message == SystemMessage::CallEnded
644-
{
645-
context.handle_call_msg(&mime_parser, insert_msg_id).await?;
646-
}
647-
648646
mime_parser
649647
.handle_reports(context, from_id, &mime_parser.parts)
650648
.await;

0 commit comments

Comments
 (0)