Update API scheme to layer 214. Start themes.

This commit is contained in:
John Preston
2025-08-26 18:03:15 +04:00
parent 4ed266780a
commit 9e8ae54821
22 changed files with 426 additions and 103 deletions
+11 -1
View File
@@ -19,6 +19,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/business/data_business_common.h"
#include "data/business/data_business_info.h"
#include "data/components/credits.h"
#include "data/data_cloud_themes.h"
#include "data/data_saved_music.h"
#include "data/data_session.h"
#include "data/data_changes.h"
@@ -789,7 +790,16 @@ void ApplyUserUpdate(not_null<UserData*> user, const MTPDuserFull &update) {
user->setCommonChatsCount(update.vcommon_chats_count().v);
user->setPeerGiftsCount(update.vstargifts_count().value_or_empty());
user->checkFolder(update.vfolder_id().value_or_empty());
user->setThemeEmoji(qs(update.vtheme_emoticon().value_or_empty()));
if (const auto theme = update.vtheme()) {
theme->match([&](const MTPDchatTheme &data) {
user->setThemeToken(qs(data.vemoticon()));
}, [&](const MTPDchatThemeUniqueGift &data) {
user->setThemeToken(
user->owner().cloudThemes().processGiftThemeGetToken(data));
});
} else {
user->setThemeToken(QString());
}
user->setTranslationDisabled(update.is_translations_disabled());
user->setPrivateForwardName(
update.vprivate_forward_name().value_or_empty());