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

Added usernames info to UserData.

This commit is contained in:
23rd
2022-10-09 14:25:47 +03:00
committed by John Preston
parent 51cead1445
commit ffa8a94180
3 changed files with 30 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "mainwidget.h"
#include "api/api_bot.h"
#include "api/api_text_entities.h"
#include "api/api_user_names.h"
#include "core/application.h"
#include "core/core_settings.h"
#include "core/mime_type.h" // Core::IsMimeSticker
@@ -583,6 +584,15 @@ not_null<UserData*> Session::processUser(const MTPUser &data) {
result->setAccessHash(accessHash->v);
}
status = data.vstatus();
{
const auto newUsername = uname;
const auto newUsernames = data.vusernames()
? Api::Usernames::FromTL(*data.vusernames())
: !newUsername.isEmpty()
? Data::Usernames{{ newUsername, true, true }}
: Data::Usernames();
result->setUsernames(newUsernames);
}
}
if (const auto &status = data.vemoji_status()) {
result->setEmojiStatus(*status);