Calls: Various fixes (#1964)
This commit is contained in:
parent
31834d56b5
commit
9533ed449b
@ -276,7 +276,7 @@ export async function requestCall({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
if (!result) {
|
if (!result) {
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const call = buildPhoneCall(result.phoneCall);
|
const call = buildPhoneCall(result.phoneCall);
|
||||||
@ -285,6 +285,8 @@ export async function requestCall({
|
|||||||
'@type': 'updatePhoneCall',
|
'@type': 'updatePhoneCall',
|
||||||
call,
|
call,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setCallRating({
|
export function setCallRating({
|
||||||
|
|||||||
@ -36,6 +36,8 @@
|
|||||||
.meta {
|
.meta {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
position: relative;
|
||||||
|
left: -3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.duration {
|
.duration {
|
||||||
|
|||||||
@ -212,7 +212,7 @@ addActionHandler('connectToActiveGroupCall', async (global, actions) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
addActionHandler('connectToActivePhoneCall', async (global) => {
|
addActionHandler('connectToActivePhoneCall', async (global, actions) => {
|
||||||
const { phoneCall } = global;
|
const { phoneCall } = global;
|
||||||
|
|
||||||
if (!phoneCall) return;
|
if (!phoneCall) return;
|
||||||
@ -229,7 +229,11 @@ addActionHandler('connectToActivePhoneCall', async (global) => {
|
|||||||
|
|
||||||
const gAHash = await callApi('requestPhoneCall', [dhConfig])!;
|
const gAHash = await callApi('requestPhoneCall', [dhConfig])!;
|
||||||
|
|
||||||
await callApi('requestCall', { user, gAHash, isVideo: phoneCall.isVideo });
|
const result = await callApi('requestCall', { user, gAHash, isVideo: phoneCall.isVideo });
|
||||||
|
|
||||||
|
if (!result) {
|
||||||
|
actions.hangUp();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
addActionHandler('acceptCall', async (global) => {
|
addActionHandler('acceptCall', async (global) => {
|
||||||
|
|||||||
@ -73,6 +73,7 @@ addActionHandler('apiUpdate', (global, actions, update) => {
|
|||||||
|
|
||||||
if (phoneCall) {
|
if (phoneCall) {
|
||||||
if (call.state === 'discarded') {
|
if (call.state === 'discarded') {
|
||||||
|
actions.playGroupCallSound({ sound: 'end' });
|
||||||
return {
|
return {
|
||||||
...global,
|
...global,
|
||||||
...(call.needRating && { ratingPhoneCall: call }),
|
...(call.needRating && { ratingPhoneCall: call }),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user