Skip to content

Commit

Permalink
Updated to 5.10.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
23rd committed Jan 7, 2025
2 parents 65c0760 + 3aa15c9 commit b0ed846
Show file tree
Hide file tree
Showing 90 changed files with 1,529 additions and 913 deletions.
5 changes: 5 additions & 0 deletions Telegram/Resources/langs/lang.strings
Original file line number Diff line number Diff line change
Expand Up @@ -4186,6 +4186,10 @@ /~https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_search_messages_from" = "Show messages from";
"lng_search_messages_n_of_amount" = "{n} of {amount}";
"lng_search_messages_none" = "No results";
"lng_search_filter_all" = "All chats";
"lng_search_filter_private" = "Private chats";
"lng_search_filter_group" = "Group chats";
"lng_search_filter_channel" = "Channels";

"lng_media_save_progress" = "{ready} of {total} {mb}";
"lng_mediaview_save_as" = "Save As...";
Expand Down Expand Up @@ -6038,6 +6042,7 @@ /~https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_search_tab_no_results_text" = "There were no results for \"{query}\".";
"lng_search_tab_no_results_retry" = "Try another hashtag.";
"lng_search_tab_by_hashtag" = "Enter a hashtag to find messages containing it.";
"lng_search_tab_try_in_all" = "Search in All Messages";

"lng_contact_details_button" = "View Contact";
"lng_contact_details_title" = "Contact details";
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.0.0" />
Version="5.10.1.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,0,0
PRODUCTVERSION 5,10,0,0
FILEVERSION 5,10,1,0
PRODUCTVERSION 5,10,1,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.0.0"
VALUE "FileVersion", "5.10.1.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2025"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "5.10.0.0"
VALUE "ProductVersion", "5.10.1.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,0,0
PRODUCTVERSION 5,10,0,0
FILEVERSION 5,10,1,0
PRODUCTVERSION 5,10,1,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.0.0"
VALUE "FileVersion", "5.10.1.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2025"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "5.10.0.0"
VALUE "ProductVersion", "5.10.1.0"
END
END
BLOCK "VarFileInfo"
Expand Down
4 changes: 2 additions & 2 deletions Telegram/SourceFiles/apiwrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3267,13 +3267,13 @@ void ApiWrap::finishForwarding(const SendAction &action) {
const auto topicRootId = action.replyTo.topicRootId;
auto toForward = history->resolveForwardDraft(topicRootId);
if (!toForward.items.empty()) {
const auto error = GetErrorTextForSending(
const auto error = GetErrorForSending(
history->peer,
{
.topicRootId = topicRootId,
.forward = &toForward.items,
});
if (!error.isEmpty()) {
if (error) {
return;
}

Expand Down
8 changes: 4 additions & 4 deletions Telegram/SourceFiles/boxes/gift_premium_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1203,9 +1203,9 @@ void AddStarGiftTable(
const auto peerId = PeerId(entry.barePeerId);
const auto session = &controller->session();
const auto unique = entry.uniqueGift.get();
const auto chatPeerId = entry.fromGiftsList
? entry.bareGiftOwnerId
: entry.barePeerId;
const auto selfBareId = session->userPeerId().value;
const auto giftToSelf = (peerId == session->userPeerId())
&& (entry.in || entry.bareGiftOwnerId == selfBareId);
if (unique) {
const auto ownerId = PeerId(entry.bareGiftOwnerId);
const auto transfer = entry.in
Expand All @@ -1224,7 +1224,7 @@ void AddStarGiftTable(
MakePeerTableValue(table, controller, ownerId, send, handler),
st::giveawayGiftCodePeerMargin);
} else if (peerId) {
if (chatPeerId != session->userPeerId().value) {
if (!giftToSelf) {
const auto user = session->data().peer(peerId)->asUser();
const auto withSendButton = entry.in && user && !user->isBot();
auto send = withSendButton ? tr::lng_gift_send_small() : nullptr;
Expand Down
40 changes: 19 additions & 21 deletions Telegram/SourceFiles/boxes/peer_list_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -788,31 +788,29 @@ int PeerListRow::paintNameIconGetWidth(
|| _isVerifyCodesChat) {
return 0;
}
return _badge.drawGetWidth(
p,
QRect(
return _badge.drawGetWidth(p, {
.peer = peer(),
.rectForName = QRect(
nameLeft,
nameTop,
availableWidth,
st::semiboldFont->height),
nameWidth,
outerWidth,
{
.peer = peer(),
.verified = &(selected
? st::dialogsVerifiedIconOver
: st::dialogsVerifiedIcon),
.premium = &(selected
? st::dialogsPremiumIcon.over
: st::dialogsPremiumIcon.icon),
.scam = &(selected ? st::dialogsScamFgOver : st::dialogsScamFg),
.premiumFg = &(selected
? st::dialogsVerifiedIconBgOver
: st::dialogsVerifiedIconBg),
.customEmojiRepaint = repaint,
.now = now,
.paused = false,
});
.nameWidth = nameWidth,
.outerWidth = outerWidth,
.verified = &(selected
? st::dialogsVerifiedIconOver
: st::dialogsVerifiedIcon),
.premium = &(selected
? st::dialogsPremiumIcon.over
: st::dialogsPremiumIcon.icon),
.scam = &(selected ? st::dialogsScamFgOver : st::dialogsScamFg),
.premiumFg = &(selected
? st::dialogsVerifiedIconBgOver
: st::dialogsVerifiedIconBg),
.customEmojiRepaint = repaint,
.now = now,
.paused = false,
});
}

void PeerListRow::paintStatusText(
Expand Down
2 changes: 2 additions & 0 deletions Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2282,6 +2282,8 @@ void ParticipantsBoxSearchController::restoreState(
_allLoaded = my->allLoaded;
_offset = my->offset;
_query = my->query;
_timer.cancel();
_requestId = 0;
if (my->wasLoading) {
searchOnServer();
}
Expand Down
29 changes: 8 additions & 21 deletions Telegram/SourceFiles/boxes/peers/edit_peer_invite_link.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ For license and copyright information please follow this link:
#include "data/data_user.h"
#include "data/stickers/data_custom_emoji.h"
#include "history/history.h"
#include "history/history_item_helpers.h" // GetErrorTextForSending.
#include "history/history_item_helpers.h" // GetErrorForSending.
#include "history/view/history_view_group_call_bar.h" // GenerateUserpics...
#include "lang/lang_keys.h"
#include "main/main_session.h"
Expand Down Expand Up @@ -1492,27 +1492,14 @@ object_ptr<Ui::BoxContent> ShareInviteLinkBox(
return;
}

const auto error = [&] {
for (const auto thread : result) {
const auto error = GetErrorTextForSending(
thread,
{ .text = &comment });
if (!error.isEmpty()) {
return std::make_pair(error, thread);
}
}
return std::make_pair(QString(), result.front());
}();
if (!error.first.isEmpty()) {
auto text = TextWithEntities();
if (result.size() > 1) {
text.append(
Ui::Text::Bold(error.second->chatListName())
).append("\n\n");
}
text.append(error.first);
const auto errorWithThread = GetErrorForSending(
result,
{ .text = &comment });
if (errorWithThread.error) {
if (*box) {
(*box)->uiShow()->showBox(Ui::MakeInformBox(text));
(*box)->uiShow()->showBox(MakeSendErrorBox(
errorWithThread,
result.size() > 1));
}
return;
}
Expand Down
4 changes: 2 additions & 2 deletions Telegram/SourceFiles/boxes/send_files_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,15 @@ SendFilesCheck DefaultCheckForPeer(
}

SendFilesCheck DefaultCheckForPeer(
std::shared_ptr<Ui::Show> show,
std::shared_ptr<ChatHelpers::Show> show,
not_null<PeerData*> peer) {
return [=](
const Ui::PreparedFile &file,
bool compress,
bool silent) {
const auto error = Data::FileRestrictionError(peer, file, compress);
if (error && !silent) {
show->showToast(*error);
Data::ShowSendErrorToast(show, peer, error);
}
return !error.has_value();
};
Expand Down
2 changes: 1 addition & 1 deletion Telegram/SourceFiles/boxes/send_files_box.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ using SendFilesCheck = Fn<bool(
not_null<Window::SessionController*> controller,
not_null<PeerData*> peer);
[[nodiscard]] SendFilesCheck DefaultCheckForPeer(
std::shared_ptr<Ui::Show> show,
std::shared_ptr<ChatHelpers::Show> show,
not_null<PeerData*> peer);

using SendFilesConfirmed = Fn<void(
Expand Down
54 changes: 11 additions & 43 deletions Telegram/SourceFiles/boxes/share_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1544,26 +1544,11 @@ ShareBox::SubmitCallback ShareBox::DefaultForwardCallback(
return;
}

const auto error = [&] {
for (const auto thread : result) {
const auto error = GetErrorTextForSending(
thread,
{ .forward = &items, .text = &comment });
if (!error.isEmpty()) {
return std::make_pair(error, thread);
}
}
return std::make_pair(QString(), result.front());
}();
if (!error.first.isEmpty()) {
auto text = TextWithEntities();
if (result.size() > 1) {
text.append(
Ui::Text::Bold(error.second->chatListName())
).append("\n\n");
}
text.append(error.first);
show->showBox(Ui::MakeInformBox(text));
const auto error = GetErrorForSending(
result,
{ .forward = &items, .text = &comment });
if (error.error) {
show->showBox(MakeSendErrorBox(error, result.size() > 1));
return;
}

Expand Down Expand Up @@ -1808,30 +1793,13 @@ void FastShareLink(
return;
}

const auto error = [&] {
for (const auto thread : result) {
const auto error = GetErrorTextForSending(
thread,
{ .text = &comment });
if (!error.isEmpty()) {
return std::make_pair(error, thread);
}
}
return std::make_pair(QString(), result.front());
}();
if (!error.first.isEmpty()) {
auto text = TextWithEntities();
if (result.size() > 1) {
text.append(
Ui::Text::Bold(error.second->chatListName())
).append("\n\n");
}
text.append(error.first);
const auto error = GetErrorForSending(
result,
{ .text = &comment });
if (error.error) {
if (const auto weak = *box) {
weak->getDelegate()->show(Ui::MakeConfirmBox({
.text = text,
.inform = true,
}));
weak->getDelegate()->show(
MakeSendErrorBox(error, result.size() > 1));
}
return;
}
Expand Down
16 changes: 12 additions & 4 deletions Telegram/SourceFiles/boxes/star_gift_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,9 @@ struct PatternPoint {
};
[[nodiscard]] const std::vector<PatternPoint> &PatternPoints() {
static const auto kSmall = 0.7;
static const auto kFaded = 0.5;
static const auto kFaded = 0.3;
static const auto kLarge = 0.85;
static const auto kOpaque = 0.7;
static const auto kOpaque = 0.5;
static const auto result = std::vector<PatternPoint>{
{ { 0.5, 0.066 }, kSmall, kFaded },

Expand Down Expand Up @@ -973,7 +973,15 @@ struct GiftPriceTabs {
const auto w = icon.fadeRight.width();
const auto &c = st::boxDividerBg->c;
const auto r = QRect(0, 0, w, raw->height());
const auto s = std::abs(float64(shift.x()));
constexpr auto kF = 0.5;
const auto opacityRight = (state->scrollMax - s)
/ (icon.fadeRight.width() * kF);
p.setOpacity(std::clamp(std::abs(opacityRight), 0., 1.));
icon.fadeRight.fill(p, r.translated(raw->width() - w, 0), c);

const auto opacityLeft = s / (icon.fadeLeft.width() * kF);
p.setOpacity(std::clamp(std::abs(opacityLeft), 0., 1.));
icon.fadeLeft.fill(p, r, c);
}
}, raw->lifetime());
Expand Down Expand Up @@ -1520,7 +1528,7 @@ void SendGiftBox(
bool sending = false;
};
const auto state = raw->lifetime().make_state<State>(State{
.delegate = Delegate(window),
.delegate = Delegate(window, GiftButtonMode::Full),
});
const auto single = state->delegate.buttonSize();
const auto shadow = st::defaultDropdownMenu.wrap.shadow;
Expand Down Expand Up @@ -1567,7 +1575,7 @@ void SendGiftBox(
for (auto i = 0; i != count; ++i) {
const auto button = state->buttons[i].get();
const auto &descriptor = gifts.list[order[i]];
button->setDescriptor(descriptor);
button->setDescriptor(descriptor, GiftButton::Mode::Full);

const auto last = !((i + 1) % perRow);
if (last) {
Expand Down
Loading

0 comments on commit b0ed846

Please sign in to comment.