File tree 1 file changed +17
-11
lines changed
1 file changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -156,17 +156,23 @@ impl Context {
156
156
match mime_message. is_system_message {
157
157
SystemMessage :: IncomingCall => {
158
158
let call = self . load_call_by_root_id ( call_or_child_id) . await ?;
159
- self . emit_msgs_changed ( call. msg . chat_id , call_or_child_id) ;
160
- if call. incoming && !call. is_stale_call ( ) {
161
- self . emit_event ( EventType :: IncomingCall {
162
- msg_id : call. msg . id ,
163
- } ) ;
164
- let wait = call. remaining_ring_seconds ( ) ;
165
- task:: spawn ( Context :: emit_end_call_if_unaccepted (
166
- self . clone ( ) ,
167
- wait. try_into ( ) ?,
168
- call. msg . id ,
169
- ) ) ;
159
+ if call. incoming {
160
+ if call. is_stale_call ( ) {
161
+ self . emit_incoming_msg ( call. msg . chat_id , call_or_child_id) ;
162
+ } else {
163
+ self . emit_msgs_changed ( call. msg . chat_id , call_or_child_id) ;
164
+ self . emit_event ( EventType :: IncomingCall {
165
+ msg_id : call. msg . id ,
166
+ } ) ;
167
+ let wait = call. remaining_ring_seconds ( ) ;
168
+ task:: spawn ( Context :: emit_end_call_if_unaccepted (
169
+ self . clone ( ) ,
170
+ wait. try_into ( ) ?,
171
+ call. msg . id ,
172
+ ) ) ;
173
+ }
174
+ } else {
175
+ self . emit_msgs_changed ( call. msg . chat_id , call_or_child_id) ;
170
176
}
171
177
}
172
178
SystemMessage :: CallAccepted => {
You can’t perform that action at this time.
0 commit comments