2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Handle ttl_period locally.

This commit is contained in:
John Preston
2021-02-02 20:38:30 +04:00
parent 046a3906c4
commit 6a6e355af4
13 changed files with 282 additions and 69 deletions

View File

@@ -84,6 +84,11 @@ bool ChatData::canEditPreHistoryHidden() const {
return amCreator();
}
bool ChatData::canDeleteMessages() const {
return amCreator()
|| (adminRights() & AdminRight::f_delete_messages);
}
bool ChatData::canAddMembers() const {
return amIn() && !amRestricted(Restriction::f_invite_users);
}
@@ -372,6 +377,9 @@ void ApplyChatUpdate(not_null<ChatData*> chat, const MTPDchatFull &update) {
chat->clearGroupCall();
}
if (const auto ttl = update.vttl()) {
chat->applyMessagesTTL(*ttl);
}
if (const auto info = update.vbot_info()) {
for (const auto &item : info->v) {
item.match([&](const MTPDbotInfo &data) {