Support voice chat creation in channels.

This commit is contained in:
levlam 2021-03-06 02:26:13 +03:00
parent 16ab28f230
commit 7a19e5dbe5
3 changed files with 2 additions and 18 deletions

View File

@ -464,7 +464,7 @@ chatMemberStatusCreator custom_title:string is_anonymous:Bool is_member:Bool = C
//@can_restrict_members True, if the administrator can restrict, ban, or unban chat members
//@can_pin_messages True, if the administrator can pin messages; applicable to basic groups and supergroups only
//@can_promote_members True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them
//@can_manage_voice_chats True, if the administrator can manage voice chats; applicable to basic groups and supergroups only
//@can_manage_voice_chats True, if the administrator can manage voice chats
//@is_anonymous True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only
chatMemberStatusAdministrator custom_title:string can_be_edited:Bool can_manage_chat:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_promote_members:Bool can_manage_voice_chats:Bool is_anonymous:Bool = ChatMemberStatus;
@ -4547,7 +4547,7 @@ sendCallRating call_id:int32 rating:int32 comment:string problems:vector<CallPro
sendCallDebugInformation call_id:int32 debug_information:string = Ok;
//@description Creates a voice chat (a group call bound to a chat). Available only for basic groups and supergroups; requires can_manage_voice_chats rights @chat_id Chat identifier
//@description Creates a voice chat (a group call bound to a chat). Available only for basic groups, supergroups and channels; requires can_manage_voice_chats rights @chat_id Chat identifier
createVoiceChat chat_id:int53 = GroupCallId;
//@description Returns information about a group call @group_call_id Group call identifier

View File

@ -10466,10 +10466,6 @@ void ContactsManager::on_get_chat_full(tl_object_ptr<telegram_api::ChatFull> &&c
InputGroupCallId input_group_call_id;
if (channel->call_ != nullptr) {
input_group_call_id = InputGroupCallId(channel->call_);
if (input_group_call_id.is_valid() && !c->is_megagroup) {
LOG(ERROR) << "Receive " << input_group_call_id << " in " << channel_id;
input_group_call_id = InputGroupCallId();
}
}
td_->messages_manager_->on_update_dialog_group_call_id(DialogId(channel_id), input_group_call_id);
}

View File

@ -736,18 +736,6 @@ Status GroupCallManager::can_manage_group_calls(DialogId dialog_id) const {
}
case DialogType::Channel: {
auto channel_id = dialog_id.get_channel_id();
switch (td_->contacts_manager_->get_channel_type(channel_id)) {
case ChannelType::Unknown:
return Status::Error(400, "Chat info not found");
case ChannelType::Megagroup:
// OK
break;
case ChannelType::Broadcast:
return Status::Error(400, "Chat is not a group");
default:
UNREACHABLE();
break;
}
if (!td_->contacts_manager_->get_channel_permissions(channel_id).can_manage_calls()) {
return Status::Error(400, "Not enough rights in the chat");
}