mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
Update API scheme to layer 150.
This commit is contained in:
@@ -936,12 +936,14 @@ void ApplyChannelUpdate(
|
||||
| Flag::CanViewParticipants
|
||||
| Flag::CanSetStickers
|
||||
| Flag::PreHistoryHidden
|
||||
| Flag::AntiSpam
|
||||
| Flag::Location;
|
||||
channel->setFlags((channel->flags() & ~mask)
|
||||
| (update.is_can_set_username() ? Flag::CanSetUsername : Flag())
|
||||
| (update.is_can_view_participants() ? Flag::CanViewParticipants : Flag())
|
||||
| (update.is_can_set_stickers() ? Flag::CanSetStickers : Flag())
|
||||
| (update.is_hidden_prehistory() ? Flag::PreHistoryHidden : Flag())
|
||||
| (update.is_antispam() ? Flag::AntiSpam : Flag())
|
||||
| (update.vlocation() ? Flag::Location : Flag()));
|
||||
channel->setUserpicPhoto(update.vchat_photo());
|
||||
if (const auto migratedFrom = update.vmigrated_from_chat_id()) {
|
||||
|
||||
@@ -57,6 +57,7 @@ enum class ChannelDataFlag {
|
||||
JoinToWrite = (1 << 21),
|
||||
RequestToJoin = (1 << 22),
|
||||
Forum = (1 << 23),
|
||||
AntiSpam = (1 << 24),
|
||||
};
|
||||
inline constexpr bool is_flag_type(ChannelDataFlag) { return true; };
|
||||
using ChannelDataFlags = base::flags<ChannelDataFlag>;
|
||||
@@ -274,6 +275,9 @@ public:
|
||||
[[nodiscard]] bool requestToJoin() const {
|
||||
return flags() & Flag::RequestToJoin;
|
||||
}
|
||||
[[nodiscard]] bool antiSpamMode() const {
|
||||
return flags() & Flag::AntiSpam;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto adminRights() const {
|
||||
return _adminRights.current();
|
||||
|
||||
@@ -386,7 +386,8 @@ void ForumTopic::setClosedAndSave(bool closed) {
|
||||
MTP_int(_rootId),
|
||||
MTPstring(), // title
|
||||
MTPlong(), // icon_emoji_id
|
||||
MTP_bool(closed)
|
||||
MTP_bool(closed),
|
||||
MTPBool() // hidden
|
||||
)).done([=](const MTPUpdates &result) {
|
||||
api->applyUpdates(result);
|
||||
}).fail([=](const MTP::Error &error) {
|
||||
|
||||
Reference in New Issue
Block a user