From 9f2b6a7ee10cdfc7ad4ba91162285f889a93d5fb Mon Sep 17 00:00:00 2001 From: Mohammad Reza Espargham Date: Fri, 28 Oct 2016 00:24:18 +0330 Subject: [PATCH 1/9] Update README.md with a new supported OS (#2571) * Update README.md with a new supported OS Signed-off-by: MohammadReza Espargham (github: rezasp) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1fe05ab7e..6018d2e14 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ The source code is published under GPLv3 with OpenSSL exception, the license is * Mac OS X 10.8 - Mac OS X 10.11 * Mac OS X 10.6 - Mac OS X 10.7 (separate build) * Ubuntu 12.04 - Ubuntu 16.04 -* Fedora 22 +* Fedora 22 - Fedora 24 ## Third-party From 8d6e1b16977d68c32b279f494af18e20a667af87 Mon Sep 17 00:00:00 2001 From: Christoph Date: Mon, 7 Nov 2016 18:35:18 +0100 Subject: [PATCH 2/9] Add .gitattributes (#2609) Signed-off-by: Christoph --- .gitattributes | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..9ce0f35fa --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +# Set the default behavior, in case people don't have core.autocrlf set. +* text=auto + +# Ensure diffs have LF endings +*.diff text eol=lf From 1f0e2b16929ab054c1f2ced9278325f66ec95144 Mon Sep 17 00:00:00 2001 From: Christoph Date: Mon, 14 Nov 2016 20:31:09 +0100 Subject: [PATCH 3/9] Add version to the readme (#2635) Its updated by adding tags --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6018d2e14..b7a12b389 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ This is the complete source code and the build instructions for the alpha version of the official desktop client for the [Telegram][telegram] messenger, based on the [Telegram API][telegram_api] and the [MTProto][telegram_proto] secure protocol. +[![GitHub version](https://badge.fury.io/gh/telegramdesktop%2Ftdesktop.svg)](https://badge.fury.io/gh/telegramdesktop%2Ftdesktop) [![Build Status](https://travis-ci.org/telegramdesktop/tdesktop.svg?branch=master)](https://travis-ci.org/telegramdesktop/tdesktop) The source code is published under GPLv3 with OpenSSL exception, the license is available [here][license]. From 9dc660c8ec84c87bdf7cdf0a3361b6a84591c374 Mon Sep 17 00:00:00 2001 From: Faissal Bensefia Date: Sun, 20 Nov 2016 13:09:00 +0000 Subject: [PATCH 4/9] Fixes "pushd: not found" (#2654) Signed-off-by: faissaloo --- Telegram/gyp/refresh.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/Telegram/gyp/refresh.sh b/Telegram/gyp/refresh.sh index 5a456ce28..c076c08f0 100755 --- a/Telegram/gyp/refresh.sh +++ b/Telegram/gyp/refresh.sh @@ -1,3 +1,4 @@ +#!/usr/bin/env bash set -e FullExecPath=$PWD pushd `dirname $0` > /dev/null From d460897f84bad314302df1198b3dbcf3f11bf653 Mon Sep 17 00:00:00 2001 From: Marco Trevisan Date: Tue, 22 Nov 2016 07:46:08 +0100 Subject: [PATCH 5/9] main-window-linux: parse XDG_CURRENT_DESKTOP as colon separated list (#2659) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As per freedesktop specifications¹, $XDG_CURRENT_DESKTOP is a "colon-separated list of strings". Thus we need to parse it in that way. [1] https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html Signed-off-by: Marco Trevisan (github: 3v1n0) --- Telegram/SourceFiles/platform/linux/main_window_linux.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp index 5d2c22f30..7f251d44d 100644 --- a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp @@ -368,9 +368,9 @@ bool MainWindow::psHasNativeNotifications() { } void MainWindow::LibsLoaded() { - QString cdesktop = QString(getenv("XDG_CURRENT_DESKTOP")).toLower(); - noQtTrayIcon = (cdesktop == qstr("pantheon")) || (cdesktop == qstr("gnome")); - tryAppIndicator = (cdesktop == qstr("xfce")); + QStringList cdesktop = QString(getenv("XDG_CURRENT_DESKTOP")).toLower().split(':'); + noQtTrayIcon = (cdesktop.contains(qstr("pantheon"))) || (cdesktop.contains(qstr("gnome"))); + tryAppIndicator = cdesktop.contains(qstr("xfce")); if (noQtTrayIcon) cSetSupportTray(false); From 2dadf7ce5709362c57d6603fc6968d785a7c49fe Mon Sep 17 00:00:00 2001 From: Marco Trevisan Date: Wed, 23 Nov 2016 10:25:11 +0100 Subject: [PATCH 6/9] linux-libs: parse XDG_CURRENT_DESKTOP as colon separated list (#2663) Signed-off-by: Marco Trevisan (github: 3v1n0) --- Telegram/SourceFiles/platform/linux/linux_libs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/platform/linux/linux_libs.cpp b/Telegram/SourceFiles/platform/linux/linux_libs.cpp index a9731ce59..f8abb51d4 100644 --- a/Telegram/SourceFiles/platform/linux/linux_libs.cpp +++ b/Telegram/SourceFiles/platform/linux/linux_libs.cpp @@ -271,7 +271,7 @@ void start() { } #ifndef TDESKTOP_DISABLE_UNITY_INTEGRATION - if (QString(getenv("XDG_CURRENT_DESKTOP")).toLower() == qstr("unity")) { + if (QString(getenv("XDG_CURRENT_DESKTOP")).toLower().split(':').contains(qstr("unity"))) { QLibrary lib_unity(qstr("unity"), 9, 0); loadLibrary(lib_unity, "unity", 9); From 7f71ef378405e3366944dcc264bb415b92c91138 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 18 Dec 2016 12:12:42 +0300 Subject: [PATCH 7/9] Fixed bug in ffmpeg animation reader. --- .../SourceFiles/media/media_clip_ffmpeg.cpp | 22 ++++++++++++++----- .../SourceFiles/media/media_clip_ffmpeg.h | 1 + 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/media/media_clip_ffmpeg.cpp b/Telegram/SourceFiles/media/media_clip_ffmpeg.cpp index bd3abc4e0..cec2dff1e 100644 --- a/Telegram/SourceFiles/media/media_clip_ffmpeg.cpp +++ b/Telegram/SourceFiles/media/media_clip_ffmpeg.cpp @@ -27,6 +27,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org namespace Media { namespace Clip { namespace internal { +namespace { + +constexpr int kSkipInvalidDataPackets = 10; + +} // namespace FFMpegReaderImplementation::FFMpegReaderImplementation(FileLocation *location, QByteArray *data, uint64 playId) : ReaderImplementation(location, data) , _playId(playId) { @@ -54,6 +59,10 @@ ReaderImplementation::ReadResult FFMpegReaderImplementation::readNextFrame() { if (_mode == Mode::Normal) { return ReadResult::EndOfFile; } + if (!_hadFrame) { + LOG(("Gif Error: Got EOF before a single frame was read!")); + return ReadResult::Error; + } if ((res = avformat_seek_file(_fmtContext, _streamId, std::numeric_limits::min(), 0, std::numeric_limits::max(), 0)) < 0) { if ((res = av_seek_frame(_fmtContext, _streamId, 0, AVSEEK_FLAG_BYTE)) < 0) { @@ -70,11 +79,12 @@ ReaderImplementation::ReadResult FFMpegReaderImplementation::readNextFrame() { _hadFrame = false; _frameMs = 0; _lastReadVideoMs = _lastReadAudioMs = 0; + _skippedInvalidDataPackets = 0; continue; } else if (res != AVERROR(EAGAIN)) { char err[AV_ERROR_MAX_STRING_SIZE] = { 0 }; - LOG(("Audio Error: Unable to avcodec_receive_frame() %1, error %2, %3").arg(logData()).arg(res).arg(av_make_error_string(err, sizeof(err), res))); + LOG(("Gif Error: Unable to avcodec_receive_frame() %1, error %2, %3").arg(logData()).arg(res).arg(av_make_error_string(err, sizeof(err), res))); return ReadResult::Error; } @@ -100,9 +110,11 @@ ReaderImplementation::ReadResult FFMpegReaderImplementation::readNextFrame() { finishPacket(); char err[AV_ERROR_MAX_STRING_SIZE] = { 0 }; - LOG(("Audio Error: Unable to avcodec_send_packet() %1, error %2, %3").arg(logData()).arg(res).arg(av_make_error_string(err, sizeof(err), res))); + LOG(("Gif Error: Unable to avcodec_send_packet() %1, error %2, %3").arg(logData()).arg(res).arg(av_make_error_string(err, sizeof(err), res))); if (res == AVERROR_INVALIDDATA) { - continue; // try to skip bad packet + if (++_skippedInvalidDataPackets < kSkipInvalidDataPackets) { + continue; // try to skip bad packet + } } return ReadResult::Error; } @@ -319,11 +331,11 @@ bool FFMpegReaderImplementation::start(Mode mode, int64 &positionMs) { _codecContext = avcodec_alloc_context3(nullptr); if (!_codecContext) { - LOG(("Audio Error: Unable to avcodec_alloc_context3 %1").arg(logData())); + LOG(("Gif Error: Unable to avcodec_alloc_context3 %1").arg(logData())); return false; } if ((res = avcodec_parameters_to_context(_codecContext, _fmtContext->streams[_streamId]->codecpar)) < 0) { - LOG(("Audio Error: Unable to avcodec_parameters_to_context %1, error %2, %3").arg(logData()).arg(res).arg(av_make_error_string(err, sizeof(err), res))); + LOG(("Gif Error: Unable to avcodec_parameters_to_context %1, error %2, %3").arg(logData()).arg(res).arg(av_make_error_string(err, sizeof(err), res))); return false; } av_codec_set_pkt_timebase(_codecContext, _fmtContext->streams[_streamId]->time_base); diff --git a/Telegram/SourceFiles/media/media_clip_ffmpeg.h b/Telegram/SourceFiles/media/media_clip_ffmpeg.h index 2810e7e7f..3860c766d 100644 --- a/Telegram/SourceFiles/media/media_clip_ffmpeg.h +++ b/Telegram/SourceFiles/media/media_clip_ffmpeg.h @@ -103,6 +103,7 @@ private: bool _opened = false; bool _hadFrame = false; bool _frameRead = false; + int _skippedInvalidDataPackets = 0; int _audioStreamId = -1; uint64 _playId = 0; From 09b429592f4645bc85c3edaa3c7058ba264ead5d Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 18 Dec 2016 18:47:32 +0300 Subject: [PATCH 8/9] Version 0.10.20: crash fixed in group create box. --- Telegram/Resources/winrc/Telegram.rc | 8 ++++---- Telegram/Resources/winrc/Updater.rc | 8 ++++---- Telegram/SourceFiles/boxes/addcontactbox.cpp | 3 +++ Telegram/SourceFiles/core/version.h | 4 ++-- Telegram/build/version | 6 +++--- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Telegram/Resources/winrc/Telegram.rc b/Telegram/Resources/winrc/Telegram.rc index 42dfb4ca5..348614fec 100644 --- a/Telegram/Resources/winrc/Telegram.rc +++ b/Telegram/Resources/winrc/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,10,19,0 - PRODUCTVERSION 0,10,19,0 + FILEVERSION 0,10,20,0 + PRODUCTVERSION 0,10,20,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.10.19.0" + VALUE "FileVersion", "0.10.20.0" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.10.19.0" + VALUE "ProductVersion", "0.10.20.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/Resources/winrc/Updater.rc b/Telegram/Resources/winrc/Updater.rc index 94d2a067f..c53259b83 100644 --- a/Telegram/Resources/winrc/Updater.rc +++ b/Telegram/Resources/winrc/Updater.rc @@ -25,8 +25,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,10,19,0 - PRODUCTVERSION 0,10,19,0 + FILEVERSION 0,10,20,0 + PRODUCTVERSION 0,10,20,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -43,10 +43,10 @@ BEGIN BEGIN VALUE "CompanyName", "Telegram Messenger LLP" VALUE "FileDescription", "Telegram Updater" - VALUE "FileVersion", "0.10.19.0" + VALUE "FileVersion", "0.10.20.0" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.10.19.0" + VALUE "ProductVersion", "0.10.20.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/SourceFiles/boxes/addcontactbox.cpp b/Telegram/SourceFiles/boxes/addcontactbox.cpp index a828db91d..af5f46f44 100644 --- a/Telegram/SourceFiles/boxes/addcontactbox.cpp +++ b/Telegram/SourceFiles/boxes/addcontactbox.cpp @@ -559,6 +559,9 @@ void GroupInfoBox::notifyFileQueryUpdated(const FileDialog::QueryUpdate &update) return; } _setPhotoFileQueryId = 0; + if (update.remoteContent.isEmpty() && update.filePaths.isEmpty()) { + return; + } QImage img; if (!update.remoteContent.isEmpty()) { diff --git a/Telegram/SourceFiles/core/version.h b/Telegram/SourceFiles/core/version.h index 7fc1fbaaf..bc397ab9b 100644 --- a/Telegram/SourceFiles/core/version.h +++ b/Telegram/SourceFiles/core/version.h @@ -24,7 +24,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #define BETA_VERSION_MACRO (0ULL) -constexpr int AppVersion = 10019; -constexpr str_const AppVersionStr = "0.10.19"; +constexpr int AppVersion = 10020; +constexpr str_const AppVersionStr = "0.10.20"; constexpr bool AppAlphaVersion = false; constexpr uint64 AppBetaVersion = BETA_VERSION_MACRO; diff --git a/Telegram/build/version b/Telegram/build/version index 37d79d925..b115c2711 100644 --- a/Telegram/build/version +++ b/Telegram/build/version @@ -1,6 +1,6 @@ -AppVersion 10019 +AppVersion 10020 AppVersionStrMajor 0.10 -AppVersionStrSmall 0.10.19 -AppVersionStr 0.10.19 +AppVersionStrSmall 0.10.20 +AppVersionStr 0.10.20 AlphaChannel 0 BetaVersion 0 From 19b77ee4ac37a211d48b16087edd92e70e1019dc Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 18 Dec 2016 19:12:49 +0300 Subject: [PATCH 9/9] Version 0.10.20: don't allow the share url start with an inline bot. --- Telegram/SourceFiles/mainwidget.cpp | 4 ++++ Telegram/build/build.bat | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 550216a01..587bc7f29 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -722,6 +722,10 @@ void MainWidget::shareContactLayer(UserData *contact) { } void MainWidget::shareUrlLayer(const QString &url, const QString &text) { + // Don't allow to insert an inline bot query by share url link. + if (url.trimmed().startsWith('@')) { + return; + } hiderLayer(new HistoryHider(this, url, text)); } diff --git a/Telegram/build/build.bat b/Telegram/build/build.bat index c9e3ef237..281781a7c 100644 --- a/Telegram/build/build.bat +++ b/Telegram/build/build.bat @@ -176,7 +176,7 @@ echo . echo Version %AppVersionStrFull% is ready for deploy! echo . -set "FinalReleasePath=Z:\TBuild\tother\tsetup" +set "FinalReleasePath=Y:\TBuild\tother\tsetup" set "FinalDeployPath=%FinalReleasePath%\%AppVersionStrMajor%\%AppVersionStrFull%" if not exist "%DeployPath%\%UpdateFile%" goto error