Skip to content

Commit

Permalink
Updated to 5.4.6.
Browse files Browse the repository at this point in the history
  • Loading branch information
23rd committed Sep 4, 2024
2 parents e022bec + 5024f1d commit 02f719a
Show file tree
Hide file tree
Showing 78 changed files with 1,053 additions and 195 deletions.
1 change: 1 addition & 0 deletions Telegram/Resources/langs/lang.strings
Original file line number Diff line number Diff line change
Expand Up @@ -3384,6 +3384,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_context_promote_admin" = "Promote to admin";
"lng_context_edit_permissions" = "Edit permissions";
"lng_context_restrict_user" = "Restrict user";
"lng_context_ban_user" = "Ban";
"lng_context_remove_from_group" = "Remove from group";
"lng_context_add_to_group" = "Add to group";

Expand Down
2 changes: 1 addition & 1 deletion Telegram/Resources/uwp/AppX/AppxManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Identity Name="TelegramMessengerLLP.TelegramDesktop"
ProcessorArchitecture="ARCHITECTURE"
Publisher="CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A"
Version="5.4.5.0" />
Version="5.4.6.0" />
<Properties>
<DisplayName>Telegram Desktop</DisplayName>
<PublisherDisplayName>Telegram Messenger LLP</PublisherDisplayName>
Expand Down
8 changes: 4 additions & 4 deletions Telegram/Resources/winrc/Telegram.rc
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 5,4,5,0
PRODUCTVERSION 5,4,5,0
FILEVERSION 5,4,6,0
PRODUCTVERSION 5,4,6,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -62,10 +62,10 @@ BEGIN
BEGIN
VALUE "CompanyName", ""
VALUE "FileDescription", "Telegram Desktop"
VALUE "FileVersion", "5.4.5.0"
VALUE "FileVersion", "5.4.6.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2024"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "5.4.5.0"
VALUE "ProductVersion", "5.4.6.0"
END
END
BLOCK "VarFileInfo"
Expand Down
8 changes: 4 additions & 4 deletions Telegram/Resources/winrc/Updater.rc
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 5,4,5,0
PRODUCTVERSION 5,4,5,0
FILEVERSION 5,4,6,0
PRODUCTVERSION 5,4,6,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -53,10 +53,10 @@ BEGIN
BEGIN
VALUE "CompanyName", ""
VALUE "FileDescription", "Telegram Desktop Updater"
VALUE "FileVersion", "5.4.5.0"
VALUE "FileVersion", "5.4.6.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2024"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "5.4.5.0"
VALUE "ProductVersion", "5.4.6.0"
END
END
BLOCK "VarFileInfo"
Expand Down
5 changes: 0 additions & 5 deletions Telegram/SourceFiles/api/api_cloud_password.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@ auto CloudPassword::stateCurrent() const
auto CloudPassword::resetPassword()
-> rpl::producer<CloudPassword::ResetRetryDate, QString> {
return [=](auto consumer) {
base::call_delayed(3000, [=] {
consumer.put_next_copy(base::unixtime::now() + 86400);
consumer.put_done();
});
return rpl::lifetime();
_api.request(MTPaccount_ResetPassword(
)).done([=](const MTPaccount_ResetPasswordResult &result) {
result.match([&](const MTPDaccount_resetPasswordOk &data) {
Expand Down
5 changes: 4 additions & 1 deletion Telegram/SourceFiles/api/api_who_reacted.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@ struct State {

[[nodiscard]] QImage GenerateUserpic(Userpic &userpic, int size) {
size *= style::DevicePixelRatio();
auto result = userpic.peer->generateUserpicImage(userpic.view, size);
auto result = PeerData::GenerateUserpicImage(
userpic.peer,
userpic.view,
size);
result.setDevicePixelRatio(style::DevicePixelRatio());
return result;
}
Expand Down
2 changes: 0 additions & 2 deletions Telegram/SourceFiles/boxes/boxes.style
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,6 @@ rightsHeaderLabel: FlatLabel(boxLabel) {
}
textFg: windowActiveTextFg;
}
rightsUntilMargin: margins(0px, 8px, 0px, 20px);
rightsRankMargin: margins(0px, 7px, 0px, 20px);

groupStickersRemove: defaultMultiSelectSearchCancel;
groupStickersRemovePosition: point(6px, 6px);
Expand Down
2 changes: 1 addition & 1 deletion Telegram/SourceFiles/boxes/edit_privacy_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ PaintRoundImageCallback PremiumsRow::generatePaintUserpicCallback(
const auto radius = size * Ui::ForumUserpicRadiusMultiplier();
p.drawRoundedRect(x, y, size, size, radius, radius);
}
st::settingsPrivacyPremium.paintInCenter(p, { x, y, size, size });
st::settingsPrivacyPremium.paintInCenter(p, QRect(x, y, size, size));
};
}

Expand Down
5 changes: 3 additions & 2 deletions Telegram/SourceFiles/boxes/filters/edit_filter_links.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ For license and copyright information please follow this link:
#include "ui/wrap/vertical_layout.h"
#include "ui/wrap/slide_wrap.h"
#include "ui/painter.h"
#include "ui/rect.h"
#include "ui/vertical_list.h"
#include "window/window_session_controller.h"
#include "styles/style_info.h"
Expand Down Expand Up @@ -965,9 +966,9 @@ void LinksController::rowPaintIcon(
p.setBrush(*bg);
{
auto hq = PainterHighQualityEnabler(p);
p.drawEllipse(QRect(0, 0, inner, inner));
p.drawEllipse(Rect(Size(inner)));
}
st::inviteLinkIcon.paintInCenter(p, { 0, 0, inner, inner });
st::inviteLinkIcon.paintInCenter(p, Rect(Size(inner)));
}
p.drawImage(x + skip, y + skip, icon);
}
Expand Down
8 changes: 5 additions & 3 deletions Telegram/SourceFiles/boxes/moderate_messages_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,14 +436,16 @@ void CreateModerateMessagesBox(
return result;
}();

auto [checkboxes, getRestrictions, changes] = CreateEditRestrictions(
box,
Ui::AddSubsectionTitle(
inner,
rpl::conditional(
rpl::single(isSingle),
tr::lng_restrict_users_part_single_header(),
tr::lng_restrict_users_part_header(
lt_count,
rpl::single(participants.size()) | tr::to_count())),
rpl::single(participants.size()) | tr::to_count())));
auto [checkboxes, getRestrictions, changes] = CreateEditRestrictions(
box,
prepareFlags,
disabledMessages,
{ .isForum = peer->isForum() });
Expand Down
33 changes: 21 additions & 12 deletions Telegram/SourceFiles/boxes/peers/edit_participant_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ For license and copyright information please follow this link:

#include "lang/lang_keys.h"
#include "ui/controls/userpic_button.h"
#include "ui/vertical_list.h"
#include "ui/wrap/vertical_layout.h"
#include "ui/wrap/padding_wrap.h"
#include "ui/wrap/slide_wrap.h"
Expand Down Expand Up @@ -63,6 +64,10 @@ class EditParticipantBox::Inner : public Ui::RpWidget {
template <typename Widget>
Widget *addControl(object_ptr<Widget> widget, QMargins margin);

[[nodiscard]] not_null<Ui::VerticalLayout*> verticalLayout() const {
return _rows;
}

protected:
int resizeGetHeight(int newWidth) override;
void paintEvent(QPaintEvent *e) override;
Expand Down Expand Up @@ -164,6 +169,10 @@ EditParticipantBox::EditParticipantBox(
, _hasAdminRights(hasAdminRights) {
}

not_null<Ui::VerticalLayout*> EditParticipantBox::verticalLayout() const {
return _inner->verticalLayout();
}

void EditParticipantBox::prepare() {
_inner = setInnerWidget(object_ptr<Inner>(
this,
Expand Down Expand Up @@ -279,9 +288,8 @@ void EditAdminBox::prepare() {
object_ptr<Ui::VerticalLayout>(this)));
const auto inner = _adminControlsWrap->entity();

inner->add(
object_ptr<Ui::BoxContentDivider>(inner),
st::rightsDividerMargin);
Ui::AddDivider(inner);
Ui::AddSkip(inner);

const auto chat = peer()->asChat();
const auto channel = peer()->asChannel();
Expand Down Expand Up @@ -335,9 +343,9 @@ void EditAdminBox::prepare() {
.isForum = peer()->isForum(),
.anyoneCanAddMembers = anyoneCanAddMembers,
};
Ui::AddSubsectionTitle(inner, tr::lng_rights_edit_admin_header());
auto [checkboxes, getChecked, changes] = CreateEditAdminRights(
inner,
tr::lng_rights_edit_admin_header(),
prepareFlags,
disabledMessages,
options);
Expand Down Expand Up @@ -441,9 +449,7 @@ void EditAdminBox::refreshButtons() {

not_null<Ui::InputField*> EditAdminBox::addRankInput(
not_null<Ui::VerticalLayout*> container) {
container->add(
object_ptr<Ui::BoxContentDivider>(container),
st::rightsRankMargin);
Ui::AddDivider(container);

container->add(
object_ptr<Ui::FlatLabel>(
Expand Down Expand Up @@ -712,9 +718,8 @@ void EditRestrictedBox::prepare() {

setTitle(tr::lng_rights_user_restrictions());

addControl(
object_ptr<Ui::BoxContentDivider>(this),
st::rightsDividerMargin);
Ui::AddDivider(verticalLayout());
Ui::AddSkip(verticalLayout());

const auto chat = peer()->asChat();
const auto channel = peer()->asChannel();
Expand Down Expand Up @@ -749,16 +754,20 @@ void EditRestrictedBox::prepare() {
return result;
}();

Ui::AddSubsectionTitle(
verticalLayout(),
tr::lng_rights_user_restrictions_header());
auto [checkboxes, getRestrictions, changes] = CreateEditRestrictions(
this,
tr::lng_rights_user_restrictions_header(),
prepareFlags,
disabledMessages,
{ .isForum = peer()->isForum() });
addControl(std::move(checkboxes), QMargins());

_until = prepareRights.until;
addControl(object_ptr<Ui::BoxContentDivider>(this), st::rightsUntilMargin);
addControl(
object_ptr<Ui::FixedHeightWidget>(this, st::defaultVerticalListSkip));
Ui::AddDivider(verticalLayout());
addControl(
object_ptr<Ui::FlatLabel>(
this,
Expand Down
2 changes: 2 additions & 0 deletions Telegram/SourceFiles/boxes/peers/edit_participant_box.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class EditParticipantBox : public Ui::BoxContent {
not_null<UserData*> user,
bool hasAdminRights);

[[nodiscard]] not_null<Ui::VerticalLayout*> verticalLayout() const;

protected:
void prepare() override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ void LinksController::rowPaintIcon(
} else {
(color == Color::Revoked
? st::inviteLinkRevokedIcon
: st::inviteLinkIcon).paintInCenter(p, { 0, 0, inner, inner });
: st::inviteLinkIcon).paintInCenter(p, Rect(Size(inner)));
}
}
p.drawImage(x + skip, y + skip, icon);
Expand Down
17 changes: 4 additions & 13 deletions Telegram/SourceFiles/boxes/peers/edit_peer_permissions_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ For license and copyright information please follow this link:
#include "ui/wrap/vertical_layout.h"
#include "ui/layers/generic_box.h"
#include "ui/painter.h"
#include "ui/vertical_list.h"
#include "ui/widgets/labels.h"
#include "ui/widgets/checkbox.h"
#include "ui/widgets/buttons.h"
Expand Down Expand Up @@ -583,14 +584,6 @@ template <typename Flags>
ApplyDependencies(state->checkViews, dependencies, view);
};

if (descriptor.header) {
container->add(
object_ptr<Ui::FlatLabel>(
container,
std::move(descriptor.header),
st::rightsHeaderLabel),
st::rightsHeaderMargin);
}
const auto addCheckbox = [&](
not_null<Ui::VerticalLayout*> verticalLayout,
bool isInner,
Expand Down Expand Up @@ -1146,9 +1139,11 @@ void ShowEditPeerPermissionsBox(
return result;
}();

Ui::AddSubsectionTitle(
inner,
tr::lng_rights_default_restrictions_header());
auto [checkboxes, getRestrictions, changes] = CreateEditRestrictions(
inner,
tr::lng_rights_default_restrictions_header(),
restrictions,
disabledMessages,
{ .isForum = peer->isForum() });
Expand Down Expand Up @@ -1312,7 +1307,6 @@ std::vector<AdminRightLabel> AdminRightLabels(

EditFlagsControl<ChatRestrictions> CreateEditRestrictions(
QWidget *parent,
rpl::producer<QString> header,
ChatRestrictions restrictions,
base::flat_map<ChatRestrictions, QString> disabledMessages,
Data::RestrictionsSetOptions options) {
Expand All @@ -1321,7 +1315,6 @@ EditFlagsControl<ChatRestrictions> CreateEditRestrictions(
widget.data(),
NegateRestrictions(restrictions),
{
.header = std::move(header),
.labels = NestedRestrictionLabelsList(options),
.disabledMessages = std::move(disabledMessages),
});
Expand All @@ -1338,7 +1331,6 @@ EditFlagsControl<ChatRestrictions> CreateEditRestrictions(

EditFlagsControl<ChatAdminRights> CreateEditAdminRights(
QWidget *parent,
rpl::producer<QString> header,
ChatAdminRights rights,
base::flat_map<ChatAdminRights, QString> disabledMessages,
Data::AdminRightsSetOptions options) {
Expand All @@ -1347,7 +1339,6 @@ EditFlagsControl<ChatAdminRights> CreateEditAdminRights(
widget.data(),
rights,
{
.header = std::move(header),
.labels = NestedAdminRightLabels(options),
.disabledMessages = std::move(disabledMessages),
});
Expand Down
3 changes: 0 additions & 3 deletions Telegram/SourceFiles/boxes/peers/edit_peer_permissions_box.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ struct NestedEditFlagsLabels {

template <typename Flags>
struct EditFlagsDescriptor {
rpl::producer<QString> header;
std::vector<NestedEditFlagsLabels<Flags>> labels;
base::flat_map<Flags, QString> disabledMessages;
const style::SettingsButton *st = nullptr;
Expand All @@ -90,15 +89,13 @@ using AdminRightLabel = EditFlagsLabel<ChatAdminRights>;

[[nodiscard]] auto CreateEditRestrictions(
QWidget *parent,
rpl::producer<QString> header,
ChatRestrictions restrictions,
base::flat_map<ChatRestrictions, QString> disabledMessages,
Data::RestrictionsSetOptions options)
-> EditFlagsControl<ChatRestrictions>;

[[nodiscard]] auto CreateEditAdminRights(
QWidget *parent,
rpl::producer<QString> header,
ChatAdminRights rights,
base::flat_map<ChatAdminRights, QString> disabledMessages,
Data::AdminRightsSetOptions options)
Expand Down
3 changes: 2 additions & 1 deletion Telegram/SourceFiles/boxes/peers/prepare_short_info_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ void ProcessUserpic(
if (!state->userpicView.cloud) {
GenerateImage(
state,
peer->generateUserpicImage(
PeerData::GenerateUserpicImage(
peer,
state->userpicView,
st::shortInfoWidth * style::DevicePixelRatio(),
0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,8 @@ void Viewport::RendererGL::validateUserpicFrame(
return;
}
const auto size = tile->trackOrUserpicSize();
tileData.userpicFrame = tile->row()->peer()->generateUserpicImage(
tileData.userpicFrame = PeerData::GenerateUserpicImage(
tile->row()->peer(),
tile->row()->ensureUserpicView(),
size.width(),
0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ void Viewport::RendererSW::validateUserpicFrame(
}
const auto size = tile->trackOrUserpicSize();
data.userpicFrame = Images::BlurLargeImage(
tile->row()->peer()->generateUserpicImage(
PeerData::GenerateUserpicImage(
tile->row()->peer(),
tile->row()->ensureUserpicView(),
size.width(),
0),
Expand Down
4 changes: 2 additions & 2 deletions Telegram/SourceFiles/core/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ constexpr auto AppId = "{53F49750-6209-4FBF-9CA8-7A333C87D1ED}"_cs;
constexpr auto AppNameOld = "Telegram Win (Unofficial)"_cs;
constexpr auto AppName = "Telegram Desktop"_cs;
constexpr auto AppFile = "Telegram"_cs;
constexpr auto AppVersion = 5004005;
constexpr auto AppVersionStr = "5.4.5";
constexpr auto AppVersion = 5004006;
constexpr auto AppVersionStr = "5.4.6";
constexpr auto AppBetaVersion = true;
constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION;
Loading

0 comments on commit 02f719a

Please sign in to comment.