From 4b9eabc668785fdf9543033988390108cd0c76c4 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 14 Dec 2020 22:22:20 +0300 Subject: [PATCH] Separate message contents for started and ended boice chats. --- td/generate/scheme/td_api.tl | 7 +++++-- td/generate/scheme/td_api.tlo | Bin 191256 -> 191324 bytes td/telegram/MessageContent.cpp | 9 ++++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 3643ff09e..a70eba455 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -1633,8 +1633,11 @@ messageInvoice title:string description:string photo:photo currency:string total //@description A message with information about an ended call @is_video True, if the call was a video call @discard_reason Reason why the call was discarded @duration Call duration, in seconds messageCall is_video:Bool discard_reason:CallDiscardReason duration:int32 = MessageContent; -//@description A message with information about a voice chat @group_call_id Identifier of the voice chat. The voice chat can be received through the method getGroupCall @duration Call duration; for finished calls only -messageVoiceChat group_call_id:int32 duration:int32 = MessageContent; +//@description A newly created voice chat @group_call_id Identifier of the voice chat. The voice chat can be received through the method getGroupCall +messageVoiceChatStarted group_call_id:int32 = MessageContent; + +//@description A message with information about an ended voice chat @duration Call duration +messageVoiceChatEnded duration:int32 = MessageContent; //@description A message with information about an invite to a voice chat @group_call_id Identifier of the voice chat. The voice chat can be received through the method getGroupCall @user_ids Invited user identifiers messageInviteVoiceChatParticipants group_call_id:int32 user_ids:vector = MessageContent; diff --git a/td/generate/scheme/td_api.tlo b/td/generate/scheme/td_api.tlo index 2adc10609ea88c28cdce92193c41d41ecfb67478..b18f2fdbb5620a02c63fce32454271c07e7a07da 100644 GIT binary patch delta 1270 zcmaJ>UuaTc6!*9lE+Zls7W2<_yE2_uz5a>zuwbCI5e7mM1U^jilB3O;lMs3-h#_QQ z-PpHBgFWm~SRg@xjTj9UI9RU19vt-0U=J<^4cbHZ_TA&0p!eZ&zTY|L_dDl&=iY^? zcBiT>2KsvS-I+fZZVR)s(F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f7c1e82e 100644 --- a/td/telegram/MessageContent.cpp +++ b/td/telegram/MessageContent.cpp @@ -4786,9 +4786,12 @@ tl_object_ptr get_message_content_object(const MessageCo } case MessageContentType::GroupCall: { auto *m = static_cast(content); - return make_tl_object( - td->group_call_manager_->get_group_call_id(m->input_group_call_id, DialogId()).get(), - m->duration >= 0 ? max(m->duration, 1) : 0); + if (m->duration >= 0) { + return make_tl_object(m->duration); + } else { + return make_tl_object( + td->group_call_manager_->get_group_call_id(m->input_group_call_id, DialogId()).get()); + } } case MessageContentType::InviteToGroupCall: { auto *m = static_cast(content);