diff --git a/src/api/gramjs/updater.ts b/src/api/gramjs/updater.ts index 5ddc12bb6..6bbec5b09 100644 --- a/src/api/gramjs/updater.ts +++ b/src/api/gramjs/updater.ts @@ -978,6 +978,13 @@ export function updater(update: Update, originRequest?: GramJs.AnyRequest) { } else if (update instanceof GramJs.UpdateSavedGifs) { onUpdate({ '@type': 'updateSavedGifs' }); } else if (update instanceof GramJs.UpdateGroupCall) { + // eslint-disable-next-line no-underscore-dangle + const entities = update._entities; + if (entities) { + addEntitiesWithPhotosToLocalDb(entities); + dispatchUserAndChatUpdates(entities); + } + onUpdate({ '@type': 'updateGroupCall', call: buildApiGroupCall(update.call), diff --git a/src/global/actions/apiUpdaters/calls.ts b/src/global/actions/apiUpdaters/calls.ts index e1ba9abb9..36ebf8780 100644 --- a/src/global/actions/apiUpdaters/calls.ts +++ b/src/global/actions/apiUpdaters/calls.ts @@ -5,7 +5,7 @@ import { selectChat } from '../../selectors'; import { updateChat } from '../../reducers'; import { ARE_CALLS_SUPPORTED } from '../../../util/environment'; import { notifyAboutCall } from '../../../util/notifications'; -import { selectPhoneCallUser } from '../../selectors/calls'; +import { selectGroupCall, selectPhoneCallUser } from '../../selectors/calls'; import { checkNavigatorUserMediaPermissions, initializeSoundsForSafari } from '../ui/calls'; import { onTickEnd } from '../../../util/schedulers'; 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( global, update.call.id, @@ -62,6 +70,14 @@ addActionHandler('apiUpdate', (global, actions, update): ActionReturnType => { 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; } case 'updatePhoneCall': {