mark incoming call as noticed on the second device when accepted

This commit is contained in:
link2xt
2026-09-03 19:04:29 +00:00
parent 3afaaa7cc0
commit b5c33c089e
2 changed files with 8 additions and 0 deletions

View File

@@ -437,6 +437,10 @@ impl Context {
call.mark_as_accepted(self).await?; call.mark_as_accepted(self).await?;
self.emit_msgs_changed(call.msg.chat_id, call_id); self.emit_msgs_changed(call.msg.chat_id, call_id);
if call.is_incoming() { if call.is_incoming() {
call_id
.mark_as_noticed(self)
.await
.context("Failed to mark incoming call as noticed")?;
self.emit_event(EventType::IncomingCallAccepted { self.emit_event(EventType::IncomingCallAccepted {
msg_id: call.msg.id, msg_id: call.msg.id,
chat_id: call.msg.chat_id, chat_id: call.msg.chat_id,

View File

@@ -169,6 +169,10 @@ async fn accept_call() -> Result<CallSetup> {
.expect("bob2_call should be a call message"); .expect("bob2_call should be a call message");
assert!(info.is_accepted()); assert!(info.is_accepted());
assert_eq!(call_state(&bob2, bob2_call.id).await?, CallState::Active); assert_eq!(call_state(&bob2, bob2_call.id).await?, CallState::Active);
assert_eq!(
bob2_call.id.get_state(&bob2).await?,
MessageState::InNoticed
);
// Alice receives the acceptance message // Alice receives the acceptance message
alice.recv_msg_trash(&sent2).await; alice.recv_msg_trash(&sent2).await;