Skip to content

Commit

Permalink
Updated to 5.5.3.
Browse files Browse the repository at this point in the history
  • Loading branch information
23rd committed Sep 10, 2024
2 parents 5fcaf38 + dab107c commit 9c297fb
Show file tree
Hide file tree
Showing 68 changed files with 2,451 additions and 1,138 deletions.
2 changes: 2 additions & 0 deletions Telegram/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1494,6 +1494,8 @@ PRIVATE
support/support_templates.h
ui/boxes/edit_invite_link_session.cpp
ui/boxes/edit_invite_link_session.h
ui/boxes/peer_qr_box.cpp
ui/boxes/peer_qr_box.h
ui/chat/attach/attach_item_single_file_preview.cpp
ui/chat/attach/attach_item_single_file_preview.h
ui/chat/attach/attach_item_single_media_preview.cpp
Expand Down
1 change: 1 addition & 0 deletions Telegram/Resources/icons/plane_white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/qr_mini.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/qr_mini@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/qr_mini@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,706 changes: 857 additions & 849 deletions Telegram/Resources/langs/lang.strings

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Telegram/Resources/qrc/telegram/telegram.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<file alias="topic_icons/gray.svg">../../art/topic_icons/gray.svg</file>
<file alias="topic_icons/general.svg">../../art/topic_icons/general.svg</file>
<file alias="links_subscription.svg">../../icons/info/edit/links_subscription.svg</file>
<file alias="plane_white.svg">../../icons/plane_white.svg</file>
</qresource>
<qresource prefix="/icons">
<file alias="calls/hands.lottie">../../icons/calls/hands.lottie</file>
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.5.1.0" />
Version="5.5.3.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,5,1,0
PRODUCTVERSION 5,5,1,0
FILEVERSION 5,5,3,0
PRODUCTVERSION 5,5,3,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -62,10 +62,10 @@ BEGIN
BEGIN
VALUE "CompanyName", ""
VALUE "FileDescription", "Telegram Desktop"
VALUE "FileVersion", "5.5.1.0"
VALUE "FileVersion", "5.5.3.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2024"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "5.5.1.0"
VALUE "ProductVersion", "5.5.3.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,5,1,0
PRODUCTVERSION 5,5,1,0
FILEVERSION 5,5,3,0
PRODUCTVERSION 5,5,3,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.5.1.0"
VALUE "FileVersion", "5.5.3.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2024"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "5.5.1.0"
VALUE "ProductVersion", "5.5.3.0"
END
END
BLOCK "VarFileInfo"
Expand Down
6 changes: 4 additions & 2 deletions Telegram/SourceFiles/api/api_chat_filters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,12 @@ void ImportInvite(
api->request(MTPchatlists_JoinChatlistInvite(
MTP_string(slug),
MTP_vector<MTPInputPeer>(std::move(inputs))
)).done(callback).fail(error).send();
)).done(callback).fail(error).handleFloodErrors().send();
} else {
api->request(MTPchatlists_JoinChatlistUpdates(
MTP_inputChatlistDialogFilter(MTP_int(filterId)),
MTP_vector<MTPInputPeer>(std::move(inputs))
)).done(callback).fail(error).send();
)).done(callback).fail(error).handleFloodErrors().send();
}
}

Expand Down Expand Up @@ -517,6 +517,8 @@ void ShowImportError(
} else {
window->showToast((error == u"INVITE_SLUG_EXPIRED"_q)
? tr::lng_group_invite_bad_link(tr::now)
: error.startsWith(u"FLOOD_WAIT_"_q)
? tr::lng_flood_error(tr::now)
: error);
}
}
Expand Down
27 changes: 21 additions & 6 deletions Telegram/SourceFiles/api/api_chat_participants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ For license and copyright information please follow this link:
#include "api/api_chat_participants.h"

#include "apiwrap.h"
#include "base/unixtime.h"
#include "boxes/add_contact_box.h" // ShowAddParticipantsError
#include "boxes/peers/add_participants_box.h" // ChatInviteForbidden
#include "data/data_changes.h"
Expand Down Expand Up @@ -265,22 +264,24 @@ ChatParticipant::ChatParticipant(
_rank = qs(data.vrank().value_or_empty());
_rights = ChatAdminRightsInfo(data.vadmin_rights());
_by = peerToUser(peerFromUser(data.vpromoted_by()));
_date = data.vdate().v;
}, [&](const MTPDchannelParticipantSelf &data) {
_type = Type::Member;
_date = data.vdate().v;
_by = peerToUser(peerFromUser(data.vinviter_id()));
if (data.vsubscription_until_date()) {
_subscriptionDate = base::unixtime::parse(
data.vsubscription_until_date()->v);
_subscriptionDate = data.vsubscription_until_date()->v;
}
}, [&](const MTPDchannelParticipant &data) {
_type = Type::Member;
_date = data.vdate().v;
if (data.vsubscription_until_date()) {
_subscriptionDate = base::unixtime::parse(
data.vsubscription_until_date()->v);
_subscriptionDate = data.vsubscription_until_date()->v;
}
}, [&](const MTPDchannelParticipantBanned &data) {
_restrictions = ChatRestrictionsInfo(data.vbanned_rights());
_by = peerToUser(peerFromUser(data.vkicked_by()));
_date = data.vdate().v;

_type = (_restrictions.flags & ChatRestriction::ViewMessages)
? Type::Banned
Expand Down Expand Up @@ -357,10 +358,24 @@ ChatAdminRightsInfo ChatParticipant::rights() const {
return _rights;
}

QDateTime ChatParticipant::subscriptionDate() const {
TimeId ChatParticipant::subscriptionDate() const {
return _subscriptionDate;
}

TimeId ChatParticipant::promotedSince() const {
return (_type == Type::Admin) ? _date : TimeId(0);
}

TimeId ChatParticipant::restrictedSince() const {
return (_type == Type::Restricted || _type == Type::Banned)
? _date
: TimeId(0);
}

TimeId ChatParticipant::memberSince() const {
return (_type == Type::Member) ? _date : TimeId(0);
}

ChatParticipant::Type ChatParticipant::type() const {
return _type;
}
Expand Down
8 changes: 6 additions & 2 deletions Telegram/SourceFiles/api/api_chat_participants.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ class ChatParticipant final {
ChatRestrictionsInfo restrictions() const;
ChatAdminRightsInfo rights() const;

QDateTime subscriptionDate() const;
TimeId subscriptionDate() const;
TimeId promotedSince() const;
TimeId restrictedSince() const;
TimeId memberSince() const;

Type type() const;
QString rank() const;
Expand All @@ -75,7 +78,8 @@ class ChatParticipant final {
bool _canBeEdited = false;

QString _rank;
QDateTime _subscriptionDate;
TimeId _subscriptionDate = 0;
TimeId _date = 0;

ChatRestrictionsInfo _restrictions;
ChatAdminRightsInfo _rights;
Expand Down
4 changes: 3 additions & 1 deletion Telegram/SourceFiles/boxes/add_contact_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ void ShowAddParticipantsError(
channel,
user,
ChatAdminRightsInfo(),
QString());
QString(),
0,
nullptr);
box->setSaveCallback(saveCallback);
*weak = box.data();
show->showBox(std::move(box));
Expand Down
7 changes: 7 additions & 0 deletions Telegram/SourceFiles/boxes/boxes.style
Original file line number Diff line number Diff line change
Expand Up @@ -1120,3 +1120,10 @@ moderateBoxDividerLabel: FlatLabel(boxDividerLabel) {
selectLinkFg: windowActiveTextFg;
}
}

profileQrFont: font(fsize bold);
profileQrCenterSize: 34px;
profileQrBackgroundRadius: 12px;
profileQrIcon: icon{{ "qr_mini", windowActiveTextFg }};
profileQrBackgroundMargins: margins(36px, 12px, 36px, 12px);
profileQrBackgroundPadding: margins(0px, 24px, 0px, 24px);
4 changes: 3 additions & 1 deletion Telegram/SourceFiles/boxes/filters/edit_filter_links.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ void LinkController::addLinkBlock(not_null<Ui::VerticalLayout*> container) {
});
const auto getLinkQr = crl::guard(weak, [=] {
delegate()->peerListUiShow()->showBox(InviteLinkQrBox(
nullptr,
link,
tr::lng_group_invite_qr_title(),
tr::lng_filters_link_qr_about()));
Expand Down Expand Up @@ -890,6 +891,7 @@ base::unique_qptr<Ui::PopupMenu> LinksController::createRowContextMenu(
};
const auto getLinkQr = [=] {
delegate()->peerListUiShow()->showBox(InviteLinkQrBox(
nullptr,
link,
tr::lng_group_invite_qr_title(),
tr::lng_filters_link_qr_about()));
Expand Down Expand Up @@ -1114,7 +1116,7 @@ QString FilterChatStatusText(not_null<PeerData*> peer) {
? tr::lng_chat_status_subscribers
: tr::lng_chat_status_members)(
tr::now,
lt_count,
lt_count_decimal,
channel->membersCount());
}
}
Expand Down
11 changes: 10 additions & 1 deletion Telegram/SourceFiles/boxes/peers/add_bot_to_chat_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,15 @@ void AddBotToGroupBoxController::requestExistingRights(
channel);
_existingRights = participant.rights().flags;
_existingRank = participant.rank();
_promotedSince = participant.promotedSince();
_promotedBy = participant.by();
addBotToGroup(_existingRightsChannel);
});
}).fail([=] {
_existingRights = ChatAdminRights();
_existingRank = QString();
_promotedSince = 0;
_promotedBy = 0;
addBotToGroup(_existingRightsChannel);
}).send();
}
Expand All @@ -191,6 +195,8 @@ void AddBotToGroupBoxController::addBotToGroup(not_null<PeerData*> chat) {
_existingRights = {};
_existingRank = QString();
_existingRightsChannel = nullptr;
_promotedSince = 0;
_promotedBy = 0;
_bot->session().api().request(_existingRightsRequestId).cancel();
}
const auto requestedAddAdmin = (_scope == Scope::GroupAdmin)
Expand Down Expand Up @@ -241,9 +247,12 @@ void AddBotToGroupBoxController::addBotToGroup(not_null<PeerData*> chat) {
bot,
ChatAdminRightsInfo(rights),
_existingRank,
_promotedSince,
_promotedBy ? chat->owner().user(_promotedBy).get() : nullptr,
EditAdminBotFields{
_token,
_existingRights.value_or(ChatAdminRights()) });
_existingRights.value_or(ChatAdminRights()),
});
box->setSaveCallback(saveCallback);
controller->show(std::move(box));
} else {
Expand Down
2 changes: 2 additions & 0 deletions Telegram/SourceFiles/boxes/peers/add_bot_to_chat_box.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ class AddBotToGroupBoxController
mtpRequestId _existingRightsRequestId = 0;
std::optional<ChatAdminRights> _existingRights;
QString _existingRank;
TimeId _promotedSince = 0;
UserId _promotedBy = 0;

rpl::event_stream<not_null<PeerData*>> _groups;
rpl::event_stream<not_null<PeerData*>> _channels;
Expand Down
8 changes: 6 additions & 2 deletions Telegram/SourceFiles/boxes/peers/add_participants_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,9 @@ void AddSpecialBoxController::showAdmin(
_peer,
user,
currentRights,
_additional.adminRank(user));
_additional.adminRank(user),
_additional.adminPromotedSince(user),
_additional.adminPromotedBy(user));
const auto show = delegate()->peerListUiShow();
if (_additional.canAddOrEditAdmin(user)) {
const auto done = crl::guard(this, [=](
Expand Down Expand Up @@ -1354,7 +1356,9 @@ void AddSpecialBoxController::showRestricted(
_peer,
user,
_additional.adminRights(user).has_value(),
currentRights);
currentRights,
_additional.restrictedBy(user),
_additional.restrictedSince(user));
if (_additional.canRestrictParticipant(user)) {
const auto done = crl::guard(this, [=](
ChatRestrictionsInfo newRights) {
Expand Down
Loading

0 comments on commit 9c297fb

Please sign in to comment.