From dfee8238c6aad1f8dedd80eeb4e0a3a652a5f97e Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 23 Dec 2020 14:45:37 +0400 Subject: [PATCH] Fix crash in legacy groups speaking typings handling. --- Telegram/SourceFiles/api/api_updates.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/api/api_updates.cpp b/Telegram/SourceFiles/api/api_updates.cpp index 2449c4fe3..188e06a22 100644 --- a/Telegram/SourceFiles/api/api_updates.cpp +++ b/Telegram/SourceFiles/api/api_updates.cpp @@ -928,6 +928,9 @@ void Updates::handleSendActionUpdate( const auto isSpeakingInCall = (action.type() == mtpc_speakingInGroupCallAction); if (isSpeakingInCall) { + if (!peer->isChat() && !peer->isChannel()) { + return; + } const auto call = peer->groupCall(); const auto now = crl::now(); if (call) { @@ -943,8 +946,8 @@ void Updates::handleSendActionUpdate( : (channel->flags() & MTPDchannel::Flag::f_call_active); if (active) { _pendingSpeakingCallMembers.emplace( - channel).first->second[userId] = now; - session().api().requestFullPeer(channel); + peer).first->second[userId] = now; + session().api().requestFullPeer(peer); } } }