diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 9cab5a650..6414081b3 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -2131,10 +2131,9 @@ groupCallJoinResponse payload:groupCallPayload candidates:vector participants_next_offset:string users:Vector = phone.GroupCall; @@ -1205,7 +1205,9 @@ messages.chatInviteImporters#81b6b00a count:int importers:Vector = messages.AffectedFoundMessages; ---functions--- @@ -1366,7 +1368,7 @@ messages.readMessageContents#36a73f77 id:Vector = messages.AffectedMessages messages.getStickers#43d4f2c emoticon:string hash:int = messages.Stickers; messages.getAllStickers#1c9618b1 hash:int = messages.AllStickers; messages.getWebPagePreview#8b68b0cc flags:# message:string entities:flags.3?Vector = MessageMedia; -messages.exportChatInvite#14b9bcd7 flags:# legacy_revoke_permanent:flags.2?true peer:InputPeer expire_date:flags.0?int usage_limit:flags.1?int = ExportedChatInvite; +messages.exportChatInvite#df7534c peer:InputPeer = ExportedChatInvite; messages.checkChatInvite#3eadb1bb hash:string = ChatInvite; messages.importChatInvite#6c50051c hash:string = Updates; messages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet; @@ -1462,7 +1464,7 @@ messages.deleteRevokedExportedChatInvites#52041463 peer:InputPeer = Bool; messages.deleteExportedChatInvite#d464a42b peer:InputPeer link:string = Bool; messages.getChatInviteImporters#26fb7289 peer:InputPeer link:string offset_date:int offset_user:InputUser limit:int = messages.ChatInviteImporters; messages.deleteChat#83247d11 chat_id:int = Bool; -messages.deletePhoneCallHistory#6cff1b45 flags:# revoke:flags.0?true = messages.AffectedHistory; +messages.deletePhoneCallHistory#f9cbe409 flags:# revoke:flags.0?true = messages.AffectedFoundMessages; messages.checkHistoryImport#43fe19f3 import_head:string = messages.HistoryImportParsed; messages.initHistoryImport#34090c3b peer:InputPeer file:InputFile media_count:int = messages.HistoryImport; messages.uploadImportedMedia#2a862092 peer:InputPeer import_id:long file_name:string media:InputMedia = MessageMedia; diff --git a/td/generate/scheme/telegram_api.tlo b/td/generate/scheme/telegram_api.tlo index 500f36e33..672599f19 100644 Binary files a/td/generate/scheme/telegram_api.tlo and b/td/generate/scheme/telegram_api.tlo differ diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index 86dab206a..dc61580bb 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -1582,7 +1582,9 @@ class ExportChatInviteLinkQuery : public Td::ResultHandler { if (input_peer == nullptr) { return on_error(0, Status::Error(400, "Can't access the chat")); } + CHECK(is_permanent); + /* int32 flags = 0; if (expire_date > 0) { flags |= telegram_api::messages_exportChatInvite::EXPIRE_DATE_MASK; @@ -1593,8 +1595,11 @@ class ExportChatInviteLinkQuery : public Td::ResultHandler { if (is_permanent) { flags |= telegram_api::messages_exportChatInvite::LEGACY_REVOKE_PERMANENT_MASK; } - send_query(G()->net_query_creator().create(telegram_api::messages_exportChatInvite( - flags, false /*ignored*/, std::move(input_peer), expire_date, usage_limit))); + */ + + send_query(G()->net_query_creator().create(telegram_api::messages_exportChatInvite(std::move(input_peer)))); + // send_query(G()->net_query_creator().create(telegram_api::messages_exportChatInvite( + // flags, false /*ignored*/, std::move(input_peer), expire_date, usage_limit))); } void on_result(uint64 id, BufferSlice packet) override { diff --git a/td/telegram/GroupCallParticipant.cpp b/td/telegram/GroupCallParticipant.cpp index 76848c3ab..9eed3f65b 100644 --- a/td/telegram/GroupCallParticipant.cpp +++ b/td/telegram/GroupCallParticipant.cpp @@ -19,13 +19,6 @@ GroupCallParticipant::GroupCallParticipant(const tl_object_ptrmuted_; can_self_unmute = participant->can_self_unmute_; is_muted_only_for_self = participant->muted_by_you_; - if ((participant->flags_ & telegram_api::groupCallParticipant::MUTED_CNT_MASK) != 0) { - muted_count = participant->muted_cnt_; - if (muted_count < 0) { - LOG(ERROR) << "Receive " << to_string(participant); - muted_count = 0; - } - } if ((participant->flags_ & telegram_api::groupCallParticipant::VOLUME_MASK) != 0) { volume_level = participant->volume_; if (volume_level < MIN_VOLUME_LEVEL || volume_level > MAX_VOLUME_LEVEL) { @@ -95,11 +88,11 @@ td_api::object_ptr GroupCallParticipant::get_group return td_api::make_object( contacts_manager->get_user_id_object(user_id, "get_group_call_participant_object"), audio_source, is_speaking, can_be_muted_for_all_users, can_be_unmuted_for_all_users, can_be_muted_only_for_self, - can_be_unmuted_only_for_self, is_muted, can_self_unmute, muted_count, volume_level, order); + can_be_unmuted_only_for_self, is_muted, can_self_unmute, volume_level, order); } bool operator==(const GroupCallParticipant &lhs, const GroupCallParticipant &rhs) { - return lhs.user_id == rhs.user_id && lhs.audio_source == rhs.audio_source && lhs.muted_count == rhs.muted_count && + return lhs.user_id == rhs.user_id && lhs.audio_source == rhs.audio_source && lhs.can_be_muted_for_all_users == rhs.can_be_muted_for_all_users && lhs.can_be_unmuted_for_all_users == rhs.can_be_unmuted_for_all_users && lhs.can_be_muted_only_for_self == rhs.can_be_muted_only_for_self && diff --git a/td/telegram/GroupCallParticipant.h b/td/telegram/GroupCallParticipant.h index e3be59b19..abaff79e5 100644 --- a/td/telegram/GroupCallParticipant.h +++ b/td/telegram/GroupCallParticipant.h @@ -22,7 +22,6 @@ struct GroupCallParticipant { int32 audio_source = 0; int32 joined_date = 0; int32 active_date = 0; - int32 muted_count = 0; int32 volume_level = 10000; bool is_muted = false; bool can_self_unmute = false; diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 4d752f402..5d285e3e7 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -2512,20 +2512,22 @@ class DeletePhoneCallHistoryQuery : public Td::ResultHandler { return on_error(id, result_ptr.move_as_error()); } - auto affected_history = result_ptr.move_as_ok(); - CHECK(affected_history->get_id() == telegram_api::messages_affectedHistory::ID); + auto affected_messages = result_ptr.move_as_ok(); + CHECK(affected_messages->get_id() == telegram_api::messages_affectedFoundMessages::ID); - if (affected_history->pts_count_ > 0) { - affected_history->pts_count_ = 0; // force receiving real updates from the server - auto promise = affected_history->offset_ > 0 ? Promise() : std::move(promise_); - td->updates_manager_->add_pending_pts_update(make_tl_object(), affected_history->pts_, - affected_history->pts_count_, std::move(promise), + if (affected_messages->pts_count_ > 0) { + auto promise = affected_messages->offset_ > 0 ? Promise() : std::move(promise_); + auto pts = affected_messages->pts_; + auto pts_count = affected_messages->pts_count_; + auto update = + make_tl_object(std::move(affected_messages->messages_), pts, pts_count); + td->updates_manager_->add_pending_pts_update(std::move(update), pts, pts_count, std::move(promise), "delete phone call history query"); - } else if (affected_history->offset_ <= 0) { + } else if (affected_messages->offset_ <= 0) { promise_.set_value(Unit()); } - if (affected_history->offset_ > 0) { + if (affected_messages->offset_ > 0) { send_request(); return; } @@ -4278,7 +4280,7 @@ class UpdatePeerSettingsQuery : public Td::ResultHandler { dialog_id_, make_tl_object(0, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, - false /*ignored*/, 0), + false /*ignored*/, false /*ignored*/, 0), true); promise_.set_value(Unit()); @@ -4320,7 +4322,7 @@ class ReportEncryptedSpamQuery : public Td::ResultHandler { dialog_id_, make_tl_object(0, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, - false /*ignored*/, 0), + false /*ignored*/, false /*ignored*/, 0), true); promise_.set_value(Unit());