Group Calls: Fix call indicator not updating (#2367)
This commit is contained in:
parent
bb34e6ae5a
commit
e1f4d12c45
@ -978,6 +978,13 @@ export function updater(update: Update, originRequest?: GramJs.AnyRequest) {
|
|||||||
} else if (update instanceof GramJs.UpdateSavedGifs) {
|
} else if (update instanceof GramJs.UpdateSavedGifs) {
|
||||||
onUpdate({ '@type': 'updateSavedGifs' });
|
onUpdate({ '@type': 'updateSavedGifs' });
|
||||||
} else if (update instanceof GramJs.UpdateGroupCall) {
|
} else if (update instanceof GramJs.UpdateGroupCall) {
|
||||||
|
// eslint-disable-next-line no-underscore-dangle
|
||||||
|
const entities = update._entities;
|
||||||
|
if (entities) {
|
||||||
|
addEntitiesWithPhotosToLocalDb(entities);
|
||||||
|
dispatchUserAndChatUpdates(entities);
|
||||||
|
}
|
||||||
|
|
||||||
onUpdate({
|
onUpdate({
|
||||||
'@type': 'updateGroupCall',
|
'@type': 'updateGroupCall',
|
||||||
call: buildApiGroupCall(update.call),
|
call: buildApiGroupCall(update.call),
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { selectChat } from '../../selectors';
|
|||||||
import { updateChat } from '../../reducers';
|
import { updateChat } from '../../reducers';
|
||||||
import { ARE_CALLS_SUPPORTED } from '../../../util/environment';
|
import { ARE_CALLS_SUPPORTED } from '../../../util/environment';
|
||||||
import { notifyAboutCall } from '../../../util/notifications';
|
import { notifyAboutCall } from '../../../util/notifications';
|
||||||
import { selectPhoneCallUser } from '../../selectors/calls';
|
import { selectGroupCall, selectPhoneCallUser } from '../../selectors/calls';
|
||||||
import { checkNavigatorUserMediaPermissions, initializeSoundsForSafari } from '../ui/calls';
|
import { checkNavigatorUserMediaPermissions, initializeSoundsForSafari } from '../ui/calls';
|
||||||
import { onTickEnd } from '../../../util/schedulers';
|
import { onTickEnd } from '../../../util/schedulers';
|
||||||
import type { ActionReturnType } from '../../types';
|
import type { ActionReturnType } from '../../types';
|
||||||
@ -24,6 +24,14 @@ addActionHandler('apiUpdate', (global, actions, update): ActionReturnType => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const groupCall = selectGroupCall(global, update.call.id);
|
||||||
|
const chatId = groupCall?.chatId;
|
||||||
|
if (chatId) {
|
||||||
|
global = updateChat(global, chatId, {
|
||||||
|
isCallNotEmpty: (groupCall.participantsCount > 0 || Boolean(groupCall.participants?.length)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return updateGroupCall(
|
return updateGroupCall(
|
||||||
global,
|
global,
|
||||||
update.call.id,
|
update.call.id,
|
||||||
@ -62,6 +70,14 @@ addActionHandler('apiUpdate', (global, actions, update): ActionReturnType => {
|
|||||||
nextOffset,
|
nextOffset,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const groupCall = selectGroupCall(global, groupCallId);
|
||||||
|
const chatId = groupCall?.chatId;
|
||||||
|
if (chatId) {
|
||||||
|
global = updateChat(global, chatId, {
|
||||||
|
isCallNotEmpty: (groupCall.participantsCount > 0 || Boolean(groupCall.participants?.length)),
|
||||||
|
});
|
||||||
|
}
|
||||||
return global;
|
return global;
|
||||||
}
|
}
|
||||||
case 'updatePhoneCall': {
|
case 'updatePhoneCall': {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user