Skip to content

Commit

Permalink
Updated to 5.10.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
23rd committed Jan 9, 2025
2 parents a3e4c54 + 277d76d commit c4b0354
Show file tree
Hide file tree
Showing 47 changed files with 682 additions and 369 deletions.
4 changes: 2 additions & 2 deletions Telegram/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1419,8 +1419,6 @@ PRIVATE
settings/business/settings_recipients_helper.h
settings/business/settings_working_hours.cpp
settings/business/settings_working_hours.h
settings/cloud_password/settings_cloud_password_common.cpp
settings/cloud_password/settings_cloud_password_common.h
settings/cloud_password/settings_cloud_password_email.cpp
settings/cloud_password/settings_cloud_password_email.h
settings/cloud_password/settings_cloud_password_email_confirm.cpp
Expand All @@ -1433,6 +1431,8 @@ PRIVATE
settings/cloud_password/settings_cloud_password_manage.h
settings/cloud_password/settings_cloud_password_start.cpp
settings/cloud_password/settings_cloud_password_start.h
settings/cloud_password/settings_cloud_password_step.cpp
settings/cloud_password/settings_cloud_password_step.h
settings/settings_active_sessions.cpp
settings/settings_active_sessions.h
settings/settings_advanced.cpp
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.10.1.0" />
Version="5.10.2.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,10,1,0
PRODUCTVERSION 5,10,1,0
FILEVERSION 5,10,2,0
PRODUCTVERSION 5,10,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -62,10 +62,10 @@ BEGIN
BEGIN
VALUE "CompanyName", ""
VALUE "FileDescription", "Telegram Desktop"
VALUE "FileVersion", "5.10.1.0"
VALUE "FileVersion", "5.10.2.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2025"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "5.10.1.0"
VALUE "ProductVersion", "5.10.2.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,10,1,0
PRODUCTVERSION 5,10,1,0
FILEVERSION 5,10,2,0
PRODUCTVERSION 5,10,2,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.10.1.0"
VALUE "FileVersion", "5.10.2.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2025"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "5.10.1.0"
VALUE "ProductVersion", "5.10.2.0"
END
END
BLOCK "VarFileInfo"
Expand Down
80 changes: 58 additions & 22 deletions Telegram/SourceFiles/boxes/passcode_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ For license and copyright information please follow this link:
#include "ui/widgets/labels.h"
#include "ui/wrap/fade_wrap.h"
#include "ui/painter.h"
#include "ui/rect.h"
#include "passport/passport_encryption.h"
#include "passport/passport_panel_edit_contact.h"
#include "settings/settings_privacy_security.h"
Expand Down Expand Up @@ -171,8 +172,9 @@ PasscodeBox::PasscodeBox(
bool turningOff)
: _session(session)
, _api(&_session->mtp())
, _textWidth(st::boxWidth - st::boxPadding.left() * 1.5)
, _turningOff(turningOff)
, _about(st::boxWidth - st::boxPadding.left() * 1.5)
, _about(_textWidth)
, _oldPasscode(this, st::defaultInputField, tr::lng_passcode_enter_old())
, _newPasscode(
this,
Expand All @@ -193,10 +195,11 @@ PasscodeBox::PasscodeBox(
const CloudFields &fields)
: _session(session)
, _api(mtp)
, _textWidth(st::boxWidth - st::boxPadding.left() * 1.5)
, _turningOff(fields.turningOff)
, _cloudPwd(true)
, _cloudFields(fields)
, _about(st::boxWidth - st::boxPadding.left() * 1.5)
, _about(_textWidth)
, _oldPasscode(this, st::defaultInputField, tr::lng_cloud_password_enter_old())
, _newPasscode(
this,
Expand Down Expand Up @@ -274,7 +277,7 @@ void PasscodeBox::prepare() {
: _cloudPwd
? tr::lng_cloud_password_about(tr::now)
: tr::lng_passcode_about(tr::now)));
_aboutHeight = _about.countHeight(st::boxWidth - st::boxPadding.left() * 1.5);
_aboutHeight = _about.countHeight(_textWidth);
const auto onlyCheck = onlyCheckCurrent();
if (onlyCheck) {
_oldPasscode->show();
Expand Down Expand Up @@ -382,28 +385,27 @@ void PasscodeBox::paintEvent(QPaintEvent *e) {

Painter p(this);

int32 w = st::boxWidth - st::boxPadding.left() * 1.5;
int32 abouty = (_passwordHint->isHidden() ? ((_reenterPasscode->isHidden() ? (_oldPasscode->y() + (_showRecoverLink && !_hintText.isEmpty() ? st::passcodeTextLine : 0)) : _reenterPasscode->y()) + st::passcodeSkip) : _passwordHint->y()) + _oldPasscode->height() + st::passcodeLittleSkip + st::passcodeAboutSkip;
p.setPen(st::boxTextFg);
_about.drawLeft(p, st::boxPadding.left(), abouty, w, width());
_about.drawLeft(p, st::boxPadding.left(), abouty, _textWidth, width());

if (!_hintText.isEmpty() && _oldError.isEmpty()) {
_hintText.drawLeftElided(p, st::boxPadding.left(), _oldPasscode->y() + _oldPasscode->height() + ((st::passcodeTextLine - st::normalFont->height) / 2), w, width(), 1, style::al_topleft);
_hintText.drawLeftElided(p, st::boxPadding.left(), _oldPasscode->y() + _oldPasscode->height() + ((st::passcodeTextLine - st::normalFont->height) / 2), _textWidth, width(), 1, style::al_topleft);
}

if (!_oldError.isEmpty()) {
p.setPen(st::boxTextFgError);
p.drawText(QRect(st::boxPadding.left(), _oldPasscode->y() + _oldPasscode->height(), w, st::passcodeTextLine), _oldError, style::al_left);
p.drawText(QRect(st::boxPadding.left(), _oldPasscode->y() + _oldPasscode->height(), _textWidth, st::passcodeTextLine), _oldError, style::al_left);
}

if (!_newError.isEmpty()) {
p.setPen(st::boxTextFgError);
p.drawText(QRect(st::boxPadding.left(), _reenterPasscode->y() + _reenterPasscode->height(), w, st::passcodeTextLine), _newError, style::al_left);
p.drawText(QRect(st::boxPadding.left(), _reenterPasscode->y() + _reenterPasscode->height(), _textWidth, st::passcodeTextLine), _newError, style::al_left);
}

if (!_emailError.isEmpty()) {
p.setPen(st::boxTextFgError);
p.drawText(QRect(st::boxPadding.left(), _recoverEmail->y() + _recoverEmail->height(), w, st::passcodeTextLine), _emailError, style::al_left);
p.drawText(QRect(st::boxPadding.left(), _recoverEmail->y() + _recoverEmail->height(), _textWidth, st::passcodeTextLine), _emailError, style::al_left);
}
}

Expand Down Expand Up @@ -1141,11 +1143,21 @@ RecoverBox::RecoverBox(
Fn<void()> closeParent)
: _session(session)
, _api(mtp)
, _pattern(st::normalFont->elided(tr::lng_signin_recover_hint(tr::now, lt_recover_email, pattern), st::boxWidth - st::boxPadding.left() * 1.5))
, _textWidth(st::boxWidth - st::boxPadding.left() * 1.5)
, _cloudFields(fields)
, _recoverCode(this, st::defaultInputField, tr::lng_signin_code())
, _noEmailAccess(this, tr::lng_signin_try_password(tr::now))
, _patternLabel(
this,
tr::lng_signin_recover_hint(
lt_recover_email,
rpl::single(Ui::Text::WrapEmailPattern(pattern)),
Ui::Text::WithEntities),
st::termsContent,
st::defaultPopupMenu,
[=](Fn<void()> update) { return CommonTextContext{ std::move(update) }; })
, _closeParent(std::move(closeParent)) {
_patternLabel->setAttribute(Qt::WA_TransparentForMouseEvents);
if (_cloudFields.pendingResetDate != 0 || !session) {
_noEmailAccess.destroy();
} else {
Expand Down Expand Up @@ -1176,19 +1188,24 @@ rpl::producer<> RecoverBox::recoveryExpired() const {
return _recoveryExpired.events();
}

void RecoverBox::prepare() {
setTitle(tr::lng_signin_recover_title());

addButton(tr::lng_passcode_submit(), [=] { submit(); });
addButton(tr::lng_cancel(), [=] { closeBox(); });

void RecoverBox::updateHeight() {
setDimensions(
st::boxWidth,
(st::passcodePadding.top()
+ st::passcodePadding.bottom()
+ st::passcodeTextLine
+ _recoverCode->height()
+ _patternLabel->height()
+ st::passcodeTextLine));
}

void RecoverBox::prepare() {
setTitle(tr::lng_signin_recover_title());

addButton(tr::lng_passcode_submit(), [=] { submit(); });
addButton(tr::lng_cancel(), [=] { closeBox(); });

updateHeight();

_recoverCode->changes(
) | rpl::start_with_next([=] {
Expand All @@ -1205,23 +1222,42 @@ void RecoverBox::paintEvent(QPaintEvent *e) {

p.setFont(st::normalFont);
p.setPen(st::boxTextFg);
int32 w = st::boxWidth - st::boxPadding.left() * 1.5;
p.drawText(QRect(st::boxPadding.left(), _recoverCode->y() - st::passcodeTextLine - st::passcodePadding.top(), w, st::passcodePadding.top() + st::passcodeTextLine), _pattern, style::al_left);

if (!_error.isEmpty()) {
p.setPen(st::boxTextFgError);
p.drawText(QRect(st::boxPadding.left(), _recoverCode->y() + _recoverCode->height(), w, st::passcodeTextLine), _error, style::al_left);
p.drawText(
QRect(
st::boxPadding.left(),
_recoverCode->y() + _recoverCode->height(),
_textWidth,
st::passcodeTextLine),
_error,
style::al_left);
}
}

void RecoverBox::resizeEvent(QResizeEvent *e) {
BoxContent::resizeEvent(e);

_recoverCode->resize(st::boxWidth - st::boxPadding.left() - st::boxPadding.right(), _recoverCode->height());
_recoverCode->moveToLeft(st::boxPadding.left(), st::passcodePadding.top() + st::passcodePadding.bottom() + st::passcodeTextLine);
_patternLabel->resizeToWidth(_textWidth);
_patternLabel->moveToLeft(
st::boxPadding.left(),
st::passcodePadding.top());

_recoverCode->resize(
st::boxWidth - st::boxPadding.left() - st::boxPadding.right(),
_recoverCode->height());
_recoverCode->moveToLeft(
st::boxPadding.left(),
rect::m::sum::v(st::passcodePadding) + _patternLabel->height());
if (_noEmailAccess) {
_noEmailAccess->moveToLeft(st::boxPadding.left(), _recoverCode->y() + _recoverCode->height() + (st::passcodeTextLine - _noEmailAccess->height()) / 2);
_noEmailAccess->moveToLeft(
st::boxPadding.left(),
rect::bottom(_recoverCode)
+ (st::passcodeTextLine - _noEmailAccess->height()) / 2);
}

updateHeight();
}

void RecoverBox::setInnerFocus() {
Expand Down
6 changes: 4 additions & 2 deletions Telegram/SourceFiles/boxes/passcode_box.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ class PasscodeBox : public Ui::BoxContent {

Main::Session *_session = nullptr;
MTP::Sender _api;
const int _textWidth;

QString _pattern;

Expand Down Expand Up @@ -219,17 +220,18 @@ class RecoverBox final : public Ui::BoxContent {
void proceedToChange(const QString &code);
void checkSubmitFail(const MTP::Error &error);
void setError(const QString &error);
void updateHeight();

Main::Session *_session = nullptr;
MTP::Sender _api;
const int _textWidth;
mtpRequestId _submitRequest = 0;

QString _pattern;

PasscodeBox::CloudFields _cloudFields;

object_ptr<Ui::InputField> _recoverCode;
object_ptr<Ui::LinkButton> _noEmailAccess;
object_ptr<Ui::FlatLabel> _patternLabel;
Fn<void()> _closeParent;

QString _error;
Expand Down
4 changes: 4 additions & 0 deletions Telegram/SourceFiles/boxes/peer_list_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1680,6 +1680,10 @@ void PeerListContent::mousePressReleased(Qt::MouseButton button) {
_controller->rowClicked(row);
}
}
} else if (button == Qt::MiddleButton && pressed == _selected) {
if (auto row = getRow(pressed.index)) {
_controller->rowMiddleClicked(row);
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions Telegram/SourceFiles/boxes/peer_list_box.h
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,8 @@ class PeerListController : public PeerListSearchDelegate {
}

virtual void rowClicked(not_null<PeerListRow*> row) = 0;
virtual void rowMiddleClicked(not_null<PeerListRow*> row) {
}
virtual void rowRightActionClicked(not_null<PeerListRow*> row) {
}

Expand Down
17 changes: 17 additions & 0 deletions Telegram/SourceFiles/boxes/peer_list_controllers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ For license and copyright information please follow this link:
#include "dialogs/dialogs_main_list.h"
#include "ui/effects/outline_segments.h"
#include "ui/wrap/slide_wrap.h"
#include "window/window_separate_id.h"
#include "window/window_session_controller.h" // showAddContact()
#include "base/unixtime.h"
#include "styles/style_boxes.h"
Expand All @@ -64,6 +65,10 @@ object_ptr<Ui::BoxContent> PrepareContactsBox(
public:
using ContactsBoxController::ContactsBoxController;

[[nodiscard]] rpl::producer<not_null<PeerData*>> wheelClicks() const {
return _wheelClicks.events();
}

protected:
std::unique_ptr<PeerListRow> createRow(
not_null<UserData*> user) override {
Expand All @@ -72,6 +77,14 @@ object_ptr<Ui::BoxContent> PrepareContactsBox(
: nullptr;
}

void rowMiddleClicked(
not_null<PeerListRow*> row) override {
_wheelClicks.fire(row->peer());
}

private:
rpl::event_stream<not_null<PeerData*>> _wheelClicks;

};
auto controller = std::make_unique<Controller>(
&sessionController->session());
Expand Down Expand Up @@ -100,6 +113,10 @@ object_ptr<Ui::BoxContent> PrepareContactsBox(
online ? &st::contactsSortOnlineIconOver : nullptr);
});
raw->setSortMode(Mode::Online);

raw->wheelClicks() | rpl::start_with_next([=](not_null<PeerData*> p) {
sessionController->showInNewWindow(p);
}, box->lifetime());
};
return Box<PeerListBox>(std::move(controller), std::move(init));
}
Expand Down
Loading

0 comments on commit c4b0354

Please sign in to comment.