diff --git a/Telegram/Resources/uwp/AppX/AppxManifest.xml b/Telegram/Resources/uwp/AppX/AppxManifest.xml
index e11ecd4d40eee8..d60cd07b22e19c 100644
--- a/Telegram/Resources/uwp/AppX/AppxManifest.xml
+++ b/Telegram/Resources/uwp/AppX/AppxManifest.xml
@@ -10,7 +10,7 @@
+ Version="4.12.1.0" />
Telegram Desktop
Telegram Messenger LLP
diff --git a/Telegram/Resources/winrc/Telegram.rc b/Telegram/Resources/winrc/Telegram.rc
index d21b48eb76eef3..a4ce53ab4e03b0 100644
--- a/Telegram/Resources/winrc/Telegram.rc
+++ b/Telegram/Resources/winrc/Telegram.rc
@@ -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
@@ -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"
diff --git a/Telegram/Resources/winrc/Updater.rc b/Telegram/Resources/winrc/Updater.rc
index add35d4555a391..169a806f56767e 100644
--- a/Telegram/Resources/winrc/Updater.rc
+++ b/Telegram/Resources/winrc/Updater.rc
@@ -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
@@ -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"
diff --git a/Telegram/SourceFiles/api/api_chat_participants.cpp b/Telegram/SourceFiles/api/api_chat_participants.cpp
index 583332790b67cc..1714d9e2bc7ba7 100644
--- a/Telegram/SourceFiles/api/api_chat_participants.cpp
+++ b/Telegram/SourceFiles/api/api_chat_participants.cpp
@@ -216,7 +216,6 @@ void ApplyBotsList(
const MTPmessages_Chats &chats) {
auto result = ChatParticipants::Channels();
std::vector>();
- auto total = 0;
chats.match([&](const auto &data) {
const auto &list = data.vchats().v;
result.list.reserve(list.size());
@@ -583,7 +582,6 @@ void ChatParticipants::requestSelf(not_null 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;
diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp
index 1e5a895dd97d63..7b1010272e6ad6 100644
--- a/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp
+++ b/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp
@@ -1097,7 +1097,6 @@ void Controller::fillManageSection() {
}
if (canEditReactions()) {
- const auto session = &_peer->session();
auto allowedReactions = Info::Profile::MigratedOrMeValue(
_peer
) | rpl::map([=](not_null peer) {
diff --git a/Telegram/SourceFiles/core/fork_settings.cpp b/Telegram/SourceFiles/core/fork_settings.cpp
index 6a2a3ee6a00bbc..04962b3d5ef778 100644
--- a/Telegram/SourceFiles/core/fork_settings.cpp
+++ b/Telegram/SourceFiles/core/fork_settings.cpp
@@ -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);
diff --git a/Telegram/SourceFiles/core/version.h b/Telegram/SourceFiles/core/version.h
index ffd8bf04aae288..a678a87ec02e5e 100644
--- a/Telegram/SourceFiles/core/version.h
+++ b/Telegram/SourceFiles/core/version.h
@@ -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;
diff --git a/Telegram/SourceFiles/dialogs/dialogs_row.cpp b/Telegram/SourceFiles/dialogs/dialogs_row.cpp
index a48cf6daae7c47..aaa03035feaa29 100644
--- a/Telegram/SourceFiles/dialogs/dialogs_row.cpp
+++ b/Telegram/SourceFiles/dialogs/dialogs_row.cpp
@@ -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);
diff --git a/Telegram/SourceFiles/dialogs/ui/dialogs_layout.cpp b/Telegram/SourceFiles/dialogs/ui/dialogs_layout.cpp
index 638ed969bddf83..76e40c0494ddb0 100644
--- a/Telegram/SourceFiles/dialogs/ui/dialogs_layout.cpp
+++ b/Telegram/SourceFiles/dialogs/ui/dialogs_layout.cpp
@@ -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,
diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp
index e3c42d13cb33bd..6033d90fa60812 100644
--- a/Telegram/SourceFiles/history/history_inner_widget.cpp
+++ b/Telegram/SourceFiles/history/history_inner_widget.cpp
@@ -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.");
}
diff --git a/Telegram/SourceFiles/history/history_item_components.cpp b/Telegram/SourceFiles/history/history_item_components.cpp
index 2e4f7ddeb10e36..25c5a39d14a7e7 100644
--- a/Telegram/SourceFiles/history/history_item_components.cpp
+++ b/Telegram/SourceFiles/history/history_item_components.cpp
@@ -117,7 +117,12 @@ HiddenSenderInfo::HiddenSenderInfo(
std::optional 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);
@@ -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
diff --git a/Telegram/SourceFiles/history/history_item_components.h b/Telegram/SourceFiles/history/history_item_components.h
index 4503f741667b31..0cce4e499d12fc 100644
--- a/Telegram/SourceFiles/history/history_item_components.h
+++ b/Telegram/SourceFiles/history/history_item_components.h
@@ -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;
diff --git a/Telegram/SourceFiles/history/view/controls/history_view_draft_options.cpp b/Telegram/SourceFiles/history/view/controls/history_view_draft_options.cpp
index b415a72e555c50..9c7ce70c5ab977 100644
--- a/Telegram/SourceFiles/history/view/controls/history_view_draft_options.cpp
+++ b/Telegram/SourceFiles/history/view/controls/history_view_draft_options.cpp
@@ -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.");
}
diff --git a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp
index ff973ed117db9c..08332097f35376 100644
--- a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp
+++ b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp
@@ -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.");
}
diff --git a/Telegram/SourceFiles/history/view/media/history_view_similar_channels.cpp b/Telegram/SourceFiles/history/view/media/history_view_similar_channels.cpp
index 3081fa823283c5..919a76cb096daf 100644
--- a/Telegram/SourceFiles/history/view/media/history_view_similar_channels.cpp
+++ b/Telegram/SourceFiles/history/view/media/history_view_similar_channels.cpp
@@ -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;
@@ -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) {
@@ -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
@@ -644,4 +641,4 @@ bool SimilarChannels::consumeHorizontalScroll(QPoint position, int delta) {
return true;
}
-} // namespace HistoryView
\ No newline at end of file
+} // namespace HistoryView
diff --git a/Telegram/SourceFiles/history/view/media/history_view_web_page.cpp b/Telegram/SourceFiles/history/view/media/history_view_web_page.cpp
index 2fc8c043e55b06..b42fca336b7939 100644
--- a/Telegram/SourceFiles/history/view/media/history_view_web_page.cpp
+++ b/Telegram/SourceFiles/history/view/media/history_view_web_page.cpp
@@ -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 {
diff --git a/Telegram/SourceFiles/info/similar_channels/info_similar_channels_widget.cpp b/Telegram/SourceFiles/info/similar_channels/info_similar_channels_widget.cpp
index 14474faf93536f..886a7869ed5899 100644
--- a/Telegram/SourceFiles/info/similar_channels/info_similar_channels_widget.cpp
+++ b/Telegram/SourceFiles/info/similar_channels/info_similar_channels_widget.cpp
@@ -240,7 +240,7 @@ void ListController::restoreState(
auto typeErasedState = state
? state->controllerState.get()
: nullptr;
- if (auto my = dynamic_cast(typeErasedState)) {
+ if (dynamic_cast(typeErasedState)) {
PeerListController::restoreState(std::move(state));
}
}
diff --git a/Telegram/SourceFiles/info/statistics/info_statistics_inner_widget.cpp b/Telegram/SourceFiles/info/statistics/info_statistics_inner_widget.cpp
index 29d0ff3a77dd10..ca77f7ad523c99 100644
--- a/Telegram/SourceFiles/info/statistics/info_statistics_inner_widget.cpp
+++ b/Telegram/SourceFiles/info/statistics/info_statistics_inner_widget.cpp
@@ -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) {
diff --git a/Telegram/SourceFiles/media/stories/media_stories_repost_view.cpp b/Telegram/SourceFiles/media/stories/media_stories_repost_view.cpp
index 75bddd008bc3e8..6b65ea45b9f977 100644
--- a/Telegram/SourceFiles/media/stories/media_stories_repost_view.cpp
+++ b/Telegram/SourceFiles/media/stories/media_stories_repost_view.cpp
@@ -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()
diff --git a/Telegram/SourceFiles/statistics/statistics_format_values.cpp b/Telegram/SourceFiles/statistics/statistics_format_values.cpp
index 730b33f2a3e280..da20e1aac00f21 100644
--- a/Telegram/SourceFiles/statistics/statistics_format_values.cpp
+++ b/Telegram/SourceFiles/statistics/statistics_format_values.cpp
@@ -10,7 +10,7 @@ For license and copyright information please follow this link:
#include "base/unixtime.h"
#include "lang/lang_keys.h"
-#include
+#include
namespace Statistic {
diff --git a/Telegram/SourceFiles/statistics/view/bar_chart_view.cpp b/Telegram/SourceFiles/statistics/view/bar_chart_view.cpp
index d5ec29fb822271..5e75d4d058fe01 100644
--- a/Telegram/SourceFiles/statistics/view/bar_chart_view.cpp
+++ b/Telegram/SourceFiles/statistics/view/bar_chart_view.cpp
@@ -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;
@@ -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,
diff --git a/Telegram/build/version b/Telegram/build/version
index 7c8f345a299d7a..d1f1bb7cabaab2 100644
--- a/Telegram/build/version
+++ b/Telegram/build/version
@@ -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
diff --git a/changelog.txt b/changelog.txt
index e823780a5cf981..e49bb5adad3d9b 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -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.