Merge tag 'v4.16.0' into dev

# Conflicts:
#	README.md
#	Telegram/Resources/winrc/Telegram.rc
#	Telegram/Resources/winrc/Updater.rc
#	Telegram/SourceFiles/calls/calls_call.cpp
#	Telegram/SourceFiles/core/local_url_handlers.cpp
#	Telegram/SourceFiles/core/version.h
#	Telegram/SourceFiles/history/view/media/history_view_giveaway.cpp
#	Telegram/SourceFiles/history/view/media/history_view_sticker.cpp
#	Telegram/lib_ui
#	snap/snapcraft.yaml
This commit is contained in:
AlexeyZavar
2024-04-01 23:56:12 +03:00
511 changed files with 21299 additions and 4877 deletions
+49 -2
View File
@@ -200,6 +200,23 @@ void UserData::setBusinessDetails(Data::BusinessDetails details) {
session().changes().peerUpdated(this, UpdateFlag::BusinessDetails);
}
ChannelId UserData::personalChannelId() const {
return _personalChannelId;
}
MsgId UserData::personalChannelMessageId() const {
return _personalChannelMessageId;
}
void UserData::setPersonalChannel(ChannelId channelId, MsgId messageId) {
if (_personalChannelId != channelId
|| _personalChannelMessageId != messageId) {
_personalChannelId = channelId;
_personalChannelMessageId = messageId;
session().changes().peerUpdated(this, UpdateFlag::PersonalChannel);
}
}
void UserData::setName(const QString &newFirstName, const QString &newLastName, const QString &newPhoneName, const QString &newUsername) {
bool changeName = !newFirstName.isEmpty() || !newLastName.isEmpty();
@@ -496,6 +513,30 @@ void UserData::setCallsStatus(CallsStatus callsStatus) {
}
}
Data::Birthday UserData::birthday() const {
return _birthday;
}
void UserData::setBirthday(Data::Birthday value) {
if (_birthday != value) {
_birthday = value;
session().changes().peerUpdated(this, UpdateFlag::Birthday);
}
}
void UserData::setBirthday(const tl::conditional<MTPBirthday> &value) {
if (!value) {
setBirthday(Data::Birthday());
} else {
const auto &data = value->data();
setBirthday(Data::Birthday(
data.vday().v,
data.vmonth().v,
data.vyear().value_or_empty()));
}
}
bool UserData::hasCalls() const {
return (callsStatus() != CallsStatus::Disabled)
&& (callsStatus() != CallsStatus::Unknown);
@@ -526,7 +567,7 @@ void ApplyUserUpdate(not_null<UserData*> user, const MTPDuserFull &update) {
));
}
}
user->setSettings(update.vsettings());
user->setBarSettings(update.vsettings());
user->owner().notifySettings().apply(user, update.vnotify_settings());
user->setMessagesTTL(update.vttl_period().value_or_empty());
@@ -608,8 +649,14 @@ void ApplyUserUpdate(not_null<UserData*> user, const MTPDuserFull &update) {
}
user->setBusinessDetails(FromMTP(
&user->owner(),
update.vbusiness_work_hours(),
update.vbusiness_location()));
update.vbusiness_location(),
update.vbusiness_intro()));
user->setBirthday(update.vbirthday());
user->setPersonalChannel(
update.vpersonal_channel_id().value_or_empty(),
update.vpersonal_channel_message().value_or_empty());
if (user->isSelf()) {
user->owner().businessInfo().applyAwaySettings(
FromMTP(&user->owner(), update.vbusiness_away_message()));