diff --git a/.github/workflows/win.yml b/.github/workflows/win.yml
index 51318a47e..29c34d68f 100644
--- a/.github/workflows/win.yml
+++ b/.github/workflows/win.yml
@@ -266,12 +266,16 @@ jobs:
- name: Opus.
if: steps.cache-opus.outputs.cache-hit != 'true'
run: |
- git clone %GIT%/telegramdesktop/opus.git
+ git clone -b v1.3.1 %GIT%/xiph/opus.git
cd opus
- git checkout tdesktop
- cd win32\VS2015
- msbuild -m opus.sln /property:Configuration=Debug /property:Platform="Win32"
- msbuild -m opus.sln /property:Configuration=Release /property:Platform="Win32"
+ cmake -B out . ^
+ -A Win32 ^
+ -DCMAKE_INSTALL_PREFIX=%LibrariesPath%/local/opus ^
+ -DCMAKE_C_FLAGS_DEBUG="/MTd /Zi /Ob0 /Od /RTC1" ^
+ -DCMAKE_C_FLAGS_RELEASE="/MT /O2 /Ob2 /DNDEBUG"
+ cmake --build out --config Debug
+ cmake --build out --config Release
+ cmake --install out --config Release
- name: Rnnoise.
run: |
diff --git a/Telegram/Resources/uwp/AppX/AppxManifest.xml b/Telegram/Resources/uwp/AppX/AppxManifest.xml
index 19f45b6c0..eb8e6e53f 100644
--- a/Telegram/Resources/uwp/AppX/AppxManifest.xml
+++ b/Telegram/Resources/uwp/AppX/AppxManifest.xml
@@ -9,7 +9,7 @@
+ Version="3.1.1.0" />
Telegram Desktop
Telegram Messenger LLP
diff --git a/Telegram/Resources/winrc/Telegram.rc b/Telegram/Resources/winrc/Telegram.rc
index 82ed99f56..e72b0f946 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 3,1,0,0
- PRODUCTVERSION 3,1,0,0
+ FILEVERSION 3,1,1,0
+ PRODUCTVERSION 3,1,1,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -62,10 +62,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram FZ-LLC"
VALUE "FileDescription", "Telegram Desktop"
- VALUE "FileVersion", "3.1.0.0"
+ VALUE "FileVersion", "3.1.1.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2021"
VALUE "ProductName", "Telegram Desktop"
- VALUE "ProductVersion", "3.1.0.0"
+ VALUE "ProductVersion", "3.1.1.0"
END
END
BLOCK "VarFileInfo"
diff --git a/Telegram/Resources/winrc/Updater.rc b/Telegram/Resources/winrc/Updater.rc
index 8afe4f568..28fd0f6ea 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 3,1,0,0
- PRODUCTVERSION 3,1,0,0
+ FILEVERSION 3,1,1,0
+ PRODUCTVERSION 3,1,1,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -53,10 +53,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram FZ-LLC"
VALUE "FileDescription", "Telegram Desktop Updater"
- VALUE "FileVersion", "3.1.0.0"
+ VALUE "FileVersion", "3.1.1.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2021"
VALUE "ProductName", "Telegram Desktop"
- VALUE "ProductVersion", "3.1.0.0"
+ VALUE "ProductVersion", "3.1.1.0"
END
END
BLOCK "VarFileInfo"
diff --git a/Telegram/SourceFiles/core/version.h b/Telegram/SourceFiles/core/version.h
index 4c6571e96..102fbe786 100644
--- a/Telegram/SourceFiles/core/version.h
+++ b/Telegram/SourceFiles/core/version.h
@@ -22,7 +22,7 @@ constexpr auto AppId = "{C4A4AE8F-B9F7-4CC7-8A6C-BF7EEE87ACA5}"_cs;
constexpr auto AppNameOld = "Telegram Win (Unofficial)"_cs;
constexpr auto AppName = "Kotatogram Desktop"_cs;
constexpr auto AppFile = "Kotatogram"_cs;
-constexpr auto AppVersion = 3001000;
-constexpr auto AppVersionStr = "3.1";
+constexpr auto AppVersion = 3001001;
+constexpr auto AppVersionStr = "3.1.1";
constexpr auto AppBetaVersion = false;
constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION;
diff --git a/Telegram/SourceFiles/data/data_types.h b/Telegram/SourceFiles/data/data_types.h
index 680ce3aa8..dc257df8e 100644
--- a/Telegram/SourceFiles/data/data_types.h
+++ b/Telegram/SourceFiles/data/data_types.h
@@ -341,6 +341,9 @@ enum class MessageFlag : uint32 {
// Fake message for some UI element.
FakeHistoryItem = (1U << 27),
+
+ // Contact sign-up message, notification should be skipped for Silent.
+ IsContactSignUp = (1U << 28),
};
inline constexpr bool is_flag_type(MessageFlag) { return true; }
using MessageFlags = base::flags;
diff --git a/Telegram/SourceFiles/editor/photo_editor_common.cpp b/Telegram/SourceFiles/editor/photo_editor_common.cpp
index 3d9b94427..4caa14e83 100644
--- a/Telegram/SourceFiles/editor/photo_editor_common.cpp
+++ b/Telegram/SourceFiles/editor/photo_editor_common.cpp
@@ -12,6 +12,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Editor {
QImage ImageModified(QImage image, const PhotoModifications &mods) {
+ Expects(!image.isNull());
+
if (!mods) {
return image;
}
diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp
index 7e4b667d1..a5e90f223 100644
--- a/Telegram/SourceFiles/history/history_item.cpp
+++ b/Telegram/SourceFiles/history/history_item.cpp
@@ -460,6 +460,17 @@ bool HistoryItem::isScheduled() const {
&& (_flags & MessageFlag::IsOrWasScheduled);
}
+bool HistoryItem::skipNotification() const {
+ if (isSilent() && (_flags & MessageFlag::IsContactSignUp)) {
+ return true;
+ } else if (const auto forwarded = Get()) {
+ if (forwarded->imported) {
+ return true;
+ }
+ }
+ return false;
+}
+
void HistoryItem::destroy() {
_history->destroyMessage(this);
}
diff --git a/Telegram/SourceFiles/history/history_item.h b/Telegram/SourceFiles/history/history_item.h
index 813c2e734..feaa262de 100644
--- a/Telegram/SourceFiles/history/history_item.h
+++ b/Telegram/SourceFiles/history/history_item.h
@@ -109,6 +109,7 @@ public:
[[nodiscard]] bool isAdminLogEntry() const;
[[nodiscard]] bool isFromScheduled() const;
[[nodiscard]] bool isScheduled() const;
+ [[nodiscard]] bool skipNotification() const;
void addLogEntryOriginal(
WebPageId localId,
diff --git a/Telegram/SourceFiles/history/history_service.cpp b/Telegram/SourceFiles/history/history_service.cpp
index 85c678ba1..23ec5cac0 100644
--- a/Telegram/SourceFiles/history/history_service.cpp
+++ b/Telegram/SourceFiles/history/history_service.cpp
@@ -564,6 +564,8 @@ void HistoryService::applyAction(const MTPMessageAction &action) {
_flags |= MessageFlag::IsGroupEssential;
}, [&](const MTPDmessageActionChannelMigrateFrom &) {
_flags |= MessageFlag::IsGroupEssential;
+ }, [&](const MTPDmessageActionContactSignUp &) {
+ _flags |= MessageFlag::IsContactSignUp;
}, [](const auto &) {
});
}
diff --git a/Telegram/SourceFiles/mainwindow.cpp b/Telegram/SourceFiles/mainwindow.cpp
index 853a5097c..62f69b517 100644
--- a/Telegram/SourceFiles/mainwindow.cpp
+++ b/Telegram/SourceFiles/mainwindow.cpp
@@ -790,7 +790,7 @@ void MainWindow::toggleDisplayNotifyFromTray() {
settings.setRememberedFlashBounceNotifyFromTray(false);
}
}
- account().session().saveSettings();
+ Core::App().saveSettingsDelayed();
using Change = Window::Notifications::ChangeType;
auto ¬ifications = Core::App().notifications();
notifications.notifySettingsChanged(Change::DesktopEnabled);
diff --git a/Telegram/SourceFiles/storage/storage_media_prepare.cpp b/Telegram/SourceFiles/storage/storage_media_prepare.cpp
index a52010fee..bcd583d70 100644
--- a/Telegram/SourceFiles/storage/storage_media_prepare.cpp
+++ b/Telegram/SourceFiles/storage/storage_media_prepare.cpp
@@ -40,6 +40,8 @@ bool HasExtensionFrom(const QString &file, const QStringList &extensions) {
bool ValidPhotoForAlbum(
const Image &image,
const QString &mime) {
+ Expects(!image.data.isNull());
+
if (image.animated
|| Core::IsMimeSticker(mime)
|| (!mime.isEmpty() && !mime.startsWith(u"image/"))) {
@@ -228,6 +230,8 @@ PreparedList PrepareMediaFromImage(
QImage &&image,
QByteArray &&content,
int previewWidth) {
+ Expects(!image.isNull());
+
auto result = PreparedList();
auto file = PreparedFile(QString());
file.content = content;
@@ -288,6 +292,7 @@ void PrepareDetails(PreparedFile &file, int previewWidth) {
using Song = PreparedFileInformation::Song;
if (const auto image = std::get_if(
&file.information->media)) {
+ Assert(!image->data.isNull());
if (ValidPhotoForAlbum(*image, file.information->filemime)) {
UpdateImageDetails(file, previewWidth);
file.type = PreparedFile::Type::Photo;
@@ -317,14 +322,18 @@ void UpdateImageDetails(PreparedFile &file, int previewWidth) {
if (!image) {
return;
}
- const auto &preview = image->modifications
+ Assert(!image->data.isNull());
+ auto preview = image->modifications
? Editor::ImageModified(image->data, image->modifications)
: image->data;
+ Assert(!preview.isNull());
file.shownDimensions = PrepareShownDimensions(preview);
- file.preview = Images::prepareOpaque(preview.scaledToWidth(
- std::min(previewWidth, style::ConvertScale(preview.width()))
- * cIntRetinaFactor(),
- Qt::SmoothTransformation));
+ const auto scaled = preview.scaledToWidth(
+ (std::min(previewWidth, style::ConvertScale(preview.width()))
+ * cIntRetinaFactor()),
+ Qt::SmoothTransformation);
+ Assert(!scaled.isNull());
+ file.preview = Images::prepareOpaque(scaled);
Assert(!file.preview.isNull());
file.preview.setDevicePixelRatio(cRetinaFactor());
}
diff --git a/Telegram/SourceFiles/window/notifications_manager.cpp b/Telegram/SourceFiles/window/notifications_manager.cpp
index 2c15468cc..54fd6e413 100644
--- a/Telegram/SourceFiles/window/notifications_manager.cpp
+++ b/Telegram/SourceFiles/window/notifications_manager.cpp
@@ -100,25 +100,21 @@ System::SkipState System::skipNotification(
not_null item) const {
const auto history = item->history();
const auto notifyBy = item->specialNotificationPeer();
- if (App::quitting() || !history->currentNotification()) {
+ if (App::quitting()
+ || !history->currentNotification()
+ || item->skipNotification()) {
return { SkipState::Skip };
} else if (!Core::App().settings().notifyFromAll()
&& &history->session().account() != &Core::App().domain().active()) {
return { SkipState::Skip };
}
- const auto scheduled = item->out() && item->isFromScheduled();
-
- if (const auto forwarded = item->Get()) {
- if (forwarded->imported) {
- return { SkipState::Skip };
- }
- }
history->owner().requestNotifySettings(history->peer);
if (notifyBy) {
history->owner().requestNotifySettings(notifyBy);
}
+ const auto scheduled = item->out() && item->isFromScheduled();
if (history->owner().notifyMuteUnknown(history->peer)) {
return { SkipState::Unknown, item->isSilent() };
} else if (!history->owner().notifyIsMuted(history->peer)) {
diff --git a/Telegram/build/docker/centos_env/Dockerfile b/Telegram/build/docker/centos_env/Dockerfile
index a0d636fc5..94cf06538 100644
--- a/Telegram/build/docker/centos_env/Dockerfile
+++ b/Telegram/build/docker/centos_env/Dockerfile
@@ -29,7 +29,7 @@ ENV LibrariesPath /usr/src/Libraries
WORKDIR $LibrariesPath
FROM builder AS patches
-RUN git clone $GIT/desktop-app/patches.git && cd patches && git checkout 01779db1de
+RUN git clone $GIT/desktop-app/patches.git && cd patches && git checkout 9d2a07ba8b
FROM builder AS extra-cmake-modules
diff --git a/Telegram/build/prepare/linux.sh b/Telegram/build/prepare/linux.sh
new file mode 100755
index 000000000..9aec7cfe3
--- /dev/null
+++ b/Telegram/build/prepare/linux.sh
@@ -0,0 +1,7 @@
+set -e
+FullExecPath=$PWD
+pushd `dirname $0` > /dev/null
+FullScriptPath=`pwd`
+popd > /dev/null
+
+./build/docker/centos_env/prepare.sh
diff --git a/Telegram/build/prepare/prepare.py b/Telegram/build/prepare/prepare.py
index 84bcf17b2..235eb654a 100644
--- a/Telegram/build/prepare/prepare.py
+++ b/Telegram/build/prepare/prepare.py
@@ -379,7 +379,7 @@ def runStages():
stage('patches', """
git clone https://github.com/desktop-app/patches.git
cd patches
- git checkout 1a1d9e6d2c
+ git checkout 52e847920f
""")
stage('depot_tools', """
@@ -396,6 +396,7 @@ depends:patches/gyp.diff
git apply $LIBS_DIR/patches/gyp.diff
mac:
python3 -m pip install git+https://github.com/nodejs/gyp-next@v0.10.0
+ mkdir gyp
""", 'ThirdParty')
stage('yasm', """
@@ -498,13 +499,18 @@ mac:
""")
stage('opus', """
- git clone -b td-v1.3.1 https://github.com/telegramdesktop/opus.git
+ git clone -b v1.3.1 https://github.com/xiph/opus.git
cd opus
win:
- cd win32\\VS2015
- msbuild opus.sln /property:Configuration=Debug /property:Platform="%WIN32X64%"
+ cmake -B out . ^
+ -A %WIN32X64% ^
+ -DCMAKE_INSTALL_PREFIX=%LIBS_DIR%/local/opus ^
+ -DCMAKE_C_FLAGS_DEBUG="/MTd /Zi /Ob0 /Od /RTC1" ^
+ -DCMAKE_C_FLAGS_RELEASE="/MT /O2 /Ob2 /DNDEBUG"
+ cmake --build out --config Debug
release:
- msbuild opus.sln /property:Configuration=Release /property:Platform="%WIN32X64%"
+ cmake --build out --config Release
+ cmake --install out --config Release
mac:
./autogen.sh
CFLAGS="$MIN_VER $UNGUARDED" CPPFLAGS="$MIN_VER $UNGUARDED" LDFLAGS="$MIN_VER" ./configure --prefix=$USED_PREFIX
diff --git a/Telegram/build/version b/Telegram/build/version
index 7ae599adc..acb6ca62b 100644
--- a/Telegram/build/version
+++ b/Telegram/build/version
@@ -1,7 +1,7 @@
-AppVersion 3001000
+AppVersion 3001001
AppVersionStrMajor 3.1
-AppVersionStrSmall 3.1
-AppVersionStr 3.1.0
+AppVersionStrSmall 3.1.1
+AppVersionStr 3.1.1
BetaChannel 0
AlphaVersion 0
-AppVersionOriginal 3.1
+AppVersionOriginal 3.1.1
diff --git a/Telegram/lib_lottie b/Telegram/lib_lottie
index 6fe29a2df..d134c0361 160000
--- a/Telegram/lib_lottie
+++ b/Telegram/lib_lottie
@@ -1 +1 @@
-Subproject commit 6fe29a2dfe8904559d31e3c9df5d51e9ed123011
+Subproject commit d134c0361ef96b5061c2719a0e984eaaed2c1a81
diff --git a/Telegram/lib_ui b/Telegram/lib_ui
index eb86d2dc5..300dd975a 160000
--- a/Telegram/lib_ui
+++ b/Telegram/lib_ui
@@ -1 +1 @@
-Subproject commit eb86d2dc51aedc0a53188f1f2beb932e19442f9b
+Subproject commit 300dd975a5411cf5cf066f6303cabd1ba044b1d5
diff --git a/changelog.txt b/changelog.txt
index 47df8a626..63bc49baf 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -1,3 +1,7 @@
+3.1.1 (24.09.21)
+
+- Crash fixes.
+
3.1 (19.09.21)
- Some animated emoji now have extra effects.
diff --git a/cmake b/cmake
index dfd1ab4b4..f8a594be8 160000
--- a/cmake
+++ b/cmake
@@ -1 +1 @@
-Subproject commit dfd1ab4b4959b943bb0236046d8f89bdacaaa266
+Subproject commit f8a594be84f598172e9df229e44fe6121cf0a297
diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
index f3e34c677..990ef839a 100644
--- a/snap/snapcraft.yaml
+++ b/snap/snapcraft.yaml
@@ -42,7 +42,16 @@ apps:
slots:
- tdesktop-mpris
+hooks:
+ configure:
+ command-chain:
+ - bin/hooks-configure-desktop
+ plugs:
+ - desktop
+
plugs:
+ desktop:
+ mount-host-font-cache: false
# Support for common GTK themes
# https://forum.snapcraft.io/t/how-to-use-the-system-gtk-theme-via-the-gtk-common-themes-snap/6235
gsettings:
@@ -125,7 +134,7 @@ parts:
version="$(git describe --tags | sed -r 's,^k([0-9]\.[0-9]),\1,')"
snapcraftctl set-version "$version"
- sed -i 's|^Icon=.*|Icon=${SNAP}/meta/gui/icon.png|g' lib/xdg/kotatogramdesktop.desktop
+ sed -i 's|^Icon=kotatogram$|Icon=${SNAP}/meta/gui/icon.png|g' lib/xdg/telegramdesktop.desktop
override-build: |
snapcraftctl build
rm -rf "$SNAPCRAFT_PART_INSTALL/usr/share/icons"