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 Sep 28, 2018
2 parents 1d6b7ca + 8c440cc commit 91e391e
Show file tree
Hide file tree
Showing 41 changed files with 727 additions and 770 deletions.
Binary file added Telegram/Resources/icons/settings_stickers.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/settings_themes.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.
5 changes: 1 addition & 4 deletions Telegram/Resources/langs/lang.strings
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_settings_show_preview" = "Show message preview";
"lng_settings_use_windows" = "Use Windows notifications";
"lng_settings_use_native_notifications" = "Use native notifications";
"lng_settings_advanced_notifications" = "Notifications position and count";
"lng_settings_notifications_position" = "Location on the screen";
"lng_settings_notifications_count" = "Notifications count";
"lng_settings_sound_notify" = "Play sound";
Expand Down Expand Up @@ -331,15 +330,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL

"lng_settings_language" = "Language";
"lng_settings_default_scale" = "Default interface scale";
"lng_settings_edit_info" = "Edit information";
"lng_settings_connection_type" = "Connection type";
"lng_settings_downloading_update" = "Downloading update {progress}...";
"lng_settings_use_night_mode" = "Use night mode";
"lng_settings_privacy_title" = "Privacy";
"lng_settings_last_seen" = "Last seen";
"lng_settings_calls" = "Voice calls";
"lng_settings_groups_invite" = "Groups";
"lng_settings_group_privacy_about" = "Change who can add you to groups and channel.";
"lng_settings_group_privacy_about" = "Change who can add you to groups and channels.";
"lng_settings_sessions_about" = "Control your sessions on other devices.";
"lng_settings_passcode_disable" = "Disable passcode";
"lng_settings_password_disable" = "Disable cloud password";
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.3.17.0" />
Version="1.4.0.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,3,17,0
PRODUCTVERSION 1,3,17,0
FILEVERSION 1,4,0,0
PRODUCTVERSION 1,4,0,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.3.17.0"
VALUE "FileVersion", "1.4.0.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2018"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "1.3.17.0"
VALUE "ProductVersion", "1.4.0.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,3,17,0
PRODUCTVERSION 1,3,17,0
FILEVERSION 1,4,0,0
PRODUCTVERSION 1,4,0,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.3.17.0"
VALUE "FileVersion", "1.4.0.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2018"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "1.3.17.0"
VALUE "ProductVersion", "1.4.0.0"
END
END
BLOCK "VarFileInfo"
Expand Down
22 changes: 17 additions & 5 deletions Telegram/SourceFiles/apiwrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -610,11 +610,23 @@ void ApiWrap::requestDialogEntry(not_null<Data::Feed*> feed) {
// }).send();
//}

void ApiWrap::requestDialogEntry(not_null<History*> history) {
if (_dialogRequests.contains(history)) {
void ApiWrap::requestDialogEntry(
not_null<History*> history,
Fn<void()> callback) {
const auto[i, ok] = _dialogRequests.try_emplace(history);
if (callback) {
i->second.push_back(std::move(callback));
}
if (!ok) {
return;
}
_dialogRequests.emplace(history);
const auto finalize = [=] {
if (const auto callbacks = _dialogRequests.take(history)) {
for (const auto callback : *callbacks) {
callback();
}
}
};
auto peers = QVector<MTPInputDialogPeer>(
1,
MTP_inputDialogPeer(history->peer->input));
Expand All @@ -623,9 +635,9 @@ void ApiWrap::requestDialogEntry(not_null<History*> history) {
)).done([=](const MTPmessages_PeerDialogs &result) {
applyPeerDialogs(result);
historyDialogEntryApplied(history);
_dialogRequests.remove(history);
finalize();
}).fail([=](const RPCError &error) {
_dialogRequests.remove(history);
finalize();
}).send();
}

Expand Down
8 changes: 6 additions & 2 deletions Telegram/SourceFiles/apiwrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ class ApiWrap : private MTP::Sender, private base::Subscriber {
void requestContacts();
void requestDialogEntry(not_null<Data::Feed*> feed);
//void requestFeedDialogsEntries(not_null<Data::Feed*> feed);
void requestDialogEntry(not_null<History*> history);
void requestDialogEntry(
not_null<History*> history,
Fn<void()> callback = nullptr);
//void applyFeedSources(const MTPDchannels_feedSources &data); // #feed
//void setFeedChannels(
// not_null<Data::Feed*> feed,
Expand Down Expand Up @@ -627,7 +629,9 @@ class ApiWrap : private MTP::Sender, private base::Subscriber {
mtpRequestId _contactsRequestId = 0;
mtpRequestId _contactsStatusesRequestId = 0;
base::flat_set<not_null<Data::Feed*>> _dialogFeedRequests;
base::flat_set<not_null<History*>> _dialogRequests;
base::flat_map<
not_null<History*>,
std::vector<Fn<void()>>> _dialogRequests;

base::flat_map<not_null<History*>, mtpRequestId> _unreadMentionsRequests;

Expand Down
4 changes: 4 additions & 0 deletions Telegram/SourceFiles/base/assertion.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,7 @@ inline constexpr void validate(bool condition, const char *message, const char *
#undef Unexpected
#endif // Unexpected
#define Unexpected(message) (::base::assertion::fail("Unexpected: " message, __FILE__, __LINE__))

#ifdef _DEBUG
#define AssertIsDebug(...)
#endif // _DEBUG
9 changes: 8 additions & 1 deletion Telegram/SourceFiles/base/bytes.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ For license and copyright information please follow this link:
*/
#pragma once

#include "base/basic_types.h"
#include <gsl/gsl>
#include <gsl/gsl_byte>

Expand All @@ -20,9 +21,15 @@ using vector = std::vector<type>;
template <gsl::index Size>
using array = std::array<type, Size>;

inline span make_detached_span(QByteArray &container) {
return gsl::as_writeable_bytes(gsl::make_span(container));
}

template <
typename Container,
typename = std::enable_if_t<!std::is_const_v<Container>>>
typename = std::enable_if_t<
!std::is_const_v<Container>
&& !std::is_same_v<Container, QByteArray>>>
inline span make_span(Container &container) {
return gsl::as_writeable_bytes(gsl::make_span(container));
}
Expand Down
4 changes: 0 additions & 4 deletions Telegram/SourceFiles/boxes/boxes.style
Original file line number Diff line number Diff line change
Expand Up @@ -403,13 +403,9 @@ shareColumnSkip: 6px;
shareActivateDuration: 150;
shareScrollDuration: 300;

notificationsBoxHeight: 420px;
notificationsBoxMonitorTop: 63px;
notificationsBoxMonitor: icon {{ "monitor", notificationsBoxMonitorFg }};
notificationsBoxScreenTop: 10px;
notificationsBoxScreenSize: size(280px, 160px);
notificationsBoxCountLabelTop: 80px;
notificationsBoxCountTop: 30px;

notificationsSampleSkip: 5px;
notificationsSampleTopSkip: 5px;
Expand Down
Loading

0 comments on commit 91e391e

Please sign in to comment.