From 9255d32af1e7c2b164f8543405b7cabe6a5012f8 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 20 Mar 2024 23:25:38 +0300 Subject: [PATCH] Remove *_FULL flags. --- td/telegram/ContactsManager.cpp | 10 +++--- td/telegram/ContactsManager.h | 55 --------------------------------- 2 files changed, 5 insertions(+), 60 deletions(-) diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index f244def9c..47981557a 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -10768,10 +10768,10 @@ void ContactsManager::on_get_chat_full(tl_object_ptr &&c ChannelFull *channel_full = add_channel_full(channel_id); - bool have_participant_count = (channel->flags_ & CHANNEL_FULL_FLAG_HAS_PARTICIPANT_COUNT) != 0; + bool have_participant_count = (channel->flags_ & telegram_api::channelFull::PARTICIPANTS_COUNT_MASK) != 0; auto participant_count = have_participant_count ? channel->participants_count_ : channel_full->participant_count; auto administrator_count = 0; - if ((channel->flags_ & CHANNEL_FULL_FLAG_HAS_ADMINISTRATOR_COUNT) != 0) { + if ((channel->flags_ & telegram_api::channelFull::ADMINS_COUNT_MASK) != 0) { administrator_count = channel->admins_count_; } else if (c->is_megagroup || c->status.is_administrator()) { // in megagroups and administered channels don't drop known number of administrators @@ -10804,7 +10804,7 @@ void ContactsManager::on_get_chat_full(tl_object_ptr &&c td_->stickers_manager_->on_get_sticker_set(std::move(channel->emojiset_), true, "on_get_channel_full"); } DcId stats_dc_id; - if ((channel->flags_ & CHANNEL_FULL_FLAG_HAS_STATISTICS_DC_ID) != 0) { + if ((channel->flags_ & telegram_api::channelFull::STATS_DC_MASK) != 0) { stats_dc_id = DcId::create(channel->stats_dc_); } if (!stats_dc_id.is_exact() && can_view_statistics) { @@ -10876,7 +10876,7 @@ void ContactsManager::on_get_chat_full(tl_object_ptr &&c td_->messages_manager_->on_read_channel_outbox(channel_id, MessageId(ServerMessageId(channel->read_outbox_max_id_))); - if ((channel->flags_ & CHANNEL_FULL_FLAG_HAS_AVAILABLE_MIN_MESSAGE_ID) != 0) { + if ((channel->flags_ & telegram_api::channelFull::AVAILABLE_MIN_ID_MASK) != 0) { td_->messages_manager_->on_update_channel_max_unavailable_message_id( channel_id, MessageId(ServerMessageId(channel->available_min_id_)), "ChannelFull"); } @@ -10944,7 +10944,7 @@ void ContactsManager::on_get_chat_full(tl_object_ptr &&c } ChannelId linked_channel_id; - if ((channel->flags_ & CHANNEL_FULL_FLAG_HAS_LINKED_CHANNEL_ID) != 0) { + if ((channel->flags_ & telegram_api::channelFull::LINKED_CHAT_ID_MASK) != 0) { linked_channel_id = ChannelId(channel->linked_chat_id_); auto linked_channel = get_channel_force(linked_channel_id, "ChannelFull"); if (linked_channel == nullptr || c->is_megagroup == linked_channel->is_megagroup || diff --git a/td/telegram/ContactsManager.h b/td/telegram/ContactsManager.h index 9f89ef1e2..b44a038e4 100644 --- a/td/telegram/ContactsManager.h +++ b/td/telegram/ContactsManager.h @@ -1166,22 +1166,6 @@ class ContactsManager final : public Actor { static constexpr int32 USER_FLAG_CAN_BE_EDITED_BOT = 1 << 1; static constexpr int32 USER_FLAG_IS_CLOSE_FRIEND = 1 << 2; - static constexpr int32 USER_FULL_FLAG_IS_BLOCKED = 1 << 0; - static constexpr int32 USER_FULL_FLAG_HAS_ABOUT = 1 << 1; - static constexpr int32 USER_FULL_FLAG_HAS_PHOTO = 1 << 2; - static constexpr int32 USER_FULL_FLAG_HAS_BOT_INFO = 1 << 3; - static constexpr int32 USER_FULL_FLAG_HAS_PINNED_MESSAGE = 1 << 6; - static constexpr int32 USER_FULL_FLAG_CAN_PIN_MESSAGE = 1 << 7; - static constexpr int32 USER_FULL_FLAG_HAS_FOLDER_ID = 1 << 11; - static constexpr int32 USER_FULL_FLAG_HAS_SCHEDULED_MESSAGES = 1 << 12; - static constexpr int32 USER_FULL_FLAG_HAS_MESSAGE_TTL = 1 << 14; - static constexpr int32 USER_FULL_FLAG_HAS_PRIVATE_FORWARD_NAME = 1 << 16; - static constexpr int32 USER_FULL_FLAG_HAS_GROUP_ADMINISTRATOR_RIGHTS = 1 << 17; - static constexpr int32 USER_FULL_FLAG_HAS_BROADCAST_ADMINISTRATOR_RIGHTS = 1 << 18; - static constexpr int32 USER_FULL_FLAG_HAS_VOICE_MESSAGES_FORBIDDEN = 1 << 20; - static constexpr int32 USER_FULL_FLAG_HAS_PERSONAL_PHOTO = 1 << 21; - static constexpr int32 USER_FULL_FLAG_HAS_FALLBACK_PHOTO = 1 << 22; - static constexpr int32 CHAT_FLAG_USER_IS_CREATOR = 1 << 0; static constexpr int32 CHAT_FLAG_USER_HAS_LEFT = 1 << 2; // static constexpr int32 CHAT_FLAG_ADMINISTRATORS_ENABLED = 1 << 3; @@ -1192,14 +1176,6 @@ class ContactsManager final : public Actor { static constexpr int32 CHAT_FLAG_IS_GROUP_CALL_NON_EMPTY = 1 << 24; static constexpr int32 CHAT_FLAG_NOFORWARDS = 1 << 25; - static constexpr int32 CHAT_FULL_FLAG_HAS_PINNED_MESSAGE = 1 << 6; - static constexpr int32 CHAT_FULL_FLAG_HAS_SCHEDULED_MESSAGES = 1 << 8; - static constexpr int32 CHAT_FULL_FLAG_HAS_FOLDER_ID = 1 << 11; - static constexpr int32 CHAT_FULL_FLAG_HAS_ACTIVE_GROUP_CALL = 1 << 12; - static constexpr int32 CHAT_FULL_FLAG_HAS_MESSAGE_TTL = 1 << 14; - static constexpr int32 CHAT_FULL_FLAG_HAS_PENDING_REQUEST_COUNT = 1 << 17; - static constexpr int32 CHAT_FULL_FLAG_HAS_AVAILABLE_REACTIONS = 1 << 18; - static constexpr int32 CHANNEL_FLAG_USER_IS_CREATOR = 1 << 0; static constexpr int32 CHANNEL_FLAG_USER_HAS_LEFT = 1 << 2; static constexpr int32 CHANNEL_FLAG_IS_BROADCAST = 1 << 5; @@ -1229,37 +1205,6 @@ class ContactsManager final : public Actor { static constexpr int32 CHANNEL_FLAG_IS_FORUM = 1 << 30; static constexpr int32 CHANNEL_FLAG_HAS_USERNAMES = 1 << 0; - static constexpr int32 CHANNEL_FULL_FLAG_HAS_PARTICIPANT_COUNT = 1 << 0; - static constexpr int32 CHANNEL_FULL_FLAG_HAS_ADMINISTRATOR_COUNT = 1 << 1; - static constexpr int32 CHANNEL_FULL_FLAG_HAS_BANNED_COUNT = 1 << 2; - static constexpr int32 CHANNEL_FULL_FLAG_CAN_GET_PARTICIPANTS = 1 << 3; - static constexpr int32 CHANNEL_FULL_FLAG_MIGRATED_FROM = 1 << 4; - static constexpr int32 CHANNEL_FULL_FLAG_HAS_PINNED_MESSAGE = 1 << 5; - static constexpr int32 CHANNEL_FULL_FLAG_CAN_SET_USERNAME = 1 << 6; - static constexpr int32 CHANNEL_FULL_FLAG_CAN_SET_STICKER_SET = 1 << 7; - static constexpr int32 CHANNEL_FULL_FLAG_HAS_STICKER_SET = 1 << 8; - static constexpr int32 CHANNEL_FULL_FLAG_HAS_AVAILABLE_MIN_MESSAGE_ID = 1 << 9; - static constexpr int32 CHANNEL_FULL_FLAG_IS_ALL_HISTORY_HIDDEN = 1 << 10; - static constexpr int32 CHANNEL_FULL_FLAG_HAS_FOLDER_ID = 1 << 11; - static constexpr int32 CHANNEL_FULL_FLAG_HAS_STATISTICS_DC_ID = 1 << 12; - static constexpr int32 CHANNEL_FULL_FLAG_HAS_ONLINE_MEMBER_COUNT = 1 << 13; - static constexpr int32 CHANNEL_FULL_FLAG_HAS_LINKED_CHANNEL_ID = 1 << 14; - static constexpr int32 CHANNEL_FULL_FLAG_HAS_LOCATION = 1 << 15; - static constexpr int32 CHANNEL_FULL_FLAG_CAN_SET_LOCATION = 1 << 16; - static constexpr int32 CHANNEL_FULL_FLAG_HAS_SLOW_MODE_DELAY = 1 << 17; - static constexpr int32 CHANNEL_FULL_FLAG_HAS_SLOW_MODE_NEXT_SEND_DATE = 1 << 18; - static constexpr int32 CHANNEL_FULL_FLAG_HAS_SCHEDULED_MESSAGES = 1 << 19; - static constexpr int32 CHANNEL_FULL_FLAG_CAN_VIEW_STATISTICS = 1 << 20; - static constexpr int32 CHANNEL_FULL_FLAG_HAS_ACTIVE_GROUP_CALL = 1 << 21; - static constexpr int32 CHANNEL_FULL_FLAG_IS_BLOCKED = 1 << 22; - static constexpr int32 CHANNEL_FULL_FLAG_HAS_EXPORTED_INVITE = 1 << 23; - static constexpr int32 CHANNEL_FULL_FLAG_HAS_MESSAGE_TTL = 1 << 24; - static constexpr int32 CHANNEL_FULL_FLAG_HAS_PENDING_REQUEST_COUNT = 1 << 28; - static constexpr int32 CHANNEL_FULL_FLAG_HAS_DEFAULT_SEND_AS = 1 << 29; - static constexpr int32 CHANNEL_FULL_FLAG_HAS_AVAILABLE_REACTIONS = 1 << 30; - static constexpr int32 CHANNEL_FULL_FLAG2_HAS_ANTISPAM = 1 << 1; - static constexpr int32 CHANNEL_FULL_FLAG2_ARE_PARTICIPANTS_HIDDEN = 1 << 2; - static constexpr int32 USER_FULL_EXPIRE_TIME = 60; static constexpr int32 CHANNEL_FULL_EXPIRE_TIME = 60;