Skip to content

Commit d7c4120

Browse files
committed
do not notify the call with a normal notification
1 parent 5459c07 commit d7c4120

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
@@ -624,7 +624,12 @@ pub(crate) async fn receive_imf_inner(
624624
}
625625
}
626626

627-
if received_msg.hidden {
627+
if mime_parser.is_system_message == SystemMessage::IncomingCall
628+
|| mime_parser.is_system_message == SystemMessage::CallAccepted
629+
|| mime_parser.is_system_message == SystemMessage::CallEnded
630+
{
631+
context.handle_call_msg(&mime_parser, insert_msg_id).await?;
632+
} else if received_msg.hidden {
628633
// No need to emit an event about the changed message
629634
} else if let Some(replace_chat_id) = replace_chat_id {
630635
context.emit_msgs_changed_without_msg_id(replace_chat_id);
@@ -636,13 +641,6 @@ pub(crate) async fn receive_imf_inner(
636641
}
637642
context.new_msgs_notify.notify_one();
638643

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

0 commit comments

Comments
 (0)