mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-31 17:41:16 +00:00
Merge tag 'v5.13.1' into dev
This commit is contained in:
@@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "data/data_user.h"
|
||||
|
||||
#include "api/api_credits.h"
|
||||
#include "api/api_global_privacy.h"
|
||||
#include "api/api_sensitive_content.h"
|
||||
#include "api/api_statistics.h"
|
||||
#include "storage/localstorage.h"
|
||||
@@ -673,6 +674,13 @@ bool UserData::hasCalls() const {
|
||||
&& (callsStatus() != CallsStatus::Unknown);
|
||||
}
|
||||
|
||||
void UserData::setDisallowedGiftTypes(Api::DisallowedGiftTypes types) {
|
||||
if (_disallowedGiftTypes != types) {
|
||||
_disallowedGiftTypes = types;
|
||||
session().changes().peerUpdated(this, UpdateFlag::GiftSettings);
|
||||
}
|
||||
}
|
||||
|
||||
namespace Data {
|
||||
|
||||
void ApplyUserUpdate(not_null<UserData*> user, const MTPDuserFull &update) {
|
||||
@@ -829,6 +837,31 @@ void ApplyUserUpdate(not_null<UserData*> user, const MTPDuserFull &update) {
|
||||
user->setBotVerifyDetails(
|
||||
ParseBotVerifyDetails(update.vbot_verification()));
|
||||
|
||||
if (const auto gifts = update.vdisallowed_gifts()) {
|
||||
const auto &data = gifts->data();
|
||||
user->setDisallowedGiftTypes(Api::DisallowedGiftType()
|
||||
| (data.is_disallow_unlimited_stargifts()
|
||||
? Api::DisallowedGiftType::Unlimited
|
||||
: Api::DisallowedGiftType())
|
||||
| (data.is_disallow_limited_stargifts()
|
||||
? Api::DisallowedGiftType::Limited
|
||||
: Api::DisallowedGiftType())
|
||||
| (data.is_disallow_unique_stargifts()
|
||||
? Api::DisallowedGiftType::Unique
|
||||
: Api::DisallowedGiftType())
|
||||
| (data.is_disallow_premium_gifts()
|
||||
? Api::DisallowedGiftType::Premium
|
||||
: Api::DisallowedGiftType())
|
||||
| (update.is_display_gifts_button()
|
||||
? Api::DisallowedGiftType::SendHide
|
||||
: Api::DisallowedGiftType()));
|
||||
} else {
|
||||
user->setDisallowedGiftTypes(Api::DisallowedGiftTypes()
|
||||
| (update.is_display_gifts_button()
|
||||
? Api::DisallowedGiftType::SendHide
|
||||
: Api::DisallowedGiftType()));
|
||||
}
|
||||
|
||||
user->owner().stories().apply(user, update.vstories());
|
||||
|
||||
user->fullUpdated();
|
||||
|
||||
Reference in New Issue
Block a user