Skip to content

Commit

Permalink
Updated to 4.12.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
23rd committed Dec 1, 2023
2 parents decc349 + 28acaf0 commit da67de0
Show file tree
Hide file tree
Showing 23 changed files with 148 additions and 33 deletions.
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="4.11.8.0" />
Version="4.12.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 4,11,8,0
PRODUCTVERSION 4,11,8,0
FILEVERSION 4,12,1,0
PRODUCTVERSION 4,12,1,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -62,10 +62,10 @@ BEGIN
BEGIN
VALUE "CompanyName", ""
VALUE "FileDescription", "Telegram Desktop"
VALUE "FileVersion", "4.11.8.0"
VALUE "FileVersion", "4.12.1.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2023"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "4.11.8.0"
VALUE "ProductVersion", "4.12.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 4,11,8,0
PRODUCTVERSION 4,11,8,0
FILEVERSION 4,12,1,0
PRODUCTVERSION 4,12,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", "4.11.8.0"
VALUE "FileVersion", "4.12.1.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2023"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "4.11.8.0"
VALUE "ProductVersion", "4.12.1.0"
END
END
BLOCK "VarFileInfo"
Expand Down
2 changes: 0 additions & 2 deletions Telegram/SourceFiles/api/api_chat_participants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ void ApplyBotsList(
const MTPmessages_Chats &chats) {
auto result = ChatParticipants::Channels();
std::vector<not_null<ChannelData*>>();
auto total = 0;
chats.match([&](const auto &data) {
const auto &list = data.vchats().v;
result.list.reserve(list.size());
Expand Down Expand Up @@ -583,7 +582,6 @@ void ChatParticipants::requestSelf(not_null<ChannelData*> channel) {
UserId inviter = -1,
TimeId inviteDate = 0,
bool inviteViaRequest = false) {
const auto dateChanged = (channel->inviteDate != inviteDate);
channel->inviter = inviter;
channel->inviteDate = inviteDate;
channel->inviteViaRequest = inviteViaRequest;
Expand Down
1 change: 0 additions & 1 deletion Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,6 @@ void Controller::fillManageSection() {
}

if (canEditReactions()) {
const auto session = &_peer->session();
auto allowedReactions = Info::Profile::MigratedOrMeValue(
_peer
) | rpl::map([=](not_null<PeerData*> peer) {
Expand Down
2 changes: 1 addition & 1 deletion Telegram/SourceFiles/core/fork_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ QByteArray ForkSettings::serialize() const {
auto size = sizeof(qint32) * 4
+ Serialize::stringSize(_uriScheme)
+ Serialize::stringSize(_searchEngineUrl)
+ sizeof(qint32) * 9;
+ sizeof(qint32) * 10;

auto result = QByteArray();
result.reserve(size);
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 = 4011008;
constexpr auto AppVersionStr = "4.11.8";
constexpr auto AppVersion = 4012001;
constexpr auto AppVersionStr = "4.12.1";
constexpr auto AppBetaVersion = false;
constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION;
1 change: 0 additions & 1 deletion Telegram/SourceFiles/dialogs/dialogs_row.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ QRect CornerBadgeTTLRect(int photoSize) {
}

QImage BlurredDarkenedPart(QImage image, QRect part) {
const auto ratio = style::DevicePixelRatio();
auto blurred = Images::BlurLargeImage(
std::move(image),
kBlurRadius).copy(part);
Expand Down
7 changes: 7 additions & 0 deletions Telegram/SourceFiles/dialogs/ui/dialogs_layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,13 @@ void PaintRow(
context.st->padding.top(),
context.width,
context.st->photoSize);
} else if (!from && hiddenSenderInfo) {
hiddenSenderInfo->emptyUserpic.paintCircle(
p,
context.st->padding.left(),
context.st->padding.top(),
context.width,
context.st->photoSize);
} else if (!(flags & Flag::AllowUserOnline)) {
PaintUserpic(
p,
Expand Down
21 changes: 21 additions & 0 deletions Telegram/SourceFiles/history/history_inner_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1263,6 +1263,27 @@ void HistoryInner::paintEvent(QPaintEvent *e) {
width(),
st::msgPhotoSize,
context.paused);
} else if (const auto info = item->hiddenSenderInfo()) {
if (info->customUserpic.empty()) {
info->emptyUserpic.paintCircle(
p,
st::historyPhotoLeft,
userpicTop,
width(),
st::msgPhotoSize);
} else {
auto &userpic = _hiddenSenderUserpics[item->id];
const auto valid = info->paintCustomUserpic(
p,
userpic,
st::historyPhotoLeft,
userpicTop,
width(),
st::msgPhotoSize);
if (!valid) {
info->customUserpic.load(&session(), item->fullId());
}
}
} else {
Unexpected("Corrupt forwarded information in message.");
}
Expand Down
36 changes: 35 additions & 1 deletion Telegram/SourceFiles/history/history_item_components.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,12 @@ HiddenSenderInfo::HiddenSenderInfo(
std::optional<uint8> colorIndex)
: name(name)
, colorIndex(colorIndex.value_or(
Data::DecideColorIndex(Data::FakePeerIdForJustName(name)))) {
Data::DecideColorIndex(Data::FakePeerIdForJustName(name))))
, emptyUserpic(
Ui::EmptyUserpic::UserpicColor(this->colorIndex),
(external
? Ui::EmptyUserpic::ExternalName()
: name)) {
Expects(!name.isEmpty());

const auto parts = name.trimmed().split(' ', Qt::SkipEmptyParts);
Expand Down Expand Up @@ -149,6 +154,35 @@ ClickHandlerPtr HiddenSenderInfo::ForwardClickHandler() {
return hidden;
}

bool HiddenSenderInfo::paintCustomUserpic(
Painter &p,
Ui::PeerUserpicView &view,
int x,
int y,
int outerWidth,
int size) const {
Expects(!customUserpic.empty());

auto valid = true;
if (!customUserpic.isCurrentView(view.cloud)) {
view.cloud = customUserpic.createView();
valid = false;
}
const auto image = *view.cloud;
if (image.isNull()) {
emptyUserpic.paintCircle(p, x, y, outerWidth, size);
return valid;
}
Ui::ValidateUserpicCache(
view,
image.isNull() ? nullptr : &image,
image.isNull() ? &emptyUserpic : nullptr,
size * style::DevicePixelRatio(),
false);
p.drawImage(QRect(x, y, size, size), view.cached);
return valid;
}

void HistoryMessageForwarded::create(const HistoryMessageVia *via) const {
auto phrase = TextWithEntities();
const auto fromChannel = originalSender
Expand Down
9 changes: 9 additions & 0 deletions Telegram/SourceFiles/history/history_item_components.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,19 @@ class HiddenSenderInfo {
QString firstName;
QString lastName;
uint8 colorIndex = 0;
Ui::EmptyUserpic emptyUserpic;
mutable Data::CloudImage customUserpic;

[[nodiscard]] static ClickHandlerPtr ForwardClickHandler();

[[nodiscard]] const Ui::Text::String &nameText() const;
[[nodiscard]] bool paintCustomUserpic(
Painter &p,
Ui::PeerUserpicView &view,
int x,
int y,
int outerWidth,
int size) const;

inline bool operator==(const HiddenSenderInfo &other) const {
return name == other.name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,28 @@ void PreviewWrap::paintEvent(QPaintEvent *e) {
userpicTop,
width(),
st::msgPhotoSize);
} else if (const auto info = item->hiddenSenderInfo()) {
if (info->customUserpic.empty()) {
info->emptyUserpic.paintCircle(
p,
st::historyPhotoLeft,
userpicTop,
width(),
st::msgPhotoSize);
} else {
const auto valid = info->paintCustomUserpic(
p,
_userpic,
st::historyPhotoLeft,
userpicTop,
width(),
st::msgPhotoSize);
if (!valid) {
info->customUserpic.load(
&item->history()->session(),
item->fullId());
}
}
} else {
Unexpected("Corrupt forwarded information in message.");
}
Expand Down
21 changes: 21 additions & 0 deletions Telegram/SourceFiles/history/view/history_view_list_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2181,6 +2181,27 @@ void ListWidget::paintEvent(QPaintEvent *e) {
userpicTop,
view->width(),
st::msgPhotoSize);
} else if (const auto info = item->hiddenSenderInfo()) {
if (info->customUserpic.empty()) {
info->emptyUserpic.paintCircle(
p,
st::historyPhotoLeft,
userpicTop,
view->width(),
st::msgPhotoSize);
} else {
auto &userpic = _hiddenSenderUserpics[item->id];
const auto valid = info->paintCustomUserpic(
p,
userpic,
st::historyPhotoLeft,
userpicTop,
view->width(),
st::msgPhotoSize);
if (!valid) {
info->customUserpic.load(session, item->fullId());
}
}
} else {
Unexpected("Corrupt forwarded information in message.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ void SimilarChannels::draw(Painter &p, const PaintContext &context) const {
path.lineTo(x, y - size);
p.fillPath(path, stm->msgBg);
}
const auto photo = st::chatSimilarChannelPhoto;
const auto padding = st::chatSimilarChannelPadding;
p.setClipRect(geometry);
_hasHeavyPart = 1;
Expand All @@ -177,7 +176,6 @@ void SimilarChannels::draw(Painter &p, const PaintContext &context) const {
if (subscribing) {
channel.subscribed = 1;
const auto raw = channel.thumbnail.get();
const auto view = parent();
channel.thumbnail->subscribeToUpdates([=] {
for (const auto &channel : _channels) {
if (channel.thumbnail.get() == raw) {
Expand Down Expand Up @@ -265,7 +263,6 @@ void SimilarChannels::draw(Painter &p, const PaintContext &context) const {
st::chatSimilarBadgePadding);
auto textLeft = badge.x();
const auto &font = st::chatSimilarBadgeFont;
const auto ascent = font->ascent;
const auto textTop = badge.y() + font->ascent;
const auto icon = !channel.more
? &st::chatSimilarBadgeIcon
Expand Down Expand Up @@ -644,4 +641,4 @@ bool SimilarChannels::consumeHorizontalScroll(QPoint position, int delta) {
return true;
}

} // namespace HistoryView
} // namespace HistoryView
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,6 @@ QSize WebPage::countCurrentSize(int newWidth) {
auto siteNameHeight = _siteNameLines ? lineHeight : 0;
const auto asSponsored = (!!_sponsoredData);
if (asArticle() || asSponsored) {
const auto article = asArticle();
constexpr auto kSponsoredUserpicLines = 2;
_pixh = (asSponsored ? kSponsoredUserpicLines : linesMax) * lineHeight;
do {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ void ListController::restoreState(
auto typeErasedState = state
? state->controllerState.get()
: nullptr;
if (auto my = dynamic_cast<SavedState*>(typeErasedState)) {
if (dynamic_cast<SavedState*>(typeErasedState)) {
PeerListController::restoreState(std::move(state));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,6 @@ void InnerWidget::fill() {
FillStatistic(inner, descriptor, _state.stats);
const auto &channel = _state.stats.channel;
const auto &supergroup = _state.stats.supergroup;
const auto &message = _state.stats.message;
if (channel) {
fillRecentPosts();
} else if (supergroup) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ void RepostView::draw(Painter &p, int x, int y, int availableWidth) {
}
}

const auto pausedSpoiler = On(PowerSaving::kChatSpoiler);
if (w > st::historyReplyPadding.left()) {
const auto textw = w
- st::historyReplyPadding.left()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ For license and copyright information please follow this link:
#include "base/unixtime.h"
#include "lang/lang_keys.h"

#include <QLocale>
#include <QtCore/QLocale>

namespace Statistic {

Expand Down
2 changes: 0 additions & 2 deletions Telegram/SourceFiles/statistics/view/bar_chart_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ void BarChartView::paintSelectedXIndex(
auto o = ScopedPainterOpacity(p, progress);
p.setBrush(st::boxBg);
const auto r = st::statisticsDetailsDotRadius;
const auto i = selectedXIndex;
const auto isSameToken = _selectedPoints.isSame(selectedXIndex, c);
auto linePainted = false;

Expand All @@ -178,7 +177,6 @@ void BarChartView::paintSelectedXIndex(
/ float64(c.heightLimits.max - c.heightLimits.min);
const auto yPoint = (1. - yPercentage) * c.rect.height();

const auto bottomIndex = x - localStart;
const auto column = QRectF(
leftStart + (x - localStart) * w,
c.rect.height() - 0 - yPoint,
Expand Down
10 changes: 5 additions & 5 deletions Telegram/build/version
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
AppVersion 4011008
AppVersionStrMajor 4.11
AppVersionStrSmall 4.11.8
AppVersionStr 4.11.8
AppVersion 4012001
AppVersionStrMajor 4.12
AppVersionStrSmall 4.12.1
AppVersionStr 4.12.1
BetaChannel 0
AlphaVersion 0
AppVersionOriginal 4.11.8
AppVersionOriginal 4.12.1
13 changes: 13 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
4.12.1 (01.12.23)

- Fix assertion violation with imported messages.

4.12 (30.11.23)

- Similar channels.
- Wallpapers for both sides.
- Voice-to-Text for rveryone.
- Story statistics for channels.
- Custom Reactions for channels.
- Automatic code highlighting in messages.

4.11.8 (14.11.23)

- Fix phrases on macOS by doing a clean rebuild.
Expand Down

0 comments on commit da67de0

Please sign in to comment.