Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/telegramdesktop/tdesktop int…
Browse files Browse the repository at this point in the history
…o dev
  • Loading branch information
kirsan31 committed Feb 1, 2019
2 parents fef3a12 + 2d4c99a commit be3f66d
Show file tree
Hide file tree
Showing 42 changed files with 298 additions and 176 deletions.
4 changes: 0 additions & 4 deletions .appveyor/install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ GOTO:EOF
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION
)

echo %BUILD_VERSION% | findstr /C:"disable_unity_integration">nul && (
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_UNITY_INTEGRATION
)

echo %BUILD_VERSION% | findstr /C:"disable_gtk_integration">nul && (
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_GTK_INTEGRATION
)
Expand Down
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ env:
- BUILD_VERSION="disable_crash_reports"
- BUILD_VERSION="disable_network_proxy"
- BUILD_VERSION="disable_desktop_file_generation"
- BUILD_VERSION="disable_unity_integration"
- BUILD_VERSION="disable_gtk_integration"

matrix:
Expand Down Expand Up @@ -45,7 +44,7 @@ addons:
- libopus-dev
- libpulse-dev
- libssl-dev
- libunity-dev
- libdee-dev
- libva-dev
- libvdpau-dev
- libxcb-xkb-dev
Expand Down
4 changes: 0 additions & 4 deletions .travis/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,6 @@ build() {
GYP_DEFINES+=",TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION"
fi

if [[ $BUILD_VERSION == *"disable_unity_integration"* ]]; then
GYP_DEFINES+=",TDESKTOP_DISABLE_UNITY_INTEGRATION"
fi

if [[ $BUILD_VERSION == *"disable_gtk_integration"* ]]; then
GYP_DEFINES+=",TDESKTOP_DISABLE_GTK_INTEGRATION"
fi
Expand Down
Binary file added Telegram/Resources/icons/dialogs_bot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Telegram/Resources/numbers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
52;MX;Mexico;
51;PE;Peru;51 XXX XXX XXX;11;
49;DE;Germany;49 XXX XXXXXXXX;13;
48;PL;Poland;48 XX XXX XXXX;11;
48;PL;Poland;48 XXX XXX XXX;11;
47;NO;Norway;47 XXXX XXXX;10;
46;SE;Sweden;46 XX XXX XXXX;11;
45;DK;Denmark;45 XXXX XXXX;10;
Expand Down
2 changes: 1 addition & 1 deletion Telegram/Resources/uwp/AppX/AppxManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Identity Name="TelegramMessengerLLP.TelegramDesktop"
ProcessorArchitecture="ARCHITECTURE"
Publisher="CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A"
Version="1.5.9.0" />
Version="1.5.10.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 @@ -34,8 +34,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,5,9,0
PRODUCTVERSION 1,5,9,0
FILEVERSION 1,5,10,0
PRODUCTVERSION 1,5,10,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -52,10 +52,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram Messenger LLP"
VALUE "FileDescription", "Telegram Desktop"
VALUE "FileVersion", "1.5.9.0"
VALUE "FileVersion", "1.5.10.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2019"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "1.5.9.0"
VALUE "ProductVersion", "1.5.10.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 @@ -25,8 +25,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,5,9,0
PRODUCTVERSION 1,5,9,0
FILEVERSION 1,5,10,0
PRODUCTVERSION 1,5,10,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -43,10 +43,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram Messenger LLP"
VALUE "FileDescription", "Telegram Desktop Updater"
VALUE "FileVersion", "1.5.9.0"
VALUE "FileVersion", "1.5.10.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2019"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "1.5.9.0"
VALUE "ProductVersion", "1.5.10.0"
END
END
BLOCK "VarFileInfo"
Expand Down
4 changes: 2 additions & 2 deletions Telegram/SourceFiles/boxes/background_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ AdminLog::OwnedItem GenerateTextItem(
Expects(history->peer->isUser());

using Flag = MTPDmessage::Flag;
const auto id = ServerMaxMsgId + (ServerMaxMsgId / 3) + (out ? 1 : 0);
static auto id = ServerMaxMsgId + (ServerMaxMsgId / 3);
const auto flags = Flag::f_entities
| Flag::f_from_id
| (out ? Flag::f_out : Flag(0));
const auto replyTo = 0;
const auto viaBotId = 0;
const auto item = new HistoryMessage(
history,
id,
++id,
flags,
replyTo,
viaBotId,
Expand Down
34 changes: 24 additions & 10 deletions Telegram/SourceFiles/boxes/calendar_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,16 +495,8 @@ void CalendarBox::setMaxDate(QDate date) {
}

void CalendarBox::prepare() {
_previous->setClickedCallback([this] {
if (isPreviousEnabled()) {
_context->skipMonth(-1);
}
});
_next->setClickedCallback([this] {
if (isNextEnabled()) {
_context->skipMonth(1);
}
});
_previous->setClickedCallback([this] { goPreviousMonth(); });
_next->setClickedCallback([this] { goNextMonth(); });

// _inner = setInnerWidget(object_ptr<Inner>(this, _context.get()), st::calendarScroll, st::calendarTitleHeight);
_inner->setDateChosenCallback(std::move(_callback));
Expand All @@ -528,6 +520,18 @@ bool CalendarBox::isNextEnabled() const {
return (_context->maxDayIndex() >= _context->daysCount());
}

void CalendarBox::goPreviousMonth() {
if (isPreviousEnabled()) {
_context->skipMonth(-1);
}
}

void CalendarBox::goNextMonth() {
if (isNextEnabled()) {
_context->skipMonth(1);
}
}

void CalendarBox::monthChanged(QDate month) {
setDimensions(_st.width, st::calendarTitleHeight + _inner->countHeight());
auto previousEnabled = isPreviousEnabled();
Expand All @@ -548,4 +552,14 @@ void CalendarBox::resizeEvent(QResizeEvent *e) {
BoxContent::resizeEvent(e);
}

void CalendarBox::keyPressEvent(QKeyEvent *e) {
if (e->key() == Qt::Key_Escape) {
e->ignore();
} else if (e->key() == Qt::Key_Left) {
goPreviousMonth();
} else if (e->key() == Qt::Key_Right) {
goNextMonth();
}
}

CalendarBox::~CalendarBox() = default;
4 changes: 4 additions & 0 deletions Telegram/SourceFiles/boxes/calendar_box.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class CalendarBox : public BoxContent {
protected:
void prepare() override;

void keyPressEvent(QKeyEvent *e) override;
void resizeEvent(QResizeEvent *e) override;

private:
Expand All @@ -50,6 +51,9 @@ class CalendarBox : public BoxContent {
bool isPreviousEnabled() const;
bool isNextEnabled() const;

void goPreviousMonth();
void goNextMonth();

const style::CalendarSizes &_st;

class Context;
Expand Down
21 changes: 17 additions & 4 deletions Telegram/SourceFiles/core/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void Application::run() {
anim::startManager();
Ui::InitTextOptions();
Ui::Emoji::Init();
Media::Player::start();
Media::Player::start(_audio.get());

DEBUG_LOG(("Application Info: inited..."));

Expand Down Expand Up @@ -491,10 +491,13 @@ void Application::setMtpAuthorization(const QByteArray &serialized) {
void Application::startMtp() {
Expects(!_mtproto);

auto config = base::take(_private->mtpConfig);
config.deviceModel = _launcher->deviceModel();
config.systemVersion = _launcher->systemVersion();
_mtproto = std::make_unique<MTP::Instance>(
_dcOptions.get(),
MTP::Instance::Mode::Normal,
base::take(_private->mtpConfig));
std::move(config));
_mtproto->setUserPhone(cLoggedPhoneNumber());
_private->mtpConfig.mainDcId = _mtproto->mainDcId();

Expand Down Expand Up @@ -577,7 +580,12 @@ void Application::destroyMtpKeys(MTP::AuthKeysList &&keys) {
auto destroyConfig = MTP::Instance::Config();
destroyConfig.mainDcId = MTP::Instance::Config::kNoneMainDc;
destroyConfig.keys = std::move(keys);
_mtprotoForKeysDestroy = std::make_unique<MTP::Instance>(_dcOptions.get(), MTP::Instance::Mode::KeysDestroyer, std::move(destroyConfig));
destroyConfig.deviceModel = _launcher->deviceModel();
destroyConfig.systemVersion = _launcher->systemVersion();
_mtprotoForKeysDestroy = std::make_unique<MTP::Instance>(
_dcOptions.get(),
MTP::Instance::Mode::KeysDestroyer,
std::move(destroyConfig));
connect(
_mtprotoForKeysDestroy.get(),
&MTP::Instance::allKeysDestroyed,
Expand Down Expand Up @@ -1090,6 +1098,11 @@ void Application::preventWindowActivation() {
void Application::QuitAttempt() {
auto prevents = false;
if (AuthSession::Exists() && !Sandbox::Instance().isSavingSession()) {
if (const auto mainwidget = App::main()) {
if (mainwidget->isQuitPrevent()) {
prevents = true;
}
}
if (Auth().api().isQuitPrevent()) {
prevents = true;
}
Expand Down Expand Up @@ -1168,7 +1181,7 @@ Application::~Application() {

Window::Theme::Unload();

Media::Player::finish();
Media::Player::finish(_audio.get());
style::stopManager();

Local::finish();
Expand Down
1 change: 0 additions & 1 deletion Telegram/SourceFiles/core/launcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class Launcher {
QString argumentsString() const;
bool customWorkingDir() const;

// Thread safe.
QString deviceModel() const;
QString systemVersion() const;
uint64 installationTag() const;
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 @@ -15,7 +15,7 @@ For license and copyright information please follow this link:
#define TDESKTOP_ALPHA_VERSION (0ULL)
#endif // TDESKTOP_OFFICIAL_TARGET

constexpr auto AppVersion = 1005009;
constexpr auto AppVersionStr = "1.5.9 mod";
constexpr auto AppVersion = 1005010;
constexpr auto AppVersionStr = "1.5.10 mod";
constexpr auto AppBetaVersion = false;
constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION;
3 changes: 3 additions & 0 deletions Telegram/SourceFiles/dialogs/dialogs.style
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ dialogsChatIconActive: icon {{ "dialogs_chat", dialogsChatIconFgActive, point(1p
dialogsChannelIcon: icon {{ "dialogs_channel", dialogsChatIconFg, point(3px, 4px) }};
dialogsChannelIconOver: icon {{ "dialogs_channel", dialogsChatIconFgOver, point(3px, 4px) }};
dialogsChannelIconActive: icon {{ "dialogs_channel", dialogsChatIconFgActive, point(3px, 4px) }};
dialogsBotIcon: icon {{ "dialogs_bot", dialogsChatIconFg, point(1px, 3px) }};
dialogsBotIconOver: icon {{ "dialogs_bot", dialogsChatIconFgOver, point(1px, 3px) }};
dialogsBotIconActive: icon {{ "dialogs_bot", dialogsChatIconFgActive, point(1px, 3px) }};
dialogsFeedIcon: icon {{ "dialogs_feed", dialogsChatIconFg, point(4px, 4px) }};
dialogsFeedIconOver: icon {{ "dialogs_feed", dialogsChatIconFgOver, point(4px, 4px) }};
dialogsFeedIconActive: icon {{ "dialogs_feed", dialogsChatIconFgActive, point(4px, 4px) }};
Expand Down
Loading

0 comments on commit be3f66d

Please sign in to comment.