Fix call answered on another device
This commit is contained in:
parent
2984d71971
commit
9bbade37de
@ -351,12 +351,15 @@ CallManager::handleEvent(const RoomEvent<CallAnswer> &callAnswerEvent)
|
|||||||
callAnswerEvent.content.call_id,
|
callAnswerEvent.content.call_id,
|
||||||
callAnswerEvent.sender);
|
callAnswerEvent.sender);
|
||||||
|
|
||||||
if (!isOnCall() && callAnswerEvent.sender == utils::localUser().toStdString() &&
|
if (callAnswerEvent.sender == utils::localUser().toStdString() &&
|
||||||
callid_ == callAnswerEvent.content.call_id) {
|
callid_ == callAnswerEvent.content.call_id) {
|
||||||
emit ChatPage::instance()->showNotification("Call answered on another device.");
|
if (!isOnCall()) {
|
||||||
stopRingtone();
|
emit ChatPage::instance()->showNotification(
|
||||||
haveCallInvite_ = false;
|
"Call answered on another device.");
|
||||||
emit newInviteState();
|
stopRingtone();
|
||||||
|
haveCallInvite_ = false;
|
||||||
|
emit newInviteState();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -613,8 +613,13 @@ TimelineModel::addEvents(const mtx::responses::Timeline &timeline)
|
|||||||
std::visit(
|
std::visit(
|
||||||
[this](auto &event) {
|
[this](auto &event) {
|
||||||
event.room_id = room_id_.toStdString();
|
event.room_id = room_id_.toStdString();
|
||||||
if (event.sender != http::client()->user_id().to_string())
|
if constexpr (std::is_same_v<std::decay_t<decltype(event)>,
|
||||||
|
RoomEvent<msg::CallAnswer>>)
|
||||||
emit newCallEvent(event);
|
emit newCallEvent(event);
|
||||||
|
else {
|
||||||
|
if (event.sender != http::client()->user_id().to_string())
|
||||||
|
emit newCallEvent(event);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
e);
|
e);
|
||||||
else if (std::holds_alternative<StateEvent<state::Avatar>>(e))
|
else if (std::holds_alternative<StateEvent<state::Avatar>>(e))
|
||||||
|
Loading…
Reference in New Issue
Block a user