From c69293e1ccc6c36f3134475a1bdb821db6d07ce0 Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 14 Oct 2021 15:44:21 +0300 Subject: [PATCH] Rename voice chats to video chats. --- td/generate/scheme/td_api.tl | 96 +++++++++++++++---------------- td/telegram/DialogParticipant.cpp | 2 +- td/telegram/LinkManager.cpp | 2 +- td/telegram/MessageContent.cpp | 8 +-- td/telegram/MessagesManager.cpp | 44 +++++++------- td/telegram/MessagesManager.h | 4 +- td/telegram/Td.cpp | 6 +- td/telegram/Td.h | 6 +- td/telegram/cli.cpp | 6 +- test/link.cpp | 30 +++++----- 10 files changed, 102 insertions(+), 102 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 2bd065098..288dff8f1 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -461,7 +461,7 @@ chatPermissions can_send_messages:Bool can_send_media_messages:Bool can_send_pol //@is_member True, if the user is a member of the chat chatMemberStatusCreator custom_title:string is_anonymous:Bool is_member:Bool = ChatMemberStatus; -//@description The user is a member of the chat and has some additional privileges. In basic groups, administrators can edit and delete messages sent by others, add new members, ban unprivileged members, and manage voice chats. In supergroups and channels, there are more detailed options for administrator privileges +//@description The user is a member of the chat and has some additional privileges. In basic groups, administrators can edit and delete messages sent by others, add new members, ban unprivileged members, and manage video chats. In supergroups and channels, there are more detailed options for administrator privileges //@custom_title A custom title of the administrator; 0-16 characters without emojis; applicable to supergroups only //@can_be_edited True, if the current user can edit the administrator privileges for the called user //@can_manage_chat True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only @@ -473,9 +473,9 @@ 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; always true for channels //@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 +//@can_manage_video_chats True, if the administrator can manage video 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; +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_video_chats:Bool is_anonymous:Bool = ChatMemberStatus; //@description The user is a member of the chat, without any additional privileges or restrictions chatMemberStatusMember = ChatMemberStatus; @@ -489,7 +489,7 @@ chatMemberStatusRestricted is_member:Bool restricted_until_date:int32 permission //@description The user or the chat is not a chat member chatMemberStatusLeft = ChatMemberStatus; -//@description The user or the chat was banned (and hence is not a member of the chat). Implies the user can't return to the chat, view messages, or be used as a participant identifier to join a voice chat of the chat +//@description The user or the chat was banned (and hence is not a member of the chat). Implies the user can't return to the chat, view messages, or be used as a participant identifier to join a video chat of the chat //@banned_until_date Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever. Always 0 in basic groups chatMemberStatusBanned banned_until_date:int32 = ChatMemberStatus; @@ -923,11 +923,11 @@ chatSourcePublicServiceAnnouncement type:string text:string = ChatSource; chatPosition list:ChatList order:int64 is_pinned:Bool source:ChatSource = ChatPosition; -//@description Describes a voice chat -//@group_call_id Group call identifier of an active voice chat; 0 if none. Full information about the voice chat can be received through the method getGroupCall -//@has_participants True, if the voice chat has participants -//@default_participant_id Default group call participant identifier to join the voice chat; may be null -voiceChat group_call_id:int32 has_participants:Bool default_participant_id:MessageSender = VoiceChat; +//@description Describes a video chat +//@group_call_id Group call identifier of an active video chat; 0 if none. Full information about the video chat can be received through the method getGroupCall +//@has_participants True, if the video chat has participants +//@default_participant_id Default group call participant identifier to join the video chat; may be null +videoChat group_call_id:int32 has_participants:Bool default_participant_id:MessageSender = VideoChat; //@description A chat. (Can be a private chat, basic group, supergroup, or secret chat) @@ -953,12 +953,12 @@ voiceChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@message_ttl_setting Current message Time To Live setting (self-destruct timer) for the chat; 0 if not defined. TTL is counted from the time message or its content is viewed in secret chats and from the send date in other chats //@theme_name If non-empty, name of a theme, set for the chat //@action_bar Describes actions which must be possible to do through a chat action bar; may be null -//@voice_chat Contains information about voice chat of the chat +//@video_chat Contains information about video chat of the chat //@pending_join_request_count Number of pending join requests, waiting administrator's approval //@reply_markup_message_id Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat //@draft_message A draft of a message in the chat; may be null //@client_data Contains application-specific data associated with the chat. (For example, the chat scroll position or local chat notification settings can be stored here.) Persistent if the message database is used -chat id:int53 type:ChatType title:string photo:chatPhotoInfo permissions:chatPermissions last_message:message positions:vector is_marked_as_unread:Bool is_blocked:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 notification_settings:chatNotificationSettings message_ttl_setting:int32 theme_name:string action_bar:ChatActionBar voice_chat:voiceChat pending_join_request_count:int53 reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; +chat id:int53 type:ChatType title:string photo:chatPhotoInfo permissions:chatPermissions last_message:message positions:vector is_marked_as_unread:Bool is_blocked:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 notification_settings:chatNotificationSettings message_ttl_setting:int32 theme_name:string action_bar:ChatActionBar video_chat:videoChat pending_join_request_count:int53 reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; //@description Represents a list of chats @total_count Approximate total count of chats found @chat_ids List of chat identifiers chats total_count:int32 chat_ids:vector = Chats; @@ -1751,17 +1751,17 @@ 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 new voice chat was scheduled @group_call_id Identifier of the voice chat. The voice chat can be received through the method getGroupCall @start_date Point in time (Unix timestamp) when the group call is supposed to be started by an administrator -messageVoiceChatScheduled group_call_id:int32 start_date:int32 = MessageContent; +//@description A new video chat was scheduled @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall @start_date Point in time (Unix timestamp) when the group call is supposed to be started by an administrator +messageVideoChatScheduled group_call_id:int32 start_date: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 newly created video chat @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall +messageVideoChatStarted group_call_id:int32 = MessageContent; -//@description A message with information about an ended voice chat @duration Call duration, in seconds -messageVoiceChatEnded duration:int32 = MessageContent; +//@description A message with information about an ended video chat @duration Call duration, in seconds +messageVideoChatEnded 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; +//@description A message with information about an invite to a video chat @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall @user_ids Invited user identifiers +messageInviteVideoChatParticipants group_call_id:int32 user_ids:vector = MessageContent; //@description A newly created basic group @title Title of the basic group @member_user_ids User identifiers of members in the basic group messageBasicGroupChatCreate title:string member_user_ids:vector = MessageContent; @@ -2579,20 +2579,20 @@ chatEventInviteLinkRevoked invite_link:chatInviteLink = ChatEventAction; //@description A revoked chat invite link was deleted @invite_link The invite link chatEventInviteLinkDeleted invite_link:chatInviteLink = ChatEventAction; -//@description A voice chat was created @group_call_id Identifier of the voice chat. The voice chat can be received through the method getGroupCall -chatEventVoiceChatCreated group_call_id:int32 = ChatEventAction; +//@description A video chat was created @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall +chatEventVideoChatCreated group_call_id:int32 = ChatEventAction; -//@description A voice chat was discarded @group_call_id Identifier of the voice chat. The voice chat can be received through the method getGroupCall -chatEventVoiceChatDiscarded group_call_id:int32 = ChatEventAction; +//@description A video chat was discarded @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall +chatEventVideoChatDiscarded group_call_id:int32 = ChatEventAction; -//@description A voice chat participant was muted or unmuted @participant_id Identifier of the affected group call participant @is_muted New value of is_muted -chatEventVoiceChatParticipantIsMutedToggled participant_id:MessageSender is_muted:Bool = ChatEventAction; +//@description A video chat participant was muted or unmuted @participant_id Identifier of the affected group call participant @is_muted New value of is_muted +chatEventVideoChatParticipantIsMutedToggled participant_id:MessageSender is_muted:Bool = ChatEventAction; -//@description A voice chat participant volume level was changed @participant_id Identifier of the affected group call participant @volume_level New value of volume_level; 1-20000 in hundreds of percents -chatEventVoiceChatParticipantVolumeLevelChanged participant_id:MessageSender volume_level:int32 = ChatEventAction; +//@description A video chat participant volume level was changed @participant_id Identifier of the affected group call participant @volume_level New value of volume_level; 1-20000 in hundreds of percents +chatEventVideoChatParticipantVolumeLevelChanged participant_id:MessageSender volume_level:int32 = ChatEventAction; -//@description The mute_new_participants setting of a voice chat was toggled @mute_new_participants New value of the mute_new_participants setting -chatEventVoiceChatMuteNewParticipantsToggled mute_new_participants:Bool = ChatEventAction; +//@description The mute_new_participants setting of a video chat was toggled @mute_new_participants New value of the mute_new_participants setting +chatEventVideoChatMuteNewParticipantsToggled mute_new_participants:Bool = ChatEventAction; //@description Represents a chat event @id Chat event identifier @date Point in time (Unix timestamp) when the event happened @user_id Identifier of the user who performed the action that triggered the event @action Action performed by the user chatEvent id:int64 date:int32 user_id:int53 action:ChatEventAction = ChatEvent; @@ -2612,8 +2612,8 @@ chatEvents events:vector = ChatEvents; //@info_changes True, if changes in chat information need to be returned //@setting_changes True, if changes in chat settings need to be returned //@invite_link_changes True, if changes to invite links need to be returned -//@voice_chat_changes True, if voice chat actions need to be returned -chatEventLogFilters message_edits:Bool message_deletions:Bool message_pins:Bool member_joins:Bool member_leaves:Bool member_invites:Bool member_promotions:Bool member_restrictions:Bool info_changes:Bool setting_changes:Bool invite_link_changes:Bool voice_chat_changes:Bool = ChatEventLogFilters; +//@video_chat_changes True, if video chat actions need to be returned +chatEventLogFilters message_edits:Bool message_deletions:Bool message_pins:Bool member_joins:Bool member_leaves:Bool member_invites:Bool member_promotions:Bool member_restrictions:Bool info_changes:Bool setting_changes:Bool invite_link_changes:Bool video_chat_changes:Bool = ChatEventLogFilters; //@class LanguagePackStringValue @description Represents the value of a string in a language pack @@ -3202,10 +3202,10 @@ internalLinkTypeThemeSettings = InternalLinkType; //@description The link is an unknown tg: link. Call getDeepLinkInfo to process the link @link Link to be passed to getDeepLinkInfo internalLinkTypeUnknownDeepLink link:string = InternalLinkType; -//@description The link is a link to a voice chat. Call searchPublicChat with the given chat username, and then joinGoupCall with the given invite hash to process the link -//@chat_username Username of the chat with the voice chat @invite_hash If non-empty, invite hash to be used to join the voice chat without being muted by administrators -//@is_live_stream True, if the voice chat is expected to be a live stream in a channel or a broadcast group -internalLinkTypeVoiceChat chat_username:string invite_hash:string is_live_stream:Bool = InternalLinkType; +//@description The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGoupCall with the given invite hash to process the link +//@chat_username Username of the chat with the video chat @invite_hash If non-empty, invite hash to be used to join the video chat without being muted by administrators +//@is_live_stream True, if the video chat is expected to be a live stream in a channel or a broadcast group +internalLinkTypeVideoChat chat_username:string invite_hash:string is_live_stream:Bool = InternalLinkType; //@description Contains an HTTPS link to a message in a supergroup or channel @link Message link @is_public True, if the link will work for non-members of the chat @@ -3681,8 +3681,8 @@ updateChatIsBlocked chat_id:int53 is_blocked:Bool = Update; //@description A chat's has_scheduled_messages field has changed @chat_id Chat identifier @has_scheduled_messages New value of has_scheduled_messages updateChatHasScheduledMessages chat_id:int53 has_scheduled_messages:Bool = Update; -//@description A chat voice chat state has changed @chat_id Chat identifier @voice_chat New value of voice_chat -updateChatVoiceChat chat_id:int53 voice_chat:voiceChat = Update; +//@description A chat video chat state has changed @chat_id Chat identifier @video_chat New value of video_chat +updateChatVideoChat chat_id:int53 video_chat:videoChat = Update; //@description The value of the default disable_notification parameter, used when a message is sent to the chat, was changed @chat_id Chat identifier @default_disable_notification The new default_disable_notification value updateChatDefaultDisableNotification chat_id:int53 default_disable_notification:Bool = Update; @@ -4968,17 +4968,17 @@ sendCallRating call_id:int32 rating:int32 comment:string problems:vector = Ok; -//@description Returns invite link to a voice chat in a public chat +//@description Returns invite link to a video chat in a public chat //@group_call_id Group call identifier //@can_self_unmute Pass true if the invite link needs to contain an invite hash, passing which to joinGroupCall would allow the invited user to unmute themselves. Requires groupCall.can_be_managed group call flag getGroupCallInviteLink group_call_id:int32 can_self_unmute:Bool = HttpUrl; diff --git a/td/telegram/DialogParticipant.cpp b/td/telegram/DialogParticipant.cpp index d11e3de81..25b4a0a2d 100644 --- a/td/telegram/DialogParticipant.cpp +++ b/td/telegram/DialogParticipant.cpp @@ -422,7 +422,7 @@ DialogParticipantStatus get_dialog_participant_status(const tl_object_ptris_anonymous_, custom_title, true /*st->can_be_edited_*/, st->can_manage_chat_, st->can_change_info_, st->can_post_messages_, st->can_edit_messages_, st->can_delete_messages_, st->can_invite_users_, - st->can_restrict_members_, st->can_pin_messages_, st->can_promote_members_, st->can_manage_voice_chats_); + st->can_restrict_members_, st->can_pin_messages_, st->can_promote_members_, st->can_manage_video_chats_); } case td_api::chatMemberStatusMember::ID: return DialogParticipantStatus::Member(); diff --git a/td/telegram/LinkManager.cpp b/td/telegram/LinkManager.cpp index b314f6ce6..711d20a6e 100644 --- a/td/telegram/LinkManager.cpp +++ b/td/telegram/LinkManager.cpp @@ -360,7 +360,7 @@ class LinkManager::InternalLinkVoiceChat final : public InternalLink { bool is_live_stream_; td_api::object_ptr get_internal_link_type_object() const final { - return td_api::make_object(dialog_username_, invite_hash_, is_live_stream_); + return td_api::make_object(dialog_username_, invite_hash_, is_live_stream_); } public: diff --git a/td/telegram/MessageContent.cpp b/td/telegram/MessageContent.cpp index 108d02306..0e2eab7b0 100644 --- a/td/telegram/MessageContent.cpp +++ b/td/telegram/MessageContent.cpp @@ -4984,19 +4984,19 @@ tl_object_ptr get_message_content_object(const MessageCo case MessageContentType::GroupCall: { const auto *m = static_cast(content); if (m->duration >= 0) { - return make_tl_object(m->duration); + return make_tl_object(m->duration); } else { auto group_call_id = td->group_call_manager_->get_group_call_id(m->input_group_call_id, DialogId()).get(); if (m->schedule_date > 0) { - return make_tl_object(group_call_id, m->schedule_date); + return make_tl_object(group_call_id, m->schedule_date); } else { - return make_tl_object(group_call_id); + return make_tl_object(group_call_id); } } } case MessageContentType::InviteToGroupCall: { const auto *m = static_cast(content); - return make_tl_object( + return make_tl_object( td->group_call_manager_->get_group_call_id(m->input_group_call_id, DialogId()).get(), td->contacts_manager_->get_user_ids_object(m->user_ids, "MessageInviteToGroupCall")); } diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 98a120c68..6e5797e85 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -20075,13 +20075,13 @@ string MessagesManager::get_dialog_theme_name(const Dialog *d) const { return d->theme_name; } -td_api::object_ptr MessagesManager::get_voice_chat_object(const Dialog *d) const { +td_api::object_ptr MessagesManager::get_video_chat_object(const Dialog *d) const { auto active_group_call_id = td_->group_call_manager_->get_group_call_id(d->active_group_call_id, d->dialog_id); auto default_participant_alias = d->default_join_group_call_as_dialog_id.is_valid() - ? get_message_sender_object_const(d->default_join_group_call_as_dialog_id, "get_voice_chat_object") + ? get_message_sender_object_const(d->default_join_group_call_as_dialog_id, "get_video_chat_object") : nullptr; - return make_tl_object(active_group_call_id.get(), + return make_tl_object(active_group_call_id.get(), active_group_call_id.is_valid() ? !d->is_group_call_empty : false, std::move(default_participant_alias)); } @@ -20156,7 +20156,7 @@ td_api::object_ptr MessagesManager::get_chat_object(const Dialog * d->last_read_inbox_message_id.get(), d->last_read_outbox_message_id.get(), d->unread_mention_count, get_chat_notification_settings_object(&d->notification_settings), d->message_ttl_setting.get_message_ttl_setting_object(), get_dialog_theme_name(d), get_chat_action_bar_object(d), - get_voice_chat_object(d), d->pending_join_request_count, d->reply_markup_message_id.get(), + get_video_chat_object(d), d->pending_join_request_count, d->reply_markup_message_id.get(), std::move(draft_message), d->client_data); } @@ -28864,12 +28864,12 @@ void MessagesManager::send_update_chat_pending_join_request_count(const Dialog * d->pending_join_request_count)); } -void MessagesManager::send_update_chat_voice_chat(const Dialog *d) { +void MessagesManager::send_update_chat_video_chat(const Dialog *d) { CHECK(d != nullptr); - LOG_CHECK(d->is_update_new_chat_sent) << "Wrong " << d->dialog_id << " in send_update_chat_voice_chat"; - on_dialog_updated(d->dialog_id, "send_update_chat_voice_chat"); + LOG_CHECK(d->is_update_new_chat_sent) << "Wrong " << d->dialog_id << " in send_update_chat_video_chat"; + on_dialog_updated(d->dialog_id, "send_update_chat_video_chat"); send_closure(G()->td(), &Td::send_update, - td_api::make_object(d->dialog_id.get(), get_voice_chat_object(d))); + td_api::make_object(d->dialog_id.get(), get_video_chat_object(d))); } void MessagesManager::send_update_chat_message_ttl_setting(const Dialog *d) { @@ -30144,10 +30144,10 @@ void MessagesManager::on_update_dialog_group_call(DialogId dialog_id, bool has_a d->active_group_call_id = InputGroupCallId(); d->has_active_group_call = false; d->is_group_call_empty = false; - send_update_chat_voice_chat(d); + send_update_chat_video_chat(d); } else if (d->has_active_group_call && has_active_group_call) { d->is_group_call_empty = is_group_call_empty; - send_update_chat_voice_chat(d); + send_update_chat_video_chat(d); } else { d->has_active_group_call = has_active_group_call; d->is_group_call_empty = is_group_call_empty; @@ -30176,7 +30176,7 @@ void MessagesManager::on_update_dialog_group_call_id(DialogId dialog_id, InputGr d->is_group_call_empty = false; } } - send_update_chat_voice_chat(d); + send_update_chat_video_chat(d); } } @@ -30206,7 +30206,7 @@ void MessagesManager::on_update_dialog_default_join_group_call_as_dialog_id(Dial if (d->default_join_group_call_as_dialog_id != default_join_as_dialog_id) { d->default_join_group_call_as_dialog_id = default_join_as_dialog_id; - send_update_chat_voice_chat(d); + send_update_chat_video_chat(d); } } @@ -31710,7 +31710,7 @@ tl_object_ptr MessagesManager::get_ch if (filters->invite_link_changes_) { flags |= telegram_api::channelAdminLogEventsFilter::INVITES_MASK; } - if (filters->voice_chat_changes_) { + if (filters->video_chat_changes_) { flags |= telegram_api::channelAdminLogEventsFilter::GROUP_CALL_MASK; } @@ -32029,7 +32029,7 @@ tl_object_ptr MessagesManager::get_chat_event_action_ob if (!input_group_call_id.is_valid()) { return nullptr; } - return make_tl_object( + return make_tl_object( td_->group_call_manager_->get_group_call_id(input_group_call_id, DialogId(channel_id)).get()); } case telegram_api::channelAdminLogEventActionDiscardGroupCall::ID: { @@ -32038,7 +32038,7 @@ tl_object_ptr MessagesManager::get_chat_event_action_ob if (!input_group_call_id.is_valid()) { return nullptr; } - return make_tl_object( + return make_tl_object( td_->group_call_manager_->get_group_call_id(input_group_call_id, DialogId(channel_id)).get()); } case telegram_api::channelAdminLogEventActionParticipantMute::ID: { @@ -32047,8 +32047,8 @@ tl_object_ptr MessagesManager::get_chat_event_action_ob if (!participant.is_valid()) { return nullptr; } - return make_tl_object( - get_message_sender_object(participant.dialog_id, "chatEventVoiceChatParticipantIsMutedToggled"), true); + return make_tl_object( + get_message_sender_object(participant.dialog_id, "chatEventVideoChatParticipantIsMutedToggled"), true); } case telegram_api::channelAdminLogEventActionParticipantUnmute::ID: { auto action = move_tl_object_as(action_ptr); @@ -32056,8 +32056,8 @@ tl_object_ptr MessagesManager::get_chat_event_action_ob if (!participant.is_valid()) { return nullptr; } - return make_tl_object( - get_message_sender_object(participant.dialog_id, "chatEventVoiceChatParticipantIsMutedToggled"), false); + return make_tl_object( + get_message_sender_object(participant.dialog_id, "chatEventVideoChatParticipantIsMutedToggled"), false); } case telegram_api::channelAdminLogEventActionParticipantVolume::ID: { auto action = move_tl_object_as(action_ptr); @@ -32065,13 +32065,13 @@ tl_object_ptr MessagesManager::get_chat_event_action_ob if (!participant.is_valid()) { return nullptr; } - return make_tl_object( - get_message_sender_object(participant.dialog_id, "chatEventVoiceChatParticipantVolumeLevelChanged"), + return make_tl_object( + get_message_sender_object(participant.dialog_id, "chatEventVideoChatParticipantVolumeLevelChanged"), participant.volume_level); } case telegram_api::channelAdminLogEventActionToggleGroupCallSetting::ID: { auto action = move_tl_object_as(action_ptr); - return make_tl_object(action->join_muted_); + return make_tl_object(action->join_muted_); } case telegram_api::channelAdminLogEventActionChangeHistoryTTL::ID: { auto action = move_tl_object_as(action_ptr); diff --git a/td/telegram/MessagesManager.h b/td/telegram/MessagesManager.h index 4d887006f..56c5074f9 100644 --- a/td/telegram/MessagesManager.h +++ b/td/telegram/MessagesManager.h @@ -2344,7 +2344,7 @@ class MessagesManager final : public Actor { void send_update_chat_pending_join_request_count(const Dialog *d); - void send_update_chat_voice_chat(const Dialog *d); + void send_update_chat_video_chat(const Dialog *d); void send_update_chat_message_ttl_setting(const Dialog *d); @@ -2539,7 +2539,7 @@ class MessagesManager final : public Actor { string get_dialog_theme_name(const Dialog *d) const; - td_api::object_ptr get_voice_chat_object(const Dialog *d) const; + td_api::object_ptr get_video_chat_object(const Dialog *d) const; td_api::object_ptr get_chat_object(const Dialog *d) const; diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index 04162fe1e..1d76b82ce 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -5773,13 +5773,13 @@ void Td::on_request(uint64 id, td_api::sendCallDebugInformation &request) { std::move(request.debug_information_), std::move(promise)); } -void Td::on_request(uint64 id, const td_api::getVoiceChatAvailableParticipants &request) { +void Td::on_request(uint64 id, const td_api::getVideoChatAvailableParticipants &request) { CHECK_IS_USER(); CREATE_REQUEST_PROMISE(); group_call_manager_->get_group_call_join_as(DialogId(request.chat_id_), std::move(promise)); } -void Td::on_request(uint64 id, const td_api::setVoiceChatDefaultParticipant &request) { +void Td::on_request(uint64 id, const td_api::setVideoChatDefaultParticipant &request) { CHECK_IS_USER(); CREATE_OK_REQUEST_PROMISE(); group_call_manager_->set_group_call_default_join_as( @@ -5787,7 +5787,7 @@ void Td::on_request(uint64 id, const td_api::setVoiceChatDefaultParticipant &req std::move(promise)); } -void Td::on_request(uint64 id, td_api::createVoiceChat &request) { +void Td::on_request(uint64 id, td_api::createVideoChat &request) { CHECK_IS_USER(); CLEAN_INPUT_STRING(request.title_); CREATE_REQUEST_PROMISE(); diff --git a/td/telegram/Td.h b/td/telegram/Td.h index 964a71d8d..63896f421 100644 --- a/td/telegram/Td.h +++ b/td/telegram/Td.h @@ -724,11 +724,11 @@ class Td final : public Actor { void on_request(uint64 id, td_api::sendCallDebugInformation &request); - void on_request(uint64 id, const td_api::getVoiceChatAvailableParticipants &request); + void on_request(uint64 id, const td_api::getVideoChatAvailableParticipants &request); - void on_request(uint64 id, const td_api::setVoiceChatDefaultParticipant &request); + void on_request(uint64 id, const td_api::setVideoChatDefaultParticipant &request); - void on_request(uint64 id, td_api::createVoiceChat &request); + void on_request(uint64 id, td_api::createVideoChat &request); void on_request(uint64 id, const td_api::getGroupCall &request); diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index d90918443..f15f984a4 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -2780,19 +2780,19 @@ class CliClient final : public Actor { } else if (op == "scdi" || op == "SendCallDebugInformation") { send_request(td_api::make_object(as_call_id(args), "{}")); } else if (op == "gvcap") { - send_request(td_api::make_object(as_chat_id(args))); + send_request(td_api::make_object(as_chat_id(args))); } else if (op == "svcdp") { string chat_id; string participant_id; get_args(args, chat_id, participant_id); - send_request(td_api::make_object(as_chat_id(chat_id), + send_request(td_api::make_object(as_chat_id(chat_id), as_message_sender(participant_id))); } else if (op == "cvc") { string chat_id; string title; int32 start_date; get_args(args, chat_id, title, start_date); - send_request(td_api::make_object(as_chat_id(chat_id), title, start_date)); + send_request(td_api::make_object(as_chat_id(chat_id), title, start_date)); } else if (op == "ggc") { send_request(td_api::make_object(as_group_call_id(args))); } else if (op == "ggcss") { diff --git a/test/link.cpp b/test/link.cpp index 2af303cce..86c9afd1a 100644 --- a/test/link.cpp +++ b/test/link.cpp @@ -171,8 +171,8 @@ TEST(Link, parse_internal_link) { auto unknown_deep_link = [](const td::string &link) { return td::td_api::make_object(link); }; - auto voice_chat = [](const td::string &chat_username, const td::string &invite_hash, bool is_live_stream) { - return td::td_api::make_object(chat_username, invite_hash, is_live_stream); + auto video_chat = [](const td::string &chat_username, const td::string &invite_hash, bool is_live_stream) { + return td::td_api::make_object(chat_username, invite_hash, is_live_stream); }; parse_internal_link("t.me/levlam/1", message("tg:resolve?domain=levlam&post=1")); @@ -524,27 +524,27 @@ TEST(Link, parse_internal_link) { parse_internal_link("tg:socks?server=google.com&port=8%30&user=&pass=2", proxy_socks("google.com", 80, "", "2")); parse_internal_link("tg:socks?server=google.com&port=80&user=1&pass=2", proxy_socks("google.com", 80, "1", "2")); - parse_internal_link("tg:resolve?domain=username&voice%63hat=aasdasd", voice_chat("username", "aasdasd", false)); - parse_internal_link("tg:resolve?domain=username&video%63hat=aasdasd", voice_chat("username", "aasdasd", false)); - parse_internal_link("tg:resolve?domain=username&livestream=aasdasd", voice_chat("username", "aasdasd", true)); - parse_internal_link("TG://resolve?domain=username&voicechat=", voice_chat("username", "", false)); + parse_internal_link("tg:resolve?domain=username&voice%63hat=aasdasd", video_chat("username", "aasdasd", false)); + parse_internal_link("tg:resolve?domain=username&video%63hat=aasdasd", video_chat("username", "aasdasd", false)); + parse_internal_link("tg:resolve?domain=username&livestream=aasdasd", video_chat("username", "aasdasd", true)); + parse_internal_link("TG://resolve?domain=username&voicechat=", video_chat("username", "", false)); parse_internal_link("TG://test@resolve?domain=username&voicechat=", nullptr); parse_internal_link("tg:resolve:80?domain=username&voicechat=", nullptr); parse_internal_link("tg:http://resolve?domain=username&voicechat=", nullptr); parse_internal_link("tg:https://resolve?domain=username&voicechat=", nullptr); parse_internal_link("tg:resolve?domain=&voicechat=", unknown_deep_link("tg://resolve?domain=&voicechat=")); - parse_internal_link("tg:resolve?domain=telegram&&&&&&&voicechat=%30", voice_chat("telegram", "0", false)); + parse_internal_link("tg:resolve?domain=telegram&&&&&&&voicechat=%30", video_chat("telegram", "0", false)); - parse_internal_link("t.me/username/0/a//s/as?voicechat=", voice_chat("username", "", false)); - parse_internal_link("t.me/username/0/a//s/as?videochat=2", voice_chat("username", "2", false)); - parse_internal_link("t.me/username/0/a//s/as?livestream=3", voice_chat("username", "3", true)); - parse_internal_link("t.me/username/aasdas?test=1&voicechat=#12312", voice_chat("username", "", false)); - parse_internal_link("t.me/username/0?voicechat=", voice_chat("username", "", false)); - parse_internal_link("t.me/username/-1?voicechat=asdasd", voice_chat("username", "asdasd", false)); - parse_internal_link("t.me/username?voicechat=", voice_chat("username", "", false)); + parse_internal_link("t.me/username/0/a//s/as?voicechat=", video_chat("username", "", false)); + parse_internal_link("t.me/username/0/a//s/as?videochat=2", video_chat("username", "2", false)); + parse_internal_link("t.me/username/0/a//s/as?livestream=3", video_chat("username", "3", true)); + parse_internal_link("t.me/username/aasdas?test=1&voicechat=#12312", video_chat("username", "", false)); + parse_internal_link("t.me/username/0?voicechat=", video_chat("username", "", false)); + parse_internal_link("t.me/username/-1?voicechat=asdasd", video_chat("username", "asdasd", false)); + parse_internal_link("t.me/username?voicechat=", video_chat("username", "", false)); parse_internal_link("t.me/username#voicechat=asdas", public_chat("username")); parse_internal_link("t.me//username?voicechat=", nullptr); - parse_internal_link("https://telegram.dog/tele%63ram?voi%63e%63hat=t%63st", voice_chat("telecram", "tcst", false)); + parse_internal_link("https://telegram.dog/tele%63ram?voi%63e%63hat=t%63st", video_chat("telecram", "tcst", false)); parse_internal_link("tg:resolve?domain=username&start=aasdasd", bot_start("username", "aasdasd")); parse_internal_link("TG://resolve?domain=username&start=", bot_start("username", ""));