Add groupCall.title.

This commit is contained in:
levlam 2021-03-02 18:00:54 +03:00
parent bcf3643cf7
commit 1f4e7aeb61
2 changed files with 10 additions and 3 deletions

View File

@ -2106,6 +2106,7 @@ groupCallRecentSpeaker user_id:int32 is_speaking:Bool = GroupCallRecentSpeaker;
//@description Describes a group call
//@id Group call identifier
//@title Group call title
//@is_active True, if the call is active
//@is_joined True, if the call is joined
//@need_rejoin True, if user was kicked from the call because of network loss and the call needs to be rejoined
@ -2117,7 +2118,7 @@ groupCallRecentSpeaker user_id:int32 is_speaking:Bool = GroupCallRecentSpeaker;
//@mute_new_participants True, if only group call administrators can unmute new participants
//@can_change_mute_new_participants True, if the current user can enable or disable mute_new_participants setting
//@duration Call duration; for ended calls only
groupCall id:int32 is_active:Bool is_joined:Bool need_rejoin:Bool can_unmute_self:Bool can_be_managed:Bool participant_count:int32 loaded_all_participants:Bool recent_speakers:vector<groupCallRecentSpeaker> mute_new_participants:Bool can_change_mute_new_participants:Bool duration:int32 = GroupCall;
groupCall id:int32 title:string is_active:Bool is_joined:Bool need_rejoin:Bool can_unmute_self:Bool can_be_managed:Bool participant_count:int32 loaded_all_participants:Bool recent_speakers:vector<groupCallRecentSpeaker> mute_new_participants:Bool can_change_mute_new_participants:Bool duration:int32 = GroupCall;
//@description Describes a payload fingerprint for interaction with tgcalls @hash Value of the field hash @setup Value of the field setup @fingerprint Value of the field fingerprint
groupCallPayloadFingerprint hash:string setup:string fingerprint:string = GroupCallPayloadFingerprint;

View File

@ -418,6 +418,7 @@ class DiscardGroupCallQuery : public Td::ResultHandler {
struct GroupCallManager::GroupCall {
GroupCallId group_call_id;
DialogId dialog_id;
string title;
bool is_inited = false;
bool is_active = false;
bool is_joined = false;
@ -2330,6 +2331,7 @@ InputGroupCallId GroupCallManager::update_group_call(const tl_object_ptr<telegra
auto group_call = static_cast<const telegram_api::groupCall *>(group_call_ptr.get());
input_group_call_id = InputGroupCallId(group_call->id_, group_call->access_hash_);
call.is_active = true;
call.title = std::move(group_call->title_);
call.mute_new_participants = group_call->join_muted_;
call.allowed_change_mute_new_participants = group_call->can_change_join_muted_;
call.participant_count = group_call->participants_count_;
@ -2409,6 +2411,10 @@ InputGroupCallId GroupCallManager::update_group_call(const tl_object_ptr<telegra
need_update = true;
}
}
if (call.title != group_call->title && call.version >= group_call->version) {
group_call->title = std::move(call.title);
need_update = true;
}
if (call.can_be_managed != group_call->can_be_managed) {
group_call->can_be_managed = call.can_be_managed;
need_update = true;
@ -2703,8 +2709,8 @@ tl_object_ptr<td_api::groupCall> GroupCallManager::get_group_call_object(
bool can_change_mute_new_participants =
group_call->is_active && group_call->can_be_managed && group_call->allowed_change_mute_new_participants;
return td_api::make_object<td_api::groupCall>(
group_call->group_call_id.get(), group_call->is_active, is_joined, group_call->need_rejoin, can_self_unmute,
group_call->can_be_managed, group_call->participant_count, group_call->loaded_all_participants,
group_call->group_call_id.get(), group_call->title, group_call->is_active, is_joined, group_call->need_rejoin,
can_self_unmute, group_call->can_be_managed, group_call->participant_count, group_call->loaded_all_participants,
std::move(recent_speakers), mute_new_participants, can_change_mute_new_participants, group_call->duration);
}