2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 00:46:08 +00:00

Support 18+/restrictions for messages.

This commit is contained in:
John Preston
2024-08-14 15:17:59 +02:00
parent 074dbf41e0
commit b9de12fedb
35 changed files with 711 additions and 299 deletions

View File

@@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "data/data_user.h"
#include "api/api_sensitive_content.h"
#include "storage/localstorage.h"
#include "storage/storage_user_photos.h"
#include "main/main_session.h"
@@ -117,14 +118,9 @@ auto UserData::unavailableReasons() const
return _unavailableReasons;
}
void UserData::setUnavailableReasons(
void UserData::setUnavailableReasonsList(
std::vector<Data::UnavailableReason> &&reasons) {
if (_unavailableReasons != reasons) {
_unavailableReasons = std::move(reasons);
session().changes().peerUpdated(
this,
UpdateFlag::UnavailableReason);
}
_unavailableReasons = std::move(reasons);
}
void UserData::setCommonChatsCount(int count) {
@@ -516,6 +512,10 @@ void UserData::setBirthday(Data::Birthday value) {
if (_birthday != value) {
_birthday = value;
session().changes().peerUpdated(this, UpdateFlag::Birthday);
if (isSelf()) {
session().api().sensitiveContent().reload(true);
}
}
}