Updated TDesktop sources to 3.1.1+0984e63

This commit is contained in:
Eric Kotato 2021-09-26 01:19:20 +03:00
commit e151ab45b3
22 changed files with 98 additions and 44 deletions

View file

@ -266,12 +266,16 @@ jobs:
- name: Opus. - name: Opus.
if: steps.cache-opus.outputs.cache-hit != 'true' if: steps.cache-opus.outputs.cache-hit != 'true'
run: | run: |
git clone %GIT%/telegramdesktop/opus.git git clone -b v1.3.1 %GIT%/xiph/opus.git
cd opus cd opus
git checkout tdesktop cmake -B out . ^
cd win32\VS2015 -A Win32 ^
msbuild -m opus.sln /property:Configuration=Debug /property:Platform="Win32" -DCMAKE_INSTALL_PREFIX=%LibrariesPath%/local/opus ^
msbuild -m opus.sln /property:Configuration=Release /property:Platform="Win32" -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. - name: Rnnoise.
run: | run: |

View file

@ -9,7 +9,7 @@
<Identity Name="TelegramMessengerLLP.TelegramDesktop" <Identity Name="TelegramMessengerLLP.TelegramDesktop"
ProcessorArchitecture="ARCHITECTURE" ProcessorArchitecture="ARCHITECTURE"
Publisher="CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A" Publisher="CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A"
Version="3.1.0.0" /> Version="3.1.1.0" />
<Properties> <Properties>
<DisplayName>Telegram Desktop</DisplayName> <DisplayName>Telegram Desktop</DisplayName>
<PublisherDisplayName>Telegram Messenger LLP</PublisherDisplayName> <PublisherDisplayName>Telegram Messenger LLP</PublisherDisplayName>

View file

@ -44,8 +44,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,1,0,0 FILEVERSION 3,1,1,0
PRODUCTVERSION 3,1,0,0 PRODUCTVERSION 3,1,1,0
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -62,10 +62,10 @@ BEGIN
BEGIN BEGIN
VALUE "CompanyName", "Telegram FZ-LLC" VALUE "CompanyName", "Telegram FZ-LLC"
VALUE "FileDescription", "Telegram Desktop" VALUE "FileDescription", "Telegram Desktop"
VALUE "FileVersion", "3.1.0.0" VALUE "FileVersion", "3.1.1.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2021" VALUE "LegalCopyright", "Copyright (C) 2014-2021"
VALUE "ProductName", "Telegram Desktop" VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "3.1.0.0" VALUE "ProductVersion", "3.1.1.0"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

View file

@ -35,8 +35,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,1,0,0 FILEVERSION 3,1,1,0
PRODUCTVERSION 3,1,0,0 PRODUCTVERSION 3,1,1,0
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -53,10 +53,10 @@ BEGIN
BEGIN BEGIN
VALUE "CompanyName", "Telegram FZ-LLC" VALUE "CompanyName", "Telegram FZ-LLC"
VALUE "FileDescription", "Telegram Desktop Updater" VALUE "FileDescription", "Telegram Desktop Updater"
VALUE "FileVersion", "3.1.0.0" VALUE "FileVersion", "3.1.1.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2021" VALUE "LegalCopyright", "Copyright (C) 2014-2021"
VALUE "ProductName", "Telegram Desktop" VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "3.1.0.0" VALUE "ProductVersion", "3.1.1.0"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

View file

@ -22,7 +22,7 @@ constexpr auto AppId = "{C4A4AE8F-B9F7-4CC7-8A6C-BF7EEE87ACA5}"_cs;
constexpr auto AppNameOld = "Telegram Win (Unofficial)"_cs; constexpr auto AppNameOld = "Telegram Win (Unofficial)"_cs;
constexpr auto AppName = "Kotatogram Desktop"_cs; constexpr auto AppName = "Kotatogram Desktop"_cs;
constexpr auto AppFile = "Kotatogram"_cs; constexpr auto AppFile = "Kotatogram"_cs;
constexpr auto AppVersion = 3001000; constexpr auto AppVersion = 3001001;
constexpr auto AppVersionStr = "3.1"; constexpr auto AppVersionStr = "3.1.1";
constexpr auto AppBetaVersion = false; constexpr auto AppBetaVersion = false;
constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION; constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION;

View file

@ -341,6 +341,9 @@ enum class MessageFlag : uint32 {
// Fake message for some UI element. // Fake message for some UI element.
FakeHistoryItem = (1U << 27), 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; } inline constexpr bool is_flag_type(MessageFlag) { return true; }
using MessageFlags = base::flags<MessageFlag>; using MessageFlags = base::flags<MessageFlag>;

View file

@ -12,6 +12,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Editor { namespace Editor {
QImage ImageModified(QImage image, const PhotoModifications &mods) { QImage ImageModified(QImage image, const PhotoModifications &mods) {
Expects(!image.isNull());
if (!mods) { if (!mods) {
return image; return image;
} }

View file

@ -460,6 +460,17 @@ bool HistoryItem::isScheduled() const {
&& (_flags & MessageFlag::IsOrWasScheduled); && (_flags & MessageFlag::IsOrWasScheduled);
} }
bool HistoryItem::skipNotification() const {
if (isSilent() && (_flags & MessageFlag::IsContactSignUp)) {
return true;
} else if (const auto forwarded = Get<HistoryMessageForwarded>()) {
if (forwarded->imported) {
return true;
}
}
return false;
}
void HistoryItem::destroy() { void HistoryItem::destroy() {
_history->destroyMessage(this); _history->destroyMessage(this);
} }

View file

@ -109,6 +109,7 @@ public:
[[nodiscard]] bool isAdminLogEntry() const; [[nodiscard]] bool isAdminLogEntry() const;
[[nodiscard]] bool isFromScheduled() const; [[nodiscard]] bool isFromScheduled() const;
[[nodiscard]] bool isScheduled() const; [[nodiscard]] bool isScheduled() const;
[[nodiscard]] bool skipNotification() const;
void addLogEntryOriginal( void addLogEntryOriginal(
WebPageId localId, WebPageId localId,

View file

@ -564,6 +564,8 @@ void HistoryService::applyAction(const MTPMessageAction &action) {
_flags |= MessageFlag::IsGroupEssential; _flags |= MessageFlag::IsGroupEssential;
}, [&](const MTPDmessageActionChannelMigrateFrom &) { }, [&](const MTPDmessageActionChannelMigrateFrom &) {
_flags |= MessageFlag::IsGroupEssential; _flags |= MessageFlag::IsGroupEssential;
}, [&](const MTPDmessageActionContactSignUp &) {
_flags |= MessageFlag::IsContactSignUp;
}, [](const auto &) { }, [](const auto &) {
}); });
} }

View file

@ -790,7 +790,7 @@ void MainWindow::toggleDisplayNotifyFromTray() {
settings.setRememberedFlashBounceNotifyFromTray(false); settings.setRememberedFlashBounceNotifyFromTray(false);
} }
} }
account().session().saveSettings(); Core::App().saveSettingsDelayed();
using Change = Window::Notifications::ChangeType; using Change = Window::Notifications::ChangeType;
auto &notifications = Core::App().notifications(); auto &notifications = Core::App().notifications();
notifications.notifySettingsChanged(Change::DesktopEnabled); notifications.notifySettingsChanged(Change::DesktopEnabled);

View file

@ -40,6 +40,8 @@ bool HasExtensionFrom(const QString &file, const QStringList &extensions) {
bool ValidPhotoForAlbum( bool ValidPhotoForAlbum(
const Image &image, const Image &image,
const QString &mime) { const QString &mime) {
Expects(!image.data.isNull());
if (image.animated if (image.animated
|| Core::IsMimeSticker(mime) || Core::IsMimeSticker(mime)
|| (!mime.isEmpty() && !mime.startsWith(u"image/"))) { || (!mime.isEmpty() && !mime.startsWith(u"image/"))) {
@ -228,6 +230,8 @@ PreparedList PrepareMediaFromImage(
QImage &&image, QImage &&image,
QByteArray &&content, QByteArray &&content,
int previewWidth) { int previewWidth) {
Expects(!image.isNull());
auto result = PreparedList(); auto result = PreparedList();
auto file = PreparedFile(QString()); auto file = PreparedFile(QString());
file.content = content; file.content = content;
@ -288,6 +292,7 @@ void PrepareDetails(PreparedFile &file, int previewWidth) {
using Song = PreparedFileInformation::Song; using Song = PreparedFileInformation::Song;
if (const auto image = std::get_if<Image>( if (const auto image = std::get_if<Image>(
&file.information->media)) { &file.information->media)) {
Assert(!image->data.isNull());
if (ValidPhotoForAlbum(*image, file.information->filemime)) { if (ValidPhotoForAlbum(*image, file.information->filemime)) {
UpdateImageDetails(file, previewWidth); UpdateImageDetails(file, previewWidth);
file.type = PreparedFile::Type::Photo; file.type = PreparedFile::Type::Photo;
@ -317,14 +322,18 @@ void UpdateImageDetails(PreparedFile &file, int previewWidth) {
if (!image) { if (!image) {
return; return;
} }
const auto &preview = image->modifications Assert(!image->data.isNull());
auto preview = image->modifications
? Editor::ImageModified(image->data, image->modifications) ? Editor::ImageModified(image->data, image->modifications)
: image->data; : image->data;
Assert(!preview.isNull());
file.shownDimensions = PrepareShownDimensions(preview); file.shownDimensions = PrepareShownDimensions(preview);
file.preview = Images::prepareOpaque(preview.scaledToWidth( const auto scaled = preview.scaledToWidth(
std::min(previewWidth, style::ConvertScale(preview.width())) (std::min(previewWidth, style::ConvertScale(preview.width()))
* cIntRetinaFactor(), * cIntRetinaFactor()),
Qt::SmoothTransformation)); Qt::SmoothTransformation);
Assert(!scaled.isNull());
file.preview = Images::prepareOpaque(scaled);
Assert(!file.preview.isNull()); Assert(!file.preview.isNull());
file.preview.setDevicePixelRatio(cRetinaFactor()); file.preview.setDevicePixelRatio(cRetinaFactor());
} }

View file

@ -100,25 +100,21 @@ System::SkipState System::skipNotification(
not_null<HistoryItem*> item) const { not_null<HistoryItem*> item) const {
const auto history = item->history(); const auto history = item->history();
const auto notifyBy = item->specialNotificationPeer(); const auto notifyBy = item->specialNotificationPeer();
if (App::quitting() || !history->currentNotification()) { if (App::quitting()
|| !history->currentNotification()
|| item->skipNotification()) {
return { SkipState::Skip }; return { SkipState::Skip };
} else if (!Core::App().settings().notifyFromAll() } else if (!Core::App().settings().notifyFromAll()
&& &history->session().account() != &Core::App().domain().active()) { && &history->session().account() != &Core::App().domain().active()) {
return { SkipState::Skip }; return { SkipState::Skip };
} }
const auto scheduled = item->out() && item->isFromScheduled();
if (const auto forwarded = item->Get<HistoryMessageForwarded>()) {
if (forwarded->imported) {
return { SkipState::Skip };
}
}
history->owner().requestNotifySettings(history->peer); history->owner().requestNotifySettings(history->peer);
if (notifyBy) { if (notifyBy) {
history->owner().requestNotifySettings(notifyBy); history->owner().requestNotifySettings(notifyBy);
} }
const auto scheduled = item->out() && item->isFromScheduled();
if (history->owner().notifyMuteUnknown(history->peer)) { if (history->owner().notifyMuteUnknown(history->peer)) {
return { SkipState::Unknown, item->isSilent() }; return { SkipState::Unknown, item->isSilent() };
} else if (!history->owner().notifyIsMuted(history->peer)) { } else if (!history->owner().notifyIsMuted(history->peer)) {

View file

@ -29,7 +29,7 @@ ENV LibrariesPath /usr/src/Libraries
WORKDIR $LibrariesPath WORKDIR $LibrariesPath
FROM builder AS patches 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 FROM builder AS extra-cmake-modules

View file

@ -0,0 +1,7 @@
set -e
FullExecPath=$PWD
pushd `dirname $0` > /dev/null
FullScriptPath=`pwd`
popd > /dev/null
./build/docker/centos_env/prepare.sh

View file

@ -379,7 +379,7 @@ def runStages():
stage('patches', """ stage('patches', """
git clone https://github.com/desktop-app/patches.git git clone https://github.com/desktop-app/patches.git
cd patches cd patches
git checkout 1a1d9e6d2c git checkout 52e847920f
""") """)
stage('depot_tools', """ stage('depot_tools', """
@ -396,6 +396,7 @@ depends:patches/gyp.diff
git apply $LIBS_DIR/patches/gyp.diff git apply $LIBS_DIR/patches/gyp.diff
mac: mac:
python3 -m pip install git+https://github.com/nodejs/gyp-next@v0.10.0 python3 -m pip install git+https://github.com/nodejs/gyp-next@v0.10.0
mkdir gyp
""", 'ThirdParty') """, 'ThirdParty')
stage('yasm', """ stage('yasm', """
@ -498,13 +499,18 @@ mac:
""") """)
stage('opus', """ 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 cd opus
win: win:
cd win32\\VS2015 cmake -B out . ^
msbuild opus.sln /property:Configuration=Debug /property:Platform="%WIN32X64%" -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: release:
msbuild opus.sln /property:Configuration=Release /property:Platform="%WIN32X64%" cmake --build out --config Release
cmake --install out --config Release
mac: mac:
./autogen.sh ./autogen.sh
CFLAGS="$MIN_VER $UNGUARDED" CPPFLAGS="$MIN_VER $UNGUARDED" LDFLAGS="$MIN_VER" ./configure --prefix=$USED_PREFIX CFLAGS="$MIN_VER $UNGUARDED" CPPFLAGS="$MIN_VER $UNGUARDED" LDFLAGS="$MIN_VER" ./configure --prefix=$USED_PREFIX

View file

@ -1,7 +1,7 @@
AppVersion 3001000 AppVersion 3001001
AppVersionStrMajor 3.1 AppVersionStrMajor 3.1
AppVersionStrSmall 3.1 AppVersionStrSmall 3.1.1
AppVersionStr 3.1.0 AppVersionStr 3.1.1
BetaChannel 0 BetaChannel 0
AlphaVersion 0 AlphaVersion 0
AppVersionOriginal 3.1 AppVersionOriginal 3.1.1

@ -1 +1 @@
Subproject commit 6fe29a2dfe8904559d31e3c9df5d51e9ed123011 Subproject commit d134c0361ef96b5061c2719a0e984eaaed2c1a81

@ -1 +1 @@
Subproject commit eb86d2dc51aedc0a53188f1f2beb932e19442f9b Subproject commit 300dd975a5411cf5cf066f6303cabd1ba044b1d5

View file

@ -1,3 +1,7 @@
3.1.1 (24.09.21)
- Crash fixes.
3.1 (19.09.21) 3.1 (19.09.21)
- Some animated emoji now have extra effects. - Some animated emoji now have extra effects.

2
cmake

@ -1 +1 @@
Subproject commit dfd1ab4b4959b943bb0236046d8f89bdacaaa266 Subproject commit f8a594be84f598172e9df229e44fe6121cf0a297

View file

@ -42,7 +42,16 @@ apps:
slots: slots:
- tdesktop-mpris - tdesktop-mpris
hooks:
configure:
command-chain:
- bin/hooks-configure-desktop
plugs: plugs:
- desktop
plugs:
desktop:
mount-host-font-cache: false
# Support for common GTK themes # Support for common GTK themes
# https://forum.snapcraft.io/t/how-to-use-the-system-gtk-theme-via-the-gtk-common-themes-snap/6235 # https://forum.snapcraft.io/t/how-to-use-the-system-gtk-theme-via-the-gtk-common-themes-snap/6235
gsettings: gsettings:
@ -125,7 +134,7 @@ parts:
version="$(git describe --tags | sed -r 's,^k([0-9]\.[0-9]),\1,')" version="$(git describe --tags | sed -r 's,^k([0-9]\.[0-9]),\1,')"
snapcraftctl set-version "$version" 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: | override-build: |
snapcraftctl build snapcraftctl build
rm -rf "$SNAPCRAFT_PART_INSTALL/usr/share/icons" rm -rf "$SNAPCRAFT_PART_INSTALL/usr/share/icons"