2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Moved ChatRestrictionsInfo and ChatAdminRightsInfo to separated file.

This commit is contained in:
23rd
2021-11-21 22:48:08 +03:00
committed by John Preston
parent 30cd3cb681
commit 0eee937e6d
14 changed files with 160 additions and 132 deletions

View File

@@ -1069,24 +1069,6 @@ void PeerData::setMessagesTTL(TimeId period) {
namespace Data {
std::vector<ChatRestrictions> ListOfRestrictions() {
using Flag = ChatRestriction;
return {
Flag::SendMessages,
Flag::SendMedia,
Flag::SendStickers
| Flag::SendGifs
| Flag::SendGames
| Flag::SendInline,
Flag::EmbedLinks,
Flag::SendPolls,
Flag::InviteUsers,
Flag::PinMessages,
Flag::ChangeInfo,
};
}
std::optional<QString> RestrictionError(
not_null<PeerData*> peer,
ChatRestriction restriction) {
@@ -1275,22 +1257,4 @@ std::optional<int> ResolvePinnedCount(
: std::nullopt;
}
ChatAdminRights ChatAdminRightsFlags(const MTPChatAdminRights &rights) {
return rights.match([](const MTPDchatAdminRights &data) {
return ChatAdminRights::from_raw(int32(data.vflags().v));
});
}
ChatRestrictions ChatBannedRightsFlags(const MTPChatBannedRights &rights) {
return rights.match([](const MTPDchatBannedRights &data) {
return ChatRestrictions::from_raw(int32(data.vflags().v));
});
}
TimeId ChatBannedRightsUntilDate(const MTPChatBannedRights &rights) {
return rights.match([](const MTPDchatBannedRights &data) {
return data.vuntil_date().v;
});
}
} // namespace Data