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:
@@ -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
|
||||
|
Reference in New Issue
Block a user