Compare commits

...

160 Commits

Author SHA1 Message Date
John Preston
a919737f6e Version 1.3.10.
- Bug fixes and other minor improvements.
2018-07-13 14:19:25 +03:00
John Preston
8f3510b3c4 Use reverse chronological order in export. 2018-07-13 14:17:50 +03:00
John Preston
6c588a8f2f Closed beta 1.3.9.3. 2018-07-12 22:27:24 +03:00
John Preston
4c9ef606f3 Display unread/mention mark in small left column.
Fixes #4939.
2018-07-12 22:25:10 +03:00
John Preston
0b7bb806b7 Improve export HTML layout. 2018-07-12 21:15:36 +03:00
John Preston
78558e513c Closed beta 1.3.9.2. 2018-07-12 18:35:59 +03:00
John Preston
52e7ddf079 Add '-externalupdater' command-line argument.
Now no-autoupdater mode can be switched on in runtime.
Also TDESKTOP_DISABLE_AUTOUPDATE build is disabled in CI (trivial).

Fixes #4895.
2018-07-12 18:35:59 +03:00
John Preston
e2bc6990c7 Fix crash in taskbar icon refresher.
Regression was introduced in 3b956c598.
2018-07-11 23:20:21 +03:00
John Preston
06c3082fdf Fix popular sticker suggestions.
Regression was introduced in ddb4527159.

Fixes #4966.
2018-07-11 23:15:55 +03:00
John Preston
54cd55523b Fix crash in markdown preprocessing. 2018-07-11 17:56:09 +03:00
John Preston
556f75ef6c Rewrite TCP socket reading using bytes::vector.
I hope this fixes a strange assertion violation.
2018-07-11 17:56:09 +03:00
John Preston
951634a717 Closed beta 1.3.9.1. 2018-07-11 17:56:09 +03:00
John Preston
51d7e177a6 Fix error layout in passport email/phone. 2018-07-11 17:56:09 +03:00
John Preston
81e074115d Fix build for Xcode.
Regression was introduced in a8d35b67aa.
2018-07-11 17:56:09 +03:00
John Preston
9eb34e496f Update langs. 2018-07-11 17:56:08 +03:00
John Preston
da60739893 Allow uploading many scans at once in passport. 2018-07-11 17:56:08 +03:00
John Preston
7be1f16313 Don't display errors list in passport. 2018-07-11 17:56:08 +03:00
John Preston
39b0d9e46f Handle the outdated app error in passport. 2018-07-11 17:56:08 +03:00
John Preston
7be9e0fb94 Warn on passport save before upload is finished. 2018-07-11 17:56:07 +03:00
John Preston
e3e8d083ea Remember passport credentials for 30 minutes. 2018-07-11 17:56:07 +03:00
John Preston
9929bfb281 If only selfie is missing use special phrases. 2018-07-11 17:56:07 +03:00
John Preston
effa277a3b Update libtgvoip to 2.1.1. 2018-07-11 17:56:07 +03:00
John Preston
2661f81fd1 Fix field bar cancel button visibility.
Fixes #4913.
2018-07-11 17:56:07 +03:00
John Preston
661de0c326 Improve phrases in passport. 2018-07-11 17:56:06 +03:00
John Preston
e1fd43b2a4 Fix crash in text post processing.
Fixes #4948.
2018-07-11 17:56:06 +03:00
John Preston
b697824540 When following a post link push reply-return.
Fixes #4856.
2018-07-11 17:56:06 +03:00
John Preston
eb3eef4b80 Fix notify settings saving (mute vs silent).
Fixes #4855.
2018-07-10 12:18:41 +03:00
John Preston
c3736c6fa3 Improve photo/video/sticker/GIF export layout. 2018-07-10 12:18:41 +03:00
John Preston
0ef7503917 Improve export history pagination. 2018-07-10 12:18:41 +03:00
John Preston
cef50e5f52 Export file thumbs, use in video messages. 2018-07-10 12:18:41 +03:00
John Preston
cb8ff398a5 Improved html message layout. 2018-07-10 12:18:41 +03:00
John Preston
eeb1a6b769 Add service messages HTML layout. 2018-07-10 12:18:41 +03:00
John Preston
66822f7333 Add some HTML design to export, except messages.
NB Testing the layout, the app is not in a working condition.
2018-07-10 12:18:41 +03:00
John Preston
e466dc9fc7 Fix default build.
Regression was introduced in a8d35b67aa.
2018-07-10 12:14:53 +03:00
Sven-Hendrik Haase
947204bb9d Add missing include to <gsl/gsl> (#4886) 2018-07-03 20:23:14 +03:00
Sven-Hendrik Haase
f37f097dec Add include to <memory> (#4887) 2018-07-03 20:22:52 +03:00
Marco Trevisan
a8d35b67aa lib_export: use includes paths as defined per platform (#4935) 2018-07-03 12:56:51 +03:00
John Preston
4e0d94f347 Version 1.3.9: Fix build for Xcode. 2018-06-28 20:26:31 +01:00
John Preston
c7e773dd9a Version 1.3.9.
- Mark chats in the chat list as Read or Unread.
- Improved censorship circumvention.
2018-06-28 20:12:07 +01:00
John Preston
e64d102efd Better display of first_name + last_name. 2018-06-28 20:01:26 +01:00
John Preston
49ea9434f2 Better nested key-value html serialization. 2018-06-28 18:52:57 +01:00
John Preston
e21c354428 Improve suggest export logic. 2018-06-28 18:44:07 +01:00
John Preston
d0614efd65 Prevent displaying two export suggest boxes. 2018-06-28 18:29:52 +01:00
John Preston
b0baf75fdd Fix forwarded names in saved messages export. 2018-06-28 18:25:23 +01:00
John Preston
efb3e92525 Show "Saved messages" chat name in export UI. 2018-06-28 18:12:13 +01:00
John Preston
5cdc563c9e Add saving of shared contacts vcards in export. 2018-06-28 18:03:44 +01:00
John Preston
a43dfc567c Allow injecting fail handlers in export.
Handle CHANNEL_PRIVATE while exporting all channel messages.
2018-06-28 17:25:50 +01:00
John Preston
ea6e4c6006 Display correct info in pinned message. 2018-06-28 16:28:45 +01:00
John Preston
98930792c3 Fix fast reply and right action in sent messages.
Fixes #4903.
2018-06-28 16:24:39 +01:00
John Preston
165d1aacae Fix tilde formatting in InputField.
Regression was introduced somewhen while uniting input field classes.

Fixes #4829.
2018-06-28 16:07:53 +01:00
John Preston
831f1b6aee Fix crash in file inline bot results.
Fixes #4904.
2018-06-28 16:01:32 +01:00
John Preston
2f5fb3688a Fix crash for invalid inline bot stickers. 2018-06-28 15:15:47 +01:00
John Preston
d8897a0cc8 Make export done button adaptive to text. 2018-06-28 04:39:23 +01:00
John Preston
3b956c598b Fix data export window theme changing.
Fixes #4902.
2018-06-28 04:39:10 +01:00
John Preston
1ee71bbd5c Update GSL to v1.0.0 2018-06-27 22:58:33 +01:00
John Preston
b7ab4fd086 Improve triple-backtick replacement. 2018-06-27 22:58:33 +01:00
John Preston
44c6050bf2 Fix field autocomplete in empty chat. 2018-06-27 22:58:33 +01:00
John Preston
35c759c6bc Mark [un]read from chats list. 2018-06-27 22:58:32 +01:00
John Preston
372cf275e0 Skip draft updates while sending with clear_draft.
I hope fixes #4845, fixes #4852, fixes #4861.
2018-06-27 22:58:32 +01:00
John Preston
33095966af Move sendMessage and sendInlineResult to ApiWrap. 2018-06-27 22:58:32 +01:00
John Preston
ff53404d5b Update API scheme to layer 82. 2018-06-27 22:58:32 +01:00
John Preston
941288b58e Handle new paddings in improved TCP protocol. 2018-06-27 22:58:31 +01:00
John Preston
22441ef80c Handle improved protocol secrets. 2018-06-25 20:22:03 +01:00
John Preston
8c2f11de7d Send correct paddings in improved TCP protocol. 2018-06-25 19:55:52 +01:00
John Preston
c7a4d67cfb Version 1.3.8.
- Testing new data export.
- Bug fixes and other minor improvements.
2018-06-24 16:17:46 +01:00
John Preston
688275ea81 Fix update request timeout. 2018-06-24 16:17:46 +01:00
John Preston
266102df2f Some phrases fixed, some logs added. 2018-06-24 16:17:46 +01:00
John Preston
f7aadc352b Handle LOCATION_INVALID error. 2018-06-24 15:44:53 +01:00
John Preston
1ae3af0e80 Split messages.html by 1000 messages. 2018-06-24 15:44:53 +01:00
John Preston
97d27fe869 Closed beta 1.3.7.4. 2018-06-24 15:44:53 +01:00
John Preston
fcd2e28abb Add some logs. 2018-06-24 15:44:53 +01:00
John Preston
2522e66969 Move export descriptions to lang. 2018-06-24 15:44:53 +01:00
John Preston
b9250edb33 Some more export data improvements. 2018-06-24 15:44:53 +01:00
John Preston
54cab2c5a5 Add other additional data export. 2018-06-24 15:44:53 +01:00
John Preston
6231db1411 Closed beta 1.3.7.3. 2018-06-24 15:44:53 +01:00
John Preston
ef5a395c60 Improve export folder structure. 2018-06-24 15:44:53 +01:00
John Preston
a200771868 Don't suggest export if one is running. 2018-06-24 15:44:53 +01:00
John Preston
914e043abe Improve export phrases. 2018-06-24 15:44:53 +01:00
John Preston
9d66f9cc03 Add basic HTML export. 2018-06-24 15:44:53 +01:00
John Preston
e708065446 Closed beta 1.3.7.2: Fix build for Windows. 2018-06-23 01:02:20 +01:00
John Preston
9c64cdb9c4 Closed beta 1.3.7.2. 2018-06-23 00:57:12 +01:00
John Preston
9f8d61ab2f Add information about saved data. 2018-06-23 00:56:53 +01:00
John Preston
0143fd28af Suggest start export when time comes. 2018-06-23 00:56:53 +01:00
John Preston
844d030332 Save export settings to local storage. 2018-06-23 00:56:53 +01:00
John Preston
ae18ece549 Ask export path with other export options. 2018-06-23 00:56:53 +01:00
John Preston
10a0c6a086 Update phrases. 2018-06-23 00:56:53 +01:00
John Preston
51189fd244 Fix empty chats assertion violation. 2018-06-23 00:56:53 +01:00
John Preston
1e10529f20 Fix Linux build. Use -flto for static libraries.
Some unbelievable crashes happen in MTP codegen-ed serialization
if the binary is using -flto with MTP in non-flto static library.

To build and link static libraries with -flto additional GYP patch
is required, so that ar/ranlib/nm use gcc- wrappers.
2018-06-23 00:28:44 +01:00
John Preston
8d701ebb4f Fix rpl::variable assignment. 2018-06-22 17:45:05 +01:00
John Preston
269bb94138 Closed beta 1.3.7.1: Fix build with GCC. 2018-06-22 01:44:28 +01:00
John Preston
9b98ff52ea Closed beta 1.3.7.1: Fix build for Xcode. 2018-06-22 01:25:54 +01:00
John Preston
52f2f96f36 Closed beta 1.3.7.1: Fix Release build. 2018-06-22 01:01:45 +01:00
John Preston
b53e40f1bf Closed beta 1.3.7.1. 2018-06-22 00:48:32 +01:00
John Preston
4e0d11f517 Add export format selection (text / json). 2018-06-22 00:48:18 +01:00
John Preston
1a24ba857c Parse message entities, export in JSON. 2018-06-22 00:48:18 +01:00
John Preston
1e254b958e Update crl submodule. 2018-06-22 00:48:18 +01:00
John Preston
23140b3d6a Fix build for old OS X. 2018-06-21 23:35:28 +01:00
John Preston
8c901d8f71 Fix build for Xcode. 2018-06-21 22:25:14 +01:00
John Preston
856356ce75 Add web authorizations export. 2018-06-21 22:15:27 +01:00
John Preston
b5a65a4519 Add export to JSON. 2018-06-21 21:42:50 +01:00
John Preston
d056c00c67 Use split ranges to export all messages. 2018-06-21 19:58:54 +01:00
John Preston
36fb6dac89 Call finish takeout. Handle errors. 2018-06-21 14:50:56 +01:00
John Preston
fcda883878 Show messages count in an exported chat. 2018-06-20 22:22:10 +01:00
John Preston
40c0286942 Export userpics in a separate file. 2018-06-20 21:53:31 +01:00
John Preston
59df447fed Request frequent contacts calls category. 2018-06-20 21:39:04 +01:00
John Preston
a253d34c00 Name files by index, not by media date. 2018-06-20 21:32:52 +01:00
John Preston
0a5eac50be Unite Dialogs and LeftChannels in Export. 2018-06-20 19:21:36 +01:00
John Preston
156c3d288c Allow selecting export folder. 2018-06-20 19:12:47 +01:00
John Preston
154e5660de Confirm export stop on quit and logout. 2018-06-20 18:30:57 +01:00
John Preston
13e6b91ac7 Remove old done widget in Export. 2018-06-20 17:45:52 +01:00
John Preston
a89ad5d0fb Add export my data button in Settings. 2018-06-20 17:41:59 +01:00
John Preston
e11c27048b Add export statistics for the final screen. 2018-06-20 17:10:38 +01:00
John Preston
e8dd277a00 Improve export progress / finished design. 2018-06-20 16:59:27 +01:00
John Preston
329db0d8e9 Export panel minimizes to a top bar, like a Call. 2018-06-20 01:02:36 +01:00
John Preston
eaf3ea9289 Fix dialogs list in export. 2018-06-20 01:01:41 +01:00
John Preston
4156beaa3c Export top peers as frequent contacts. 2018-06-19 21:40:16 +01:00
John Preston
4115d3d13d Display export progress. 2018-06-19 19:31:30 +01:00
John Preston
5f01751660 Display errors in export UI.
All errors are now fatal errors :(
2018-06-19 13:35:21 +01:00
John Preston
7d4e23448e Better steps division in export. 2018-06-18 22:52:13 +01:00
John Preston
c7aa5ed544 _DEBUG-test ConcurrentSender generic handlers. 2018-06-17 21:29:50 +01:00
John Preston
1bfe409c93 Export my messages from left channels. 2018-06-17 21:15:40 +01:00
John Preston
e8d619c740 Some export bugs fixed. 2018-06-17 18:18:34 +01:00
John Preston
2dc3ec955a Add downloaded files cache in export.
Also write downloaded photo paths.
2018-06-17 13:47:47 +01:00
John Preston
07ff7c6cb0 Request only my messages by settings bits. 2018-06-17 13:47:07 +01:00
John Preston
8d52ca6be6 Apply file type/size restrictions in export. 2018-06-17 09:54:38 +01:00
John Preston
df91b2bfeb Export settings layout ready. 2018-06-16 20:48:38 +01:00
John Preston
9d02e539c8 Update scheme for special export methods.
Export all saved contacts.
2018-06-16 20:48:38 +01:00
John Preston
241fee80a7 Export full messages information.
Also add some more .match() calls to MTP codegen-ed classes.
2018-06-14 21:34:53 +03:00
John Preston
83786ddeaf Export chat messages photos and documents.
Also rename .visit() with .match() in MTP types.
Also add base::match_method() and base::match() for base::variant.
Also add base::match() and .match() for base::optional_variant.
2018-06-14 01:09:48 +03:00
John Preston
0e9793b845 Move MimeType from utils to core/mime_type.
Also move to Core namespace.
2018-06-14 01:08:47 +03:00
John Preston
2b36dd660b Export chat messages text. 2018-06-13 16:12:36 +03:00
John Preston
35ffc03988 Use .visit() in export data parsing. 2018-06-12 22:59:58 +03:00
John Preston
5a9d1a3fce Add .visit(many, callbacks) method to MTP types. 2018-06-12 22:59:58 +03:00
John Preston
6776d88688 Add chats list export. 2018-06-12 21:09:21 +03:00
John Preston
affe9defb5 Fix authorization import in FILE_MIGRATE case.
Regression was introduced in dd933cf61c.
2018-06-12 16:30:00 +03:00
John Preston
d3fdf433cd Export sessions list. 2018-06-12 01:02:05 +03:00
John Preston
cec8114b99 Add simple files and contacts export.
Also move all API calls in export to Export::ApiWrap.
2018-06-12 01:02:05 +03:00
John Preston
0a1a5ed70e Use abstract export writer for different formats. 2018-06-12 01:02:05 +03:00
John Preston
c587c011d2 Start data export in lib_export. 2018-06-12 01:02:04 +03:00
John Preston
c2fa149ffd Replace InvokeQueued with on_main for has_weak_ptr. 2018-06-12 01:02:04 +03:00
John Preston
c63c75018d Update crl submodule. 2018-06-12 01:02:04 +03:00
John Preston
b0077d98f0 Version 1.3.7: Fix file dialog parent widget.
Regression was introduced in 67ea175fc6.

Fixes #4817.
2018-06-11 23:40:30 +03:00
John Preston
b5bc7a22af Version 1.3.7: Possible bug fix.
Attempt to fix strange crash in SPMediaKeyTap.
2018-06-11 22:31:44 +03:00
John Preston
e60311811b Version 1.3.7.
- Push fixes to stable version.
2018-06-11 22:28:34 +03:00
John Preston
8700c1b08f Alpha version 1.3.6: Make it another alpha. 2018-06-11 10:42:20 +03:00
John Preston
d8b51670e7 Version 1.3.6.
- Bug fixes and other minor improvements.
2018-06-11 10:39:59 +03:00
John Preston
68c2f563c6 Write logs without QTextStream. 2018-06-11 10:37:29 +03:00
John Preston
bf775cb4ca Fix history items cleanup. 2018-06-09 11:52:37 +03:00
John Preston
5c4b81434e Alpha version 1.3.5.
- Bug fixes and other minor improvements.
2018-06-08 23:12:00 +03:00
John Preston
cd1c7c56d3 Skip old and currently-sending draft updates. 2018-06-08 23:06:26 +03:00
John Preston
427ceb9a9a Submit MuteSettingsBox by Enter. 2018-06-08 22:26:23 +03:00
John Preston
2a110f0d3e Improve passport styles. 2018-06-08 22:26:08 +03:00
John Preston
d0ed75f3b5 Update langs. 2018-06-08 21:32:20 +03:00
John Preston
be2abd594f Alpha version 1.3.4.
- Bug fixes and other minor improvements.
2018-06-07 22:29:27 +03:00
John Preston
75a40b83ae Notify settings unknown => draw chats as muted.
Also request common notify settings at the app launch.
2018-06-07 22:28:09 +03:00
John Preston
472a677bca Fix crash in special scan upload. 2018-06-07 22:11:55 +03:00
John Preston
dca6e10beb Fix markdown apply to text with emoji. 2018-06-07 22:00:46 +03:00
John Preston
122ab94f3d Fix text color glitch after palette update.
Once again fixes #4774.
2018-06-07 21:25:10 +03:00
John Preston
2ab40de8b9 Alpha version 1.3.3.
- Bug fixes and other minor improvements.
2018-06-07 10:50:34 +03:00
John Preston
35659536c5 Fix first passcode unlock.
Fixes #4811.
2018-06-07 10:44:38 +03:00
298 changed files with 19316 additions and 3020 deletions

View File

@@ -56,10 +56,6 @@ GOTO:EOF
call:logInfo "Build version: %BUILD_VERSION%"
set TDESKTOP_BUILD_DEFINES=
echo %BUILD_VERSION% | findstr /C:"disable_autoupdate">nul && (
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_AUTOUPDATE
)
echo %BUILD_VERSION% | findstr /C:"disable_register_custom_scheme">nul && (
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME
)

View File

@@ -10,7 +10,6 @@ cache:
env:
matrix:
- BUILD_VERSION=""
- BUILD_VERSION="disable_autoupdate"
- BUILD_VERSION="disable_register_custom_scheme"
- BUILD_VERSION="disable_crash_reports"
- BUILD_VERSION="disable_network_proxy"

View File

@@ -100,10 +100,6 @@ build() {
fi
# Configure the build
if [[ $BUILD_VERSION == *"disable_autoupdate"* ]]; then
GYP_DEFINES+=",TDESKTOP_DISABLE_AUTOUPDATE"
fi
if [[ $BUILD_VERSION == *"disable_register_custom_scheme"* ]]; then
GYP_DEFINES+=",TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME"
fi

View File

@@ -1,5 +1,5 @@
diff --git a/pylib/gyp/generator/cmake.py b/pylib/gyp/generator/cmake.py
index a2b9629..68d7020 100644
index a2b9629..ac59461 100644
--- a/pylib/gyp/generator/cmake.py
+++ b/pylib/gyp/generator/cmake.py
@@ -1070,6 +1070,23 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
@@ -26,6 +26,43 @@ index a2b9629..68d7020 100644
UnsetVariable(output, 'TOOLSET')
UnsetVariable(output, 'TARGET')
@@ -1112,6 +1129,8 @@ def GenerateOutputForConfig(target_list, target_dicts, data,
SetVariable(output, 'configuration', config_to_use)
ar = None
+ ranlib = None
+ nm = None
cc = None
cxx = None
@@ -1121,17 +1140,27 @@ def GenerateOutputForConfig(target_list, target_dicts, data,
for key, value in make_global_settings:
if key == 'AR':
ar = os.path.join(build_to_top, value)
+ if key == 'RANLIB':
+ ranlib = os.path.join(build_to_top, value)
+ if key == 'NM':
+ nm = os.path.join(build_to_top, value)
if key == 'CC':
cc = os.path.join(build_to_top, value)
if key == 'CXX':
cxx = os.path.join(build_to_top, value)
ar = gyp.common.GetEnvironFallback(['AR_target', 'AR'], ar)
+ ranlib = gyp.common.GetEnvironFallback(['RANLIB_target', 'RANLIB'], ranlib)
+ nm = gyp.common.GetEnvironFallback(['NM_target', 'NM'], nm)
cc = gyp.common.GetEnvironFallback(['CC_target', 'CC'], cc)
cxx = gyp.common.GetEnvironFallback(['CXX_target', 'CXX'], cxx)
if ar:
SetVariable(output, 'CMAKE_AR', ar)
+ if ranlib:
+ SetVariable(output, 'CMAKE_RANLIB', ranlib)
+ if nm:
+ SetVariable(output, 'CMAKE_NM', nm)
if cc:
SetVariable(output, 'CMAKE_C_COMPILER', cc)
if cxx:
diff --git a/pylib/gyp/generator/xcode.py b/pylib/gyp/generator/xcode.py
index db99d6a..8d56baf 100644
--- a/pylib/gyp/generator/xcode.py

View File

@@ -0,0 +1,502 @@
body {
margin: 0;
font: 12px/18px 'Open Sans',"Lucida Grande","Lucida Sans Unicode",Arial,Helvetica,Verdana,sans-serif;
}
strong {
font-weight: 700;
}
code, kbd, pre, samp {
font-family: Menlo,Monaco,Consolas,"Courier New",monospace;
}
code {
padding: 2px 4px;
font-size: 90%;
color: #c7254e;
background-color: #f9f2f4;
border-radius: 4px;
}
pre {
display: block;
margin: 0;
line-height: 1.42857143;
word-break: break-all;
word-wrap: break-word;
color: #333;
background-color: #f5f5f5;
border-radius: 4px;
overflow: auto;
padding: 3px;
border: 1px solid #eee;
max-height: none;
font-size: inherit;
}
.clearfix:after {
content: " ";
visibility: hidden;
display: block;
height: 0;
clear: both;
}
.pull_left {
float: left;
}
.pull_right {
float: right;
}
.page_wrap {
background-color: #ffffff;
color: #000000;
}
.page_wrap a {
color: #168acd;
text-decoration: none;
}
.page_wrap a:hover {
text-decoration: underline;
}
.page_header {
position: fixed;
z-index: 10;
background-color: #ffffff;
width: 100%;
border-bottom: 1px solid #e3e6e8;
}
.page_header .content {
width: 480px;
margin: 0 auto;
border-radius: 0 !important;
}
.page_header a.content {
background-repeat: no-repeat;
background-position: 24px 21px;
background-size: 24px 24px;
}
.bold {
color: #212121;
font-weight: 700;
}
.details {
color: #70777b;
}
.page_header .content .text {
padding: 24px 24px 22px 24px;
font-size: 22px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.page_header a.content .text {
padding: 24px 24px 22px 82px;
}
.page_body {
padding-top: 64px;
width: 480px;
margin: 0 auto;
}
.page_about {
padding: 24px 24px;
}
.with_divider {
border-top: 1px solid #e3e6e8;
}
.userpic_link {
display: block;
text-decoration: none;
}
.userpic_link:hover {
text-decoration: none;
}
.userpic {
display: block;
border-radius: 50%;
overflow: hidden;
}
.userpic .initials {
display: block;
color: #fff;
text-align: center;
text-transform: uppercase;
user-select: none;
}
.color_red,
.userpic1,
.media_call .fill,
.media_file .fill,
.media_live_location .fill {
background-color: #ff5555;
}
.color_green,
.userpic2,
.media_call.success .fill,
.media_photo .fill {
background-color: #64bf47;
}
.color_yellow,
.userpic3,
.media_venue .fill {
background-color: #ffab00;
}
.color_blue,
.userpic4,
.media_audio_file .fill,
.media_voice_message .fill {
background-color: #4f9cd9;
}
.color_purple,
.userpic5,
.media_game .fill {
background-color: #9884e8;
}
.color_pink,
.userpic6,
.media_invoice .fill {
background-color: #e671a5;
}
.color_sea,
.userpic7,
.media_location .fill,
.media_video .fill {
background-color: #47bcd1;
}
.color_orange,
.userpic8,
.media_contact .fill {
background-color: #ff8c44;
}
.personal_info {
padding: 24px;
}
.personal_info .userpic .initials {
font-size: 30px;
}
.personal_info .rows {
float: left;
padding-right: 24px;
}
.personal_info .names {
width: 164px;
}
.personal_info .info {
width: 124px;
}
.personal_info .bio {
width: 400px;
}
.personal_info .row {
padding-bottom: 16px;
}
a.block_link {
display: block;
text-decoration: none !important;
border-radius: 4px;
}
a.block_link:hover {
text-decoration: none !important;
background-color: #f5f7f8;
}
.sections {
padding: 11px 0;
}
.section {
height: 48px;
background-position: 24px 12px;
background-repeat: no-repeat;
background-size: 24px 24px;
}
.section .counter {
float: right;
padding: 14px 24px 0;
font-size: 15px;
}
.section .label {
padding: 15px 0 0 82px;
font-size: 15px;
}
.list_page .page_about {
padding: 16px 24px 0;
font-size: 11px;
}
.list_page .entry_list {
padding: 16px 0;
}
.list_page .entry {
padding: 10px 16px;
}
.list_page .entry .userpic .initials {
font-size: 18px;
}
.list_page .entry .body {
margin-left: 66px;
}
.list_page .entry .name {
padding: 4px 0 2px;
font-size: 14px;
}
.list_page .entry .subname {
padding-top: 4px;
}
.list_page .entry .details_entry {
padding-top: 4px;
}
.list_page .entry .info {
font-size: 11px;
padding-top: 5px;
}
.history {
padding: 16px 0;
}
.service {
padding: 10px 24px;
}
.service .body {
text-align: center;
}
.service .userpic_wrap {
padding-top: 10px;
}
.service .userpic {
margin: 0 auto;
}
.service .userpic .initials {
font-size: 24px;
}
.message .userpic .initials {
font-size: 16px;
}
.default {
padding: 10px 0 10px;
}
.default.joined {
padding-top: 0;
}
.default .from_name {
color: #3892db;
font-weight: 700;
padding-bottom: 5px;
}
.default .from_name .details {
font-weight: normal;
}
.default .body {
margin-left: 60px;
}
.default .text {
word-wrap: break-word;
line-height: 150%;
}
.default .reply_to,
.default .media_wrap {
padding-bottom: 5px;
}
.default .media {
margin: 0 -10px;
padding: 5px 10px;
}
.default .media .fill,
.default .media .thumb {
width: 48px;
height: 48px;
border-radius: 50%;
}
.default .media .fill {
background-repeat: no-repeat;
background-position: 12px 12px;
background-size: 24px 24px;
}
.default .media .title {
padding-top: 4px;
font-size: 14px;
}
.default .media .description {
color: #000000;
padding-top: 4px;
font-size: 13px;
}
.default .media .status {
padding-top: 4px;
font-size: 13px;
}
.default .video_file_wrap,
.default .animated_wrap {
position: relative;
}
.default .video_file,
.default .animated,
.default .photo,
.default .sticker {
display: block;
}
.video_duration {
background: rgba(0, 0, 0, .4);
padding: 0px 5px;
position: absolute;
z-index: 2;
border-radius: 2px;
right: 3px;
bottom: 3px;
color: #ffffff;
font-size: 11px;
}
.video_play_bg {
background: rgba(0, 0, 0, .4);
width: 40px;
height: 40px;
line-height: 0;
position: absolute;
z-index: 2;
border-radius: 50%;
overflow: hidden;
margin: -20px auto 0 -20px;
top: 50%;
left: 50%;
pointer-events: none;
}
.video_play {
position: absolute;
display: inline-block;
top: 50%;
left: 50%;
margin-left: -5px;
margin-top: -9px;
z-index: 1;
width: 0;
height: 0;
border-style: solid;
border-width: 9px 0 9px 14px;
border-color: transparent transparent transparent #fff;
}
.gif_play {
font-weight: 700;
color: #FFF;
display: block;
line-height: 40px;
font-size: 13px;
text-align: center;
}
.pagination {
text-align: center;
padding: 20px;
font-size: 16px;
}
.section.calls {
background-image: url(../images/section_calls.png);
}
.section.chats {
background-image: url(../images/section_chats.png);
}
.section.contacts {
background-image: url(../images/section_contacts.png);
}
.section.frequent {
background-image: url(../images/section_frequent.png);
}
.section.photos {
background-image: url(../images/section_photos.png);
}
.section.sessions {
background-image: url(../images/section_sessions.png);
}
.section.web {
background-image: url(../images/section_web.png);
}
.section.other {
background-image: url(../images/section_other.png)
}
.page_header a.content {
background-image: url(../images/back.png);
}
.media_call .fill {
background-image: url(../images/media_call.png)
}
.media_contact .fill {
background-image: url(../images/media_contact.png)
}
.media_file .fill {
background-image: url(../images/media_file.png)
}
.media_game .fill {
background-image: url(../images/media_game.png)
}
.media_live_location .fill,
.media_location .fill,
.media_venue .fill {
background-image: url(../images/media_location.png)
}
.media_audio_file .fill {
background-image: url(../images/media_music.png)
}
.media_invoice .fill {
background-image: url(../images/media_shop.png)
}
.media_voice_message .fill {
background-image: url(../images/media_voice.png)
}
.media_photo .fill {
background-image: url(../images/media_photo.png)
}
.media_video .fill {
background-image: url(../images/media_video.png)
}
@media only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2/1), only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-device-pixel-ratio: 2) {
.section.calls {
background-image: url(../images/section_calls@2x.png);
}
.section.chats {
background-image: url(../images/section_chats@2x.png);
}
.section.contacts {
background-image: url(../images/section_contacts@2x.png);
}
.section.frequent {
background-image: url(../images/section_frequent@2x.png);
}
.section.photos {
background-image: url(../images/section_photos@2x.png);
}
.section.sessions {
background-image: url(../images/section_sessions@2x.png);
}
.section.web {
background-image: url(../images/section_web@2x.png);
}
.section.other {
background-image: url(../images/section_other@2x.png);
}
.page_header a.content {
background-image: url(../images/back@2x.png);
}
.media_call .fill {
background-image: url(../images/media_call@2x.png)
}
.media_contact .fill {
background-image: url(../images/media_contact@2x.png)
}
.media_file .fill {
background-image: url(../images/media_file@2x.png)
}
.media_game .fill {
background-image: url(../images/media_game@2x.png)
}
.media_live_location .fill,
.media_location .fill,
.media_venue .fill {
background-image: url(../images/media_location@2x.png)
}
.media_audio_file .fill {
background-image: url(../images/media_music@2x.png)
}
.media_invoice .fill {
background-image: url(../images/media_shop@2x.png)
}
.media_voice_message .fill {
background-image: url(../images/media_voice@2x.png)
}
.media_photo .fill {
background-image: url(../images/media_photo@2x.png)
}
.media_video .fill {
background-image: url(../images/media_video@2x.png)
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 815 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 510 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 480 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 991 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 458 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 790 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1023 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 771 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 619 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 750 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 B

View File

@@ -469,6 +469,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_settings_calls_privacy" = "Phone calls privacy";
"lng_settings_groups_invite_privacy" = "Group invite settings";
"lng_settings_show_sessions" = "Show all sessions";
"lng_settings_export_data" = "Export Telegram data";
"lng_settings_self_destruct" = "Account self-destruct settings";
"lng_settings_change_phone" = "Change phone number";
@@ -1105,6 +1106,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_context_view_feed_info" = "View feed info";
"lng_context_pin_to_top" = "Pin to top";
"lng_context_unpin_from_top" = "Unpin from top";
"lng_context_mark_unread" = "Mark as unread";
"lng_context_mark_read" = "Mark as read";
"lng_context_promote_admin" = "Promote to admin";
"lng_context_edit_permissions" = "Edit permissions";
@@ -1558,6 +1561,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_passport_identity_internal" = "Internal passport";
"lng_passport_identity_internal_upload" = "Upload a scan of your internal passport";
"lng_passport_identity_about" = "The document must contain your photograph, first and last name, date of birth, document number, country of issue, and expiry date.";
"lng_passport_identity_selfie" = "Take a selfie with your document";
"lng_passport_address_title" = "Residential address";
"lng_passport_address_description" = "Upload a proof of your address";
"lng_passport_address_bill" = "Utility bill";
@@ -1567,7 +1571,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_passport_address_agreement" = "Tenancy agreement";
"lng_passport_address_agreement_upload" = "Upload a scan of your tenancy agreement";
"lng_passport_address_registration" = "Passport registration";
"lng_passport_address_registration_upload" = "Upload a scan of your passport registration";
"lng_passport_address_registration_upload" = "Upload a scan of your passport registration page";
"lng_passport_address_temporary" = "Temporary registration";
"lng_passport_address_temporary_upload" = "Upload a scan of your temporary registration";
"lng_passport_address_about" = "To confirm your address, please upload a scan or photo of the selected document (all pages).";
@@ -1592,14 +1596,22 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_passport_selfie_name" = "Photo";
"lng_passport_selfie_description" = "Upload a photo of yourself holding your document. Make sure the ID and your face are clearly visible.";
"lng_passport_upload_selfie" = "Upload selfie";
"lng_passport_reupload_selfie" = "Reupload selfie";
"lng_passport_front_side_title" = "Front side";
"lng_passport_front_side_name" = "Scan";
"lng_passport_front_side_description" = "Upload front side of your document.";
"lng_passport_upload_front_side" = "Upload front side scan";
"lng_passport_front_side_description" = "Upload the front side of your document.";
"lng_passport_upload_front_side" = "Upload a scan of the front side";
"lng_passport_reupload_front_side" = "Reupload a scan of the front side";
"lng_passport_reverse_side_title" = "Reverse side";
"lng_passport_reverse_side_name" = "Scan";
"lng_passport_reverse_side_description" = "Upload reverse side of your document.";
"lng_passport_upload_reverse_side" = "Upload reverse side scan";
"lng_passport_reverse_side_description" = "Upload the reverse side of your document.";
"lng_passport_upload_reverse_side" = "Upload a scan of the reverse side";
"lng_passport_reupload_reverse_side" = "Reupload a scan of the reverse side";
"lng_passport_main_page_title" = "Main page";
"lng_passport_main_page_name" = "Scan";
"lng_passport_main_page_description" = "Upload the main page of your document.";
"lng_passport_upload_main_page" = "Upload a scan of the main page";
"lng_passport_reupload_main_page" = "Reupload a scan of the main page";
"lng_passport_personal_details" = "Personal details";
"lng_passport_personal_details_enter" = "Enter your personal details";
"lng_passport_choose_image" = "Choose scan image";
@@ -1614,7 +1626,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_passport_country" = "Country";
"lng_passport_residence_country" = "Residence";
"lng_passport_country_choose" = "Choose country";
"lng_passport_document_number" = "Card Number";
"lng_passport_document_number" = "Document Number";
"lng_passport_expiry_date" = "Expiry date";
"lng_passport_address" = "Address";
"lng_passport_address_enter" = "Enter your address";
@@ -1643,15 +1655,87 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_passport_delete_email_sure" = "Are you sure you want to delete your email address?";
"lng_passport_delete_phone" = "Delete phone number";
"lng_passport_delete_phone_sure" = "Are you sure you want to delete your phone number?";
"lng_passport_success" = "Authorization successfull!";
"lng_passport_success" = "Authorization successful!";
"lng_passport_stop_sure" = "Are you sure you want to stop this authorization?";
"lng_passport_stop" = "Stop";
"lng_passport_restart_sure" = "An unexpected error has occurred. Perhaps some changes were made from a different Telegram application. Would you like to restart this authorization?";
"lng_passport_restart" = "Restart";
"lng_passport_error_too_large" = "This file is too large.";
"lng_passport_error_bad_size" = "This image has bad dimensions.";
"lng_passport_error_too_large" = "Sorry, this file is too large.";
"lng_passport_error_bad_size" = "Sorry, this image has wrong dimensions.";
"lng_passport_error_cant_read" = "Can't read this file. Please choose an image.";
"lng_passport_bad_name" = "Use latin characters only.";
"lng_passport_bad_name" = "Please use latin characters only.";
"lng_passport_wait_upload" = "Please wait while upload is finished.";
"lng_passport_fix_errors" = "Please correct errors.";
"lng_passport_app_out_of_date" = "Sorry, your Telegram app is out of date and can't handle this request. Please update Telegram.";
"lng_export_title" = "Export Personal Data";
"lng_export_progress_title" = "Exporting personal data";
"lng_export_option_info" = "Account information";
"lng_export_option_info_about" = "Your chosen screen name, username, phone number and profile pictures.";
"lng_export_option_contacts" = "Contacts list";
"lng_export_option_contacts_about" = "If you allow access, contacts are continuously synced with Telegram. You can adjust this in Settings > Privacy & Security on mobile devices.";
"lng_export_option_sessions" = "Active sessions";
"lng_export_option_sessions_about" = "We store this to display your connected devices in Settings > Privacy & Security > Active Sessions.";
"lng_export_header_other" = "Other";
"lng_export_option_other" = "Miscellaneous data";
"lng_export_option_other_about" = "Other types of data not mentioned above (beta).";
"lng_export_header_chats" = "Chat export settings";
"lng_export_option_personal_chats" = "Personal chats";
"lng_export_option_bot_chats" = "Bot chats";
"lng_export_option_private_groups" = "Private groups";
"lng_export_option_private_channels" = "Private channels";
"lng_export_option_public_groups" = "Public groups";
"lng_export_option_public_channels" = "Public channels";
"lng_export_option_only_my" = "Only my messages";
"lng_export_header_media" = "Media export settings";
"lng_export_option_photos" = "Photos";
"lng_export_option_video_files" = "Video files";
"lng_export_option_voice_messages" = "Voice messages";
"lng_export_option_video_messages" = "Round video messages";
"lng_export_option_stickers" = "Stickers";
"lng_export_option_gifs" = "Animated GIFs";
"lng_export_option_files" = "Files";
"lng_export_option_size_limit" = "Size limit: {size}";
"lng_export_header_format" = "Location and format";
"lng_export_option_location" = "Download path: {path}";
"lng_export_option_html" = "Human-readable HTML";
"lng_export_option_json" = "Machine-readable JSON";
"lng_export_start" = "Export";
"lng_export_state_initializing" = "Initializing...";
"lng_export_state_userpics" = "Profile pictures";
"lng_export_state_chats_list" = "Processing chats...";
"lng_export_state_chats" = "Chats";
"lng_export_state_progress" = "{count} / {total}";
"lng_export_state_photo" = "Photo";
"lng_export_state_video_file" = "Video file";
"lng_export_state_voice_message" = "Voice message";
"lng_export_state_video_message" = "Round video message";
"lng_export_state_sticker" = "Sticker";
"lng_export_state_gif" = "Animated GIF";
"lng_export_progress" = "You can close this window now. Please don't quit Telegram until the data export is completed.";
"lng_export_stop" = "Stop";
"lng_export_sure_stop" = "Are you sure you want to stop exporting your data?\n\nIf you do, you'll need to start over.";
"lng_export_about_done" = "Your data was successfully exported.";
"lng_export_done" = "Show my data";
"lng_export_finished" = "Data export completed.";
"lng_export_total_files" = "Total files: {count}.";
"lng_export_total_size" = "Total size: {size}.";
"lng_export_folder" = "Choose export folder";
"lng_export_invalid" = "Sorry, you have started a new data export, so this data export is now cancelled.";
"lng_export_delay" = "Sorry, for security reasons, you will be able to begin downloading your data in {hours}. We have notified all your devices about the export request to make sure it's authorized and to give you time to react if it's not.\n\nPlease come back on {date} and repeat the request using the same device.";
"lng_export_delay_less_than_hour" = "less than an hour";
"lng_export_delay_hours#one" = "{count} hour";
"lng_export_delay_hours#other" = "{count} hours";
"lng_export_suggest_title" = "Data export ready";
"lng_export_suggest_text" = "You can now download the data you requested. Start exporting data?";
"lng_export_suggest_cancel" = "Not now";
"lng_export_about_telegram" = "Here is all the data you requested. Remember: we dont use your data for ad targeting, we dont sell it to others, and were not part of any “family of companies.”\n\nTelegram only keeps the information it needs to function as a feature-rich cloud service for example, your cloud chats so that you can access them from any devices without using third-party backups, or your contacts so that you can rely on your existing social graph when messaging people on Telegram.\n\nCheck out Settings > Privacy & Security on Telegram's mobile apps for relevant settings.";
"lng_export_about_contacts" = "If you allow access, your contacts are continuously synced with Telegram. Thanks to this, you can easily switch to Telegram without losing your existing social graph and connect with friends across all your devices. We use data about your contacts to let you know when they join Telegram. We also use it to make sure that you see the names you have in your phone book instead of the screen names people choose for themselves.\n\nYou can disable contact syncing or delete your stored contacts in Settings > Privacy & Security on Telegram's mobile apps.";
"lng_export_about_frequent" = "This rating shows which people you are likelier to message frequently. Telegram uses this data to populate the 'People' box at the top of the Search section. This rating is also calculated for inline bots so that the app can suggest the bots you are most likely to use in the attachment menu (or when you start a new message with \"@\").\n\nTo delete this data, go to Settings > Privacy & Security and disable 'Suggest Frequent Contacts' (requires Telegram for iOS v.4.8.3 or Telegram for Android v.4.8.10 or higher).";
"lng_export_about_sessions" = "We store session info to display your connected devices in Settings > Privacy & Security > Active Sessions.";
"lng_export_about_web_sessions" = "We store this to display the websites where you logged in using authentication via Telegram. This information is shown in Settings > Privacy & Security > Active Sessions.";
"lng_export_about_chats" = "This page lists all chats from this export and where to look for their data.";
"lng_export_about_left_chats" = "Below are the supergroups and channels from this export that you've left or where you were banned.\n\nNote that when you leave a channel or supergroup you've created, you have the option to either delete it, or simply leave (in case you want to rejoin later, or keep the community alive despite not being a member).";
// Wnd specific

View File

@@ -1,4 +1,45 @@
<RCC>
<qresource prefix="/export">
<file alias="css/style.css">../export_html/css/style.css</file>
<file alias="images/back.png">../export_html/images/back.png</file>
<file alias="images/back@2x.png">../export_html/images/back@2x.png</file>
<file alias="images/media_call.png">../export_html/images/media_call.png</file>
<file alias="images/media_call@2x.png">../export_html/images/media_call@2x.png</file>
<file alias="images/media_contact.png">../export_html/images/media_contact.png</file>
<file alias="images/media_contact@2x.png">../export_html/images/media_contact@2x.png</file>
<file alias="images/media_file.png">../export_html/images/media_file.png</file>
<file alias="images/media_file@2x.png">../export_html/images/media_file@2x.png</file>
<file alias="images/media_game.png">../export_html/images/media_game.png</file>
<file alias="images/media_game@2x.png">../export_html/images/media_game@2x.png</file>
<file alias="images/media_location.png">../export_html/images/media_location.png</file>
<file alias="images/media_location@2x.png">../export_html/images/media_location@2x.png</file>
<file alias="images/media_music.png">../export_html/images/media_music.png</file>
<file alias="images/media_music@2x.png">../export_html/images/media_music@2x.png</file>
<file alias="images/media_photo.png">../export_html/images/media_photo.png</file>
<file alias="images/media_photo@2x.png">../export_html/images/media_photo@2x.png</file>
<file alias="images/media_shop.png">../export_html/images/media_shop.png</file>
<file alias="images/media_shop@2x.png">../export_html/images/media_shop@2x.png</file>
<file alias="images/media_video.png">../export_html/images/media_video.png</file>
<file alias="images/media_video@2x.png">../export_html/images/media_video@2x.png</file>
<file alias="images/media_voice.png">../export_html/images/media_voice.png</file>
<file alias="images/media_voice@2x.png">../export_html/images/media_voice@2x.png</file>
<file alias="images/section_calls.png">../export_html/images/section_calls.png</file>
<file alias="images/section_calls@2x.png">../export_html/images/section_calls@2x.png</file>
<file alias="images/section_chats.png">../export_html/images/section_chats.png</file>
<file alias="images/section_chats@2x.png">../export_html/images/section_chats@2x.png</file>
<file alias="images/section_contacts.png">../export_html/images/section_contacts.png</file>
<file alias="images/section_contacts@2x.png">../export_html/images/section_contacts@2x.png</file>
<file alias="images/section_frequent.png">../export_html/images/section_frequent.png</file>
<file alias="images/section_frequent@2x.png">../export_html/images/section_frequent@2x.png</file>
<file alias="images/section_other.png">../export_html/images/section_other.png</file>
<file alias="images/section_other@2x.png">../export_html/images/section_other@2x.png</file>
<file alias="images/section_photos.png">../export_html/images/section_photos.png</file>
<file alias="images/section_photos@2x.png">../export_html/images/section_photos@2x.png</file>
<file alias="images/section_sessions.png">../export_html/images/section_sessions.png</file>
<file alias="images/section_sessions@2x.png">../export_html/images/section_sessions@2x.png</file>
<file alias="images/section_web.png">../export_html/images/section_web.png</file>
<file alias="images/section_web@2x.png">../export_html/images/section_web@2x.png</file>
</qresource>
<qresource prefix="/gui">
<file alias="fonts/OpenSans-Regular.ttf">../fonts/OpenSans-Regular.ttf</file>
<file alias="fonts/OpenSans-Bold.ttf">../fonts/OpenSans-Bold.ttf</file>

View File

@@ -167,7 +167,7 @@ inputMediaEmpty#9664f57f = InputMedia;
inputMediaUploadedPhoto#1e287d04 flags:# file:InputFile stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;
inputMediaPhoto#b3ba0635 flags:# id:InputPhoto ttl_seconds:flags.0?int = InputMedia;
inputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;
inputMediaContact#a6e45987 phone_number:string first_name:string last_name:string = InputMedia;
inputMediaContact#f8ab7dfb phone_number:string first_name:string last_name:string vcard:string = InputMedia;
inputMediaUploadedDocument#5b38c6c1 flags:# nosound_video:flags.3?true file:InputFile thumb:flags.2?InputFile mime_type:string attributes:Vector<DocumentAttribute> stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;
inputMediaDocument#23ab23d2 flags:# id:InputDocument ttl_seconds:flags.0?int = InputMedia;
inputMediaVenue#c13d1c11 geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string = InputMedia;
@@ -192,6 +192,7 @@ inputFileLocation#14637196 volume_id:long local_id:int secret:long = InputFileLo
inputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation;
inputDocumentFileLocation#430f0724 id:long access_hash:long version:int = InputFileLocation;
inputSecureFileLocation#cbc7ee28 id:long access_hash:long = InputFileLocation;
inputTakeoutFileLocation#29be5899 = InputFileLocation;
inputAppEvent#770656a8 time:double type:string peer:long data:string = InputAppEvent;
@@ -252,7 +253,7 @@ messageService#9e19a1f6 flags:# out:flags.1?true mentioned:flags.4?true media_un
messageMediaEmpty#3ded6320 = MessageMedia;
messageMediaPhoto#695150d7 flags:# photo:flags.0?Photo ttl_seconds:flags.2?int = MessageMedia;
messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;
messageMediaContact#5e7d2f39 phone_number:string first_name:string last_name:string user_id:int = MessageMedia;
messageMediaContact#cbf24940 phone_number:string first_name:string last_name:string vcard:string user_id:int = MessageMedia;
messageMediaUnsupported#9f84f49e = MessageMedia;
messageMediaDocument#9cb070d7 flags:# document:flags.0?Document ttl_seconds:flags.2?int = MessageMedia;
messageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia;
@@ -284,7 +285,7 @@ messageActionBotAllowed#abe9affe domain:string = MessageAction;
messageActionSecureValuesSentMe#1b287353 values:Vector<SecureValue> credentials:SecureCredentialsEncrypted = MessageAction;
messageActionSecureValuesSent#d95c6154 types:Vector<SecureValueType> = MessageAction;
dialog#e4def5db flags:# pinned:flags.2?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage = Dialog;
dialog#e4def5db flags:# pinned:flags.2?true unread_mark:flags.3?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage = Dialog;
photoEmpty#2331b22d id:long = Photo;
photo#9288dd29 flags:# has_stickers:flags.0?true id:long access_hash:long date:int sizes:Vector<PhotoSize> = Photo;
@@ -294,7 +295,7 @@ photoSize#77bfb61b type:string location:FileLocation w:int h:int size:int = Phot
photoCachedSize#e9a734fa type:string location:FileLocation w:int h:int bytes:bytes = PhotoSize;
geoPointEmpty#1117dd5f = GeoPoint;
geoPoint#2049d70c long:double lat:double = GeoPoint;
geoPoint#296f104 long:double lat:double access_hash:long = GeoPoint;
auth.checkedPhone#811ea28e phone_registered:Bool = auth.CheckedPhone;
@@ -344,6 +345,7 @@ contacts.blockedSlice#900802a1 count:int blocked:Vector<ContactBlocked> users:Ve
messages.dialogs#15ba6c40 dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
messages.dialogsSlice#71e094f3 count:int dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
messages.dialogsNotModified#f0e3e596 count:int = messages.Dialogs;
messages.messages#8c718e87 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
messages.messagesSlice#b446ae3 count:int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
@@ -440,6 +442,7 @@ updateFavedStickers#e511996d = Update;
updateChannelReadMessagesContents#89893b45 channel_id:int messages:Vector<int> = Update;
updateContactsReset#7084a7be = Update;
updateChannelAvailableMessages#70db6837 channel_id:int available_min_id:int = Update;
updateDialogUnreadMark#e16459c3 flags:# unread:flags.0?true peer:DialogPeer = Update;
updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
@@ -466,7 +469,7 @@ upload.fileCdnRedirect#f18cda44 dc_id:int file_token:bytes encryption_key:bytes
dcOption#18b7a10d flags:# ipv6:flags.0?true media_only:flags.1?true tcpo_only:flags.2?true cdn:flags.3?true static:flags.4?true id:int ip_address:string port:int secret:flags.10?bytes = DcOption;
config#eb7bb160 flags:# phonecalls_enabled:flags.1?true default_p2p_contacts:flags.3?true preload_featured_stickers:flags.4?true ignore_phone_entities:flags.5?true revoke_pm_inbox:flags.6?true blocked_mode:flags.8?true date:int expires:int test_mode:Bool this_dc:int dc_options:Vector<DcOption> chat_size_max:int megagroup_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int push_chat_period_ms:int push_chat_limit:int saved_gifs_limit:int edit_time_limit:int revoke_time_limit:int revoke_pm_time_limit:int rating_e_decay:int stickers_recent_limit:int stickers_faved_limit:int channels_read_media_period:int tmp_sessions:flags.0?int pinned_dialogs_count_max:int call_receive_timeout_ms:int call_ring_timeout_ms:int call_connect_timeout_ms:int call_packet_timeout_ms:int me_url_prefix:string autoupdate_url_prefix:flags.7?string suggested_lang_code:flags.2?string lang_pack_version:flags.2?int = Config;
config#3213dbba flags:# phonecalls_enabled:flags.1?true default_p2p_contacts:flags.3?true preload_featured_stickers:flags.4?true ignore_phone_entities:flags.5?true revoke_pm_inbox:flags.6?true blocked_mode:flags.8?true date:int expires:int test_mode:Bool this_dc:int dc_options:Vector<DcOption> dc_txt_domain_name:string chat_size_max:int megagroup_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int push_chat_period_ms:int push_chat_limit:int saved_gifs_limit:int edit_time_limit:int revoke_time_limit:int revoke_pm_time_limit:int rating_e_decay:int stickers_recent_limit:int stickers_faved_limit:int channels_read_media_period:int tmp_sessions:flags.0?int pinned_dialogs_count_max:int call_receive_timeout_ms:int call_ring_timeout_ms:int call_connect_timeout_ms:int call_packet_timeout_ms:int me_url_prefix:string autoupdate_url_prefix:flags.7?string gif_search_username:flags.9?string venue_search_username:flags.10?string img_search_username:flags.11?string static_maps_provider:flags.12?string caption_length_max:int message_length_max:int webfile_dc_id:int suggested_lang_code:flags.2?string lang_pack_version:flags.2?int = Config;
nearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;
@@ -693,7 +696,7 @@ inputBotInlineMessageMediaAuto#3380c786 flags:# message:string entities:flags.1?
inputBotInlineMessageText#3dcd7a87 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
inputBotInlineMessageMediaGeo#c1b15d65 flags:# geo_point:InputGeoPoint period:int reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
inputBotInlineMessageMediaVenue#417bbf11 flags:# geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
inputBotInlineMessageMediaContact#2daf01a7 flags:# phone_number:string first_name:string last_name:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
inputBotInlineMessageMediaContact#a6edbffd flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
inputBotInlineMessageGame#4b425864 flags:# reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
inputBotInlineResult#88bf9319 flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?InputWebDocument content:flags.5?InputWebDocument send_message:InputBotInlineMessage = InputBotInlineResult;
@@ -705,7 +708,7 @@ botInlineMessageMediaAuto#764cf810 flags:# message:string entities:flags.1?Vecto
botInlineMessageText#8c7f65e2 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
botInlineMessageMediaGeo#b722de65 flags:# geo:GeoPoint period:int reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
botInlineMessageMediaVenue#8a86659c flags:# geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
botInlineMessageMediaContact#35edb4d4 flags:# phone_number:string first_name:string last_name:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
botInlineMessageMediaContact#18d1cdc2 flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
botInlineResult#11965f3a flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?WebDocument content:flags.5?WebDocument send_message:BotInlineMessage = BotInlineResult;
botInlineMediaResult#17db940b flags:# id:string type:string photo:flags.0?Photo document:flags.1?Document title:flags.2?string description:flags.3?string send_message:BotInlineMessage = BotInlineResult;
@@ -748,8 +751,9 @@ topPeerCategoryPeers#fb834291 category:TopPeerCategory count:int peers:Vector<To
contacts.topPeersNotModified#de266ef5 = contacts.TopPeers;
contacts.topPeers#70b772a8 categories:Vector<TopPeerCategoryPeers> chats:Vector<Chat> users:Vector<User> = contacts.TopPeers;
contacts.topPeersDisabled#b52c939d = contacts.TopPeers;
draftMessageEmpty#ba4baec5 = DraftMessage;
draftMessageEmpty#1b0c841a flags:# date:flags.0?int = DraftMessage;
draftMessage#fd8e711f flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int message:string entities:flags.3?Vector<MessageEntity> date:int = DraftMessage;
messages.featuredStickersNotModified#4ede3cf = messages.FeaturedStickers;
@@ -837,14 +841,13 @@ paymentRequestedInfo#909c3f94 flags:# name:flags.0?string phone:flags.1?string e
paymentSavedCredentialsCard#cdc27a1f id:string title:string = PaymentSavedCredentials;
webDocument#c61acbd8 url:string access_hash:long size:int mime_type:string attributes:Vector<DocumentAttribute> dc_id:int = WebDocument;
webDocument#1c570ed1 url:string access_hash:long size:int mime_type:string attributes:Vector<DocumentAttribute> = WebDocument;
webDocumentNoProxy#f9c8bcc6 url:string size:int mime_type:string attributes:Vector<DocumentAttribute> = WebDocument;
inputWebDocument#9bed434d url:string size:int mime_type:string attributes:Vector<DocumentAttribute> = InputWebDocument;
inputWebFileLocation#c239d686 url:string access_hash:long = InputWebFileLocation;
inputWebFileGeoPointLocation#66275a62 geo_point:InputGeoPoint w:int h:int zoom:int scale:int = InputWebFileLocation;
inputWebFileGeoMessageLocation#553f32eb peer:InputPeer msg_id:int w:int h:int zoom:int scale:int = InputWebFileLocation;
inputWebFileGeoPointLocation#9f2221c9 geo_point:InputGeoPoint access_hash:long w:int h:int zoom:int scale:int = InputWebFileLocation;
upload.webFile#21e753bc size:int mime_type:string file_type:storage.FileType mtime:int bytes:bytes = upload.WebFile;
@@ -1014,6 +1017,10 @@ account.sentEmailCode#811f854f email_pattern:string length:int = account.SentEma
help.deepLinkInfoEmpty#66afa166 = help.DeepLinkInfo;
help.deepLinkInfo#6a4ee832 flags:# update_app:flags.0?true message:string entities:flags.1?Vector<MessageEntity> = help.DeepLinkInfo;
savedPhoneContact#1142bd56 phone:string first_name:string last_name:string date:int = SavedContact;
account.takeout#4dba4501 id:long = account.Takeout;
---functions---
invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
@@ -1021,13 +1028,14 @@ invokeAfterMsgs#3dc4b4f0 {X:Type} msg_ids:Vector<long> query:!X = X;
initConnection#785188b8 {X:Type} flags:# api_id:int device_model:string system_version:string app_version:string system_lang_code:string lang_pack:string lang_code:string proxy:flags.0?InputClientProxy query:!X = X;
invokeWithLayer#da9b0d0d {X:Type} layer:int query:!X = X;
invokeWithoutUpdates#bf9459b7 {X:Type} query:!X = X;
invokeWithMessagesRange#365275f2 {X:Type} range:MessageRange query:!X = X;
invokeWithTakeout#aca9fd2e {X:Type} takeout_id:long query:!X = X;
auth.sendCode#86aef0ec flags:# allow_flashcall:flags.0?true phone_number:string current_number:flags.0?Bool api_id:int api_hash:string = auth.SentCode;
auth.signUp#1b067634 phone_number:string phone_code_hash:string phone_code:string first_name:string last_name:string = auth.Authorization;
auth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:string = auth.Authorization;
auth.logOut#5717da40 = Bool;
auth.resetAuthorizations#9fab0d1a = Bool;
auth.sendInvites#771c1d97 phone_numbers:Vector<string> message:string = Bool;
auth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization;
auth.importAuthorization#e3ef9613 id:int bytes:bytes = auth.Authorization;
auth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool;
@@ -1079,6 +1087,8 @@ account.sendVerifyPhoneCode#823380b4 flags:# allow_flashcall:flags.0?true phone_
account.verifyPhone#4dd3a7f6 phone_number:string phone_code_hash:string phone_code:string = Bool;
account.sendVerifyEmailCode#7011509f email:string = account.SentEmailCode;
account.verifyEmail#ecba39db email:string code:string = Bool;
account.initTakeoutSession#f05b4804 flags:# contacts:flags.0?true message_users:flags.1?true message_chats:flags.2?true message_megagroups:flags.3?true message_channels:flags.4?true files:flags.5?true file_max_size:flags.5?int = account.Takeout;
account.finishTakeoutSession#1d2652ee flags:# success:flags.0?true = Bool;
users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
users.getFullUser#ca30a5b1 id:InputUser = UserFull;
@@ -1099,9 +1109,11 @@ contacts.resolveUsername#f93ccba3 username:string = contacts.ResolvedPeer;
contacts.getTopPeers#d4982db5 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true groups:flags.10?true channels:flags.15?true offset:int limit:int hash:int = contacts.TopPeers;
contacts.resetTopPeerRating#1ae373ac category:TopPeerCategory peer:InputPeer = Bool;
contacts.resetSaved#879537f1 = Bool;
contacts.getSaved#82f1e39f = Vector<SavedContact>;
contacts.toggleTopPeers#8514bdda enabled:Bool = Bool;
messages.getMessages#63c66506 id:Vector<InputMessage> = messages.Messages;
messages.getDialogs#191ba9c5 flags:# exclude_pinned:flags.0?true offset_date:int offset_id:int offset_peer:InputPeer limit:int = messages.Dialogs;
messages.getDialogs#b098aee6 flags:# exclude_pinned:flags.0?true offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:int = messages.Dialogs;
messages.getHistory#dcbb8260 peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages;
messages.search#8614ef68 flags:# peer:InputPeer q:string from_id:flags.0?InputUser filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages;
messages.readHistory#e306d3a peer:InputPeer max_id:int = messages.AffectedMessages;
@@ -1196,6 +1208,9 @@ messages.getRecentLocations#bbc45b09 peer:InputPeer limit:int hash:int = message
messages.sendMultiMedia#2095512f flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int multi_media:Vector<InputSingleMedia> = Updates;
messages.uploadEncryptedFile#5057c497 peer:InputEncryptedChat file:InputEncryptedFile = EncryptedFile;
messages.searchStickerSets#c2b7d08b flags:# exclude_featured:flags.0?true q:string hash:int = messages.FoundStickerSets;
messages.getSplitRanges#1cff7e08 = Vector<MessageRange>;
messages.markDialogUnread#c286d98f flags:# unread:flags.0?true peer:InputDialogPeer = Bool;
messages.getDialogUnreadMarks#22e24e22 = Vector<DialogPeer>;
updates.getState#edd4882a = updates.State;
updates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference;
@@ -1262,6 +1277,7 @@ channels.setStickers#ea8ca4f9 channel:InputChannel stickerset:InputStickerSet =
channels.readMessageContents#eab5dc38 channel:InputChannel id:Vector<int> = Bool;
channels.deleteHistory#af369d42 channel:InputChannel max_id:int = Bool;
channels.togglePreHistoryHidden#eabbb94c channel:InputChannel enabled:Bool = Updates;
channels.getLeftChannels#8341ecc0 offset:int = messages.Chats;
bots.sendCustomRequest#aa2769ed custom_method:string params:DataJSON = DataJSON;
bots.answerWebhookJSONQuery#e6213f4d query_id:long data:DataJSON = Bool;
@@ -1292,4 +1308,4 @@ langpack.getStrings#2e1ee318 lang_code:string keys:Vector<string> = Vector<LangP
langpack.getDifference#b2e4d7d from_version:int = LangPackDifference;
langpack.getLanguages#800fd57d = Vector<LangPackLanguage>;
// LAYER 81
// LAYER 82

View File

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

View File

@@ -34,8 +34,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,3,2,0
PRODUCTVERSION 1,3,2,0
FILEVERSION 1,3,10,0
PRODUCTVERSION 1,3,10,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -52,10 +52,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram Messenger LLP"
VALUE "FileDescription", "Telegram Desktop"
VALUE "FileVersion", "1.3.2.0"
VALUE "FileVersion", "1.3.10.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2018"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "1.3.2.0"
VALUE "ProductVersion", "1.3.10.0"
END
END
BLOCK "VarFileInfo"

View File

@@ -25,8 +25,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,3,2,0
PRODUCTVERSION 1,3,2,0
FILEVERSION 1,3,10,0
PRODUCTVERSION 1,3,10,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -43,10 +43,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram Messenger LLP"
VALUE "FileDescription", "Telegram Desktop Updater"
VALUE "FileVersion", "1.3.2.0"
VALUE "FileVersion", "1.3.10.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2018"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "1.3.2.0"
VALUE "ProductVersion", "1.3.10.0"
END
END
BLOCK "VarFileInfo"

View File

@@ -339,7 +339,7 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPWSTR cmdPara
LPWSTR *args;
int argsCount;
bool needupdate = false, autostart = false, debug = false, writeprotected = false, startintray = false, testmode = false;
bool needupdate = false, autostart = false, debug = false, writeprotected = false, startintray = false, testmode = false, externalupdater = false;
args = CommandLineToArgvW(GetCommandLine(), &argsCount);
if (args) {
for (int i = 1; i < argsCount; ++i) {
@@ -355,6 +355,8 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPWSTR cmdPara
startintray = true;
} else if (equal(args[i], L"-testmode")) {
testmode = true;
} else if (equal(args[i], L"-externalupdater")) {
externalupdater = true;
} else if (equal(args[i], L"-writeprotected") && ++i < argsCount) {
writeLog(std::wstring(L"Argument: ") + args[i]);
writeprotected = true;
@@ -425,6 +427,7 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPWSTR cmdPara
if (debug) targs += L" -debug";
if (startintray) targs += L" -startintray";
if (testmode) targs += L" -testmode";
if (externalupdater) targs += L" -externalupdater";
if (!customWorkingDir.empty()) {
targs += L" -workdir \"" + customWorkingDir + L"\"";
}

View File

@@ -337,6 +337,7 @@ int main(int argc, char *argv[]) {
bool tosettings = false;
bool startintray = false;
bool testmode = false;
bool externalupdater = false;
bool customWorkingDir = false;
char *key = 0;
@@ -352,6 +353,8 @@ int main(int argc, char *argv[]) {
startintray = true;
} else if (equal(argv[i], "-testmode")) {
testmode = true;
} else if (equal(argv[i], "-externalupdater")) {
externalupdater = true;
} else if (equal(argv[i], "-tosettings")) {
tosettings = true;
} else if (equal(argv[i], "-workdir_custom")) {
@@ -450,6 +453,7 @@ int main(int argc, char *argv[]) {
char p_key[] = "-key";
char p_startintray[] = "-startintray";
char p_testmode[] = "-testmode";
char p_externalupdater[] = "-externalupdater";
char p_workdir[] = "-workdir";
int argIndex = 0;
args[argIndex++] = path;
@@ -458,6 +462,7 @@ int main(int argc, char *argv[]) {
if (debug) args[argIndex++] = p_debug;
if (startintray) args[argIndex++] = p_startintray;
if (testmode) args[argIndex++] = p_testmode;
if (externalupdater) args[argIndex++] = p_externalupdater;
if (tosettings) args[argIndex++] = p_tosettings;
if (key) {
args[argIndex++] = p_key;

View File

@@ -75,7 +75,7 @@ int main(int argc, const char * argv[]) {
openLog();
pid_t procId = 0;
BOOL update = YES, toSettings = NO, autoStart = NO, startInTray = NO, testMode = NO;
BOOL update = YES, toSettings = NO, autoStart = NO, startInTray = NO, testMode = NO, externalUpdater = NO;
BOOL customWorkingDir = NO;
NSString *key = nil;
for (int i = 0; i < argc; ++i) {
@@ -101,6 +101,8 @@ int main(int argc, const char * argv[]) {
startInTray = YES;
} else if ([@"-testmode" isEqualToString:[NSString stringWithUTF8String:argv[i]]]) {
testMode = YES;
} else if ([@"-externalupdater" isEqualToString:[NSString stringWithUTF8String:argv[i]]]) {
externalUpdater = YES;
} else if ([@"-workdir_custom" isEqualToString:[NSString stringWithUTF8String:argv[i]]]) {
customWorkingDir = YES;
} else if ([@"-key" isEqualToString:[NSString stringWithUTF8String:argv[i]]]) {
@@ -235,6 +237,7 @@ int main(int argc, const char * argv[]) {
if (_debug) [args addObject:@"-debug"];
if (startInTray) [args addObject:@"-startintray"];
if (testMode) [args addObject:@"-testmode"];
if (externalUpdater) [args addObject:@"-externalupdater"];
if (autoStart) [args addObject:@"-autostart"];
if (key) {
[args addObject:@"-key"];

View File

@@ -37,8 +37,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "window/notifications_manager.h"
#include "window/window_lock_widgets.h"
#include "window/window_controller.h"
#include "inline_bots/inline_bot_result.h"
#include "chat_helpers/message_field.h"
#include "chat_helpers/stickers.h"
#include "ui/text_options.h"
#include "storage/localimageloader.h"
#include "storage/storage_facade.h"
#include "storage/storage_shared_media.h"
@@ -126,15 +128,15 @@ MTPVector<MTPDocumentAttribute> ComposeSendingDocumentAttributes(
return MTP_vector<MTPDocumentAttribute>(attributes);
}
FileLoadTo FileLoadTaskOptions(const ApiWrap::SendOptions &options) {
const auto peer = options.history->peer;
return FileLoadTo(
peer->id,
Auth().data().notifySilentPosts(peer),
options.replyTo);
} // namespace
ApiWrap::SendOptions::SendOptions(not_null<History*> history)
: history(history) {
}
} // namespace
ApiWrap::MessageToSend::MessageToSend(not_null<History*> history)
: history(history) {
}
ApiWrap::ApiWrap(not_null<AuthSession*> session)
: _session(session)
@@ -230,7 +232,7 @@ void ApiWrap::proxyPromotionDone(const MTPhelp_ProxyData &proxy) {
const auto peer = App::peer(peerId);
_session->data().setProxyPromoted(peer);
if (const auto history = App::historyLoaded(peer)) {
_session->api().requestDialogEntry(history);
requestDialogEntry(history);
}
}
@@ -270,8 +272,9 @@ void ApiWrap::requestTermsUpdate() {
_termsUpdateRequestId = 0;
const auto requestNext = [&](auto &&data) {
const auto timeout = (data.vexpires.v - unixtime());
_termsUpdateSendAt = getms(true) + snap(
TimeMs(data.vexpires.v - unixtime()),
timeout * TimeMs(1000),
kTermsUpdateTimeoutMin,
kTermsUpdateTimeoutMax);
requestTermsUpdate();
@@ -565,13 +568,15 @@ void ApiWrap::requestDialogEntry(not_null<Data::Feed*> feed) {
// }
// _dialogFeedRequests.emplace(feed);
//
// const auto hash = 0;
// request(MTPmessages_GetDialogs(
// MTP_flags(MTPmessages_GetDialogs::Flag::f_feed_id),
// MTP_int(feed->id()),
// MTP_int(0), // offset_date
// MTP_int(0), // offset_id
// MTP_inputPeerEmpty(), // offset_peer
// MTP_int(Data::Feed::kChannelsLimit)
// MTP_int(Data::Feed::kChannelsLimit),
// MTP_int(hash)
// )).done([=](const MTPmessages_Dialogs &result) {
// applyFeedDialogs(feed, result);
// _dialogFeedRequests.remove(feed);
@@ -714,6 +719,18 @@ void ApiWrap::applyFeedDialogs(
_session->data().sendHistoryChangeNotifications();
}
void ApiWrap::changeDialogUnreadMark(
not_null<History*> history,
bool unread) {
history->setUnreadMark(unread);
using Flag = MTPmessages_MarkDialogUnread::Flag;
request(MTPmessages_MarkDialogUnread(
MTP_flags(unread ? Flag::f_unread : Flag(0)),
MTP_inputDialogPeer(history->peer->input)
)).send();
}
void ApiWrap::requestFullPeer(PeerData *peer) {
if (!peer || _fullPeerRequests.contains(peer)) return;
@@ -2055,10 +2072,22 @@ void ApiWrap::saveDraftsToCloud() {
if (!textWithTags.tags.isEmpty()) {
flags |= MTPmessages_SaveDraft::Flag::f_entities;
}
auto entities = TextUtilities::EntitiesToMTP(ConvertTextTagsToEntities(textWithTags.tags), TextUtilities::ConvertOption::SkipLocal);
auto entities = TextUtilities::EntitiesToMTP(
ConvertTextTagsToEntities(textWithTags.tags),
TextUtilities::ConvertOption::SkipLocal);
cloudDraft->saveRequestId = request(MTPmessages_SaveDraft(MTP_flags(flags), MTP_int(cloudDraft->msgId), history->peer->input, MTP_string(textWithTags.text), entities)).done([this, history](const MTPBool &result, mtpRequestId requestId) {
if (auto cloudDraft = history->cloudDraft()) {
const auto draftText = textWithTags.text;
history->setSentDraftText(draftText);
cloudDraft->saveRequestId = request(MTPmessages_SaveDraft(
MTP_flags(flags),
MTP_int(cloudDraft->msgId),
history->peer->input,
MTP_string(textWithTags.text),
entities
)).done([=](const MTPBool &result, mtpRequestId requestId) {
history->clearSentDraftText(draftText);
if (const auto cloudDraft = history->cloudDraft()) {
if (cloudDraft->saveRequestId == requestId) {
cloudDraft->saveRequestId = 0;
history->draftSavedToCloud();
@@ -2069,8 +2098,10 @@ void ApiWrap::saveDraftsToCloud() {
_draftsSaveRequestIds.erase(history);
checkQuitPreventFinished();
}
}).fail([this, history](const RPCError &error, mtpRequestId requestId) {
if (auto cloudDraft = history->cloudDraft()) {
}).fail([=](const RPCError &error, mtpRequestId requestId) {
history->clearSentDraftText(draftText);
if (const auto cloudDraft = history->cloudDraft()) {
if (cloudDraft->saveRequestId == requestId) {
history->clearCloudDraft();
}
@@ -2470,6 +2501,12 @@ std::vector<not_null<DocumentData*>> *ApiWrap::stickersByEmoji(
auto &entry = _stickersByEmoji[emoji];
entry.list.clear();
entry.list.reserve(data.vstickers.v.size());
for (const auto &sticker : data.vstickers.v) {
const auto document = _session->data().document(sticker);
if (document->sticker()) {
entry.list.push_back(document);
}
}
entry.hash = data.vhash.v;
entry.received = getms(true);
_session->data().notifyStickersUpdated();
@@ -3763,6 +3800,8 @@ void ApiWrap::sendSharedContact(
const auto messagePostAuthor = channelPost
? (_session->user()->firstName + ' ' + _session->user()->lastName)
: QString();
const auto vcard = QString();
const auto views = 1;
const auto item = history->addNewMessage(
MTP_message(
MTP_flags(flags),
@@ -3778,10 +3817,11 @@ void ApiWrap::sendSharedContact(
MTP_string(phone),
MTP_string(firstName),
MTP_string(lastName),
MTP_string(vcard),
MTP_int(userId)),
MTPnullMarkup,
MTPnullEntities,
MTP_int(1),
MTP_int(views),
MTPint(),
MTP_string(messagePostAuthor),
MTPlong()),
@@ -3790,7 +3830,8 @@ void ApiWrap::sendSharedContact(
const auto media = MTP_inputMediaContact(
MTP_string(phone),
MTP_string(firstName),
MTP_string(lastName));
MTP_string(lastName),
MTP_string(vcard));
sendMedia(item, media, _session->data().notifySilentPosts(peer));
if (const auto main = App::main()) {
@@ -3806,7 +3847,7 @@ void ApiWrap::sendVoiceMessage(
int duration,
const SendOptions &options) {
const auto caption = TextWithTags();
const auto to = FileLoadTaskOptions(options);
const auto to = fileLoadTaskOptions(options);
_fileLoader->addTask(std::make_unique<FileLoadTask>(
result,
duration,
@@ -3822,15 +3863,15 @@ void ApiWrap::sendFiles(
std::shared_ptr<SendingAlbum> album,
const SendOptions &options) {
if (list.files.size() > 1 && !caption.text.isEmpty()) {
auto message = MainWidget::MessageToSend(options.history);
auto message = MessageToSend(options.history);
message.textWithTags = std::move(caption);
message.replyTo = options.replyTo;
message.clearDraft = false;
App::main()->sendMessage(message);
sendMessage(std::move(message));
caption = TextWithTags();
}
const auto to = FileLoadTaskOptions(options);
const auto to = fileLoadTaskOptions(options);
if (album) {
album->silent = to.silent;
}
@@ -3871,7 +3912,7 @@ void ApiWrap::sendFile(
const QByteArray &fileContent,
SendMediaType type,
const SendOptions &options) {
auto to = FileLoadTaskOptions(options);
const auto to = fileLoadTaskOptions(options);
auto caption = TextWithTags();
_fileLoader->addTask(std::make_unique<FileLoadTask>(
QString(),
@@ -3941,6 +3982,212 @@ void ApiWrap::cancelLocalItem(not_null<HistoryItem*> item) {
}
}
void ApiWrap::sendMessage(MessageToSend &&message) {
const auto history = message.history;
const auto peer = history->peer;
auto &textWithTags = message.textWithTags;
auto options = ApiWrap::SendOptions(history);
options.clearDraft = message.clearDraft;
options.replyTo = message.replyTo;
options.generateLocal = true;
options.webPageId = message.webPageId;
sendAction(options);
if (!peer->canWrite()) {
return;
}
Local::saveRecentSentHashtags(textWithTags.text);
auto sending = TextWithEntities();
auto left = TextWithEntities {
textWithTags.text,
ConvertTextTagsToEntities(textWithTags.tags)
};
auto prepareFlags = Ui::ItemTextOptions(
history,
_session->user()).flags;
TextUtilities::PrepareForSending(left, prepareFlags);
HistoryItem *lastMessage = nullptr;
while (TextUtilities::CutPart(sending, left, MaxMessageSize)) {
auto newId = FullMsgId(peerToChannel(peer->id), clientMsgId());
auto randomId = rand_value<uint64>();
TextUtilities::Trim(sending);
App::historyRegRandom(randomId, newId);
App::historyRegSentData(randomId, peer->id, sending.text);
MTPstring msgText(MTP_string(sending.text));
auto flags = NewMessageFlags(peer) | MTPDmessage::Flag::f_entities;
auto sendFlags = MTPmessages_SendMessage::Flags(0);
if (message.replyTo) {
flags |= MTPDmessage::Flag::f_reply_to_msg_id;
sendFlags |= MTPmessages_SendMessage::Flag::f_reply_to_msg_id;
}
MTPMessageMedia media = MTP_messageMediaEmpty();
if (message.webPageId == CancelledWebPageId) {
sendFlags |= MTPmessages_SendMessage::Flag::f_no_webpage;
} else if (message.webPageId) {
auto page = _session->data().webpage(message.webPageId);
media = MTP_messageMediaWebPage(
MTP_webPagePending(
MTP_long(page->id),
MTP_int(page->pendingTill)));
flags |= MTPDmessage::Flag::f_media;
}
bool channelPost = peer->isChannel() && !peer->isMegagroup();
bool silentPost = channelPost
&& _session->data().notifySilentPosts(peer);
if (channelPost) {
flags |= MTPDmessage::Flag::f_views;
flags |= MTPDmessage::Flag::f_post;
}
if (!channelPost) {
flags |= MTPDmessage::Flag::f_from_id;
} else if (peer->asChannel()->addsSignature()) {
flags |= MTPDmessage::Flag::f_post_author;
}
if (silentPost) {
sendFlags |= MTPmessages_SendMessage::Flag::f_silent;
}
auto localEntities = TextUtilities::EntitiesToMTP(sending.entities);
auto sentEntities = TextUtilities::EntitiesToMTP(sending.entities, TextUtilities::ConvertOption::SkipLocal);
if (!sentEntities.v.isEmpty()) {
sendFlags |= MTPmessages_SendMessage::Flag::f_entities;
}
if (message.clearDraft) {
sendFlags |= MTPmessages_SendMessage::Flag::f_clear_draft;
history->clearCloudDraft();
history->setSentDraftText(QString());
}
auto messageFromId = channelPost ? 0 : _session->userId();
auto messagePostAuthor = channelPost
? App::peerName(_session->user())
: QString();
lastMessage = history->addNewMessage(
MTP_message(
MTP_flags(flags),
MTP_int(newId.msg),
MTP_int(messageFromId),
peerToMTP(peer->id),
MTPnullFwdHeader,
MTPint(),
MTP_int(message.replyTo),
MTP_int(unixtime()),
msgText,
media,
MTPnullMarkup,
localEntities,
MTP_int(1),
MTPint(),
MTP_string(messagePostAuthor),
MTPlong()),
NewMessageUnread);
history->sendRequestId = request(MTPmessages_SendMessage(
MTP_flags(sendFlags),
peer->input,
MTP_int(message.replyTo),
msgText,
MTP_long(randomId),
MTPnullMarkup,
sentEntities
)).done([=](const MTPUpdates &result) {
applyUpdates(result, randomId);
history->clearSentDraftText(QString());
}).fail([=](const RPCError &error) {
sendMessageFail(error);
history->clearSentDraftText(QString());
}).afterRequest(history->sendRequestId
).send();
}
if (const auto main = App::main()) {
main->finishForwarding(history);
}
}
void ApiWrap::sendInlineResult(
not_null<UserData*> bot,
not_null<InlineBots::Result*> data,
const SendOptions &options) {
Auth().api().sendAction(options);
const auto history = options.history;
const auto peer = history->peer;
const auto newId = FullMsgId(peerToChannel(peer->id), clientMsgId());
const auto randomId = rand_value<uint64>();
auto flags = NewMessageFlags(peer) | MTPDmessage::Flag::f_media;
auto sendFlags = MTPmessages_SendInlineBotResult::Flag::f_clear_draft | 0;
if (options.replyTo) {
flags |= MTPDmessage::Flag::f_reply_to_msg_id;
sendFlags |= MTPmessages_SendInlineBotResult::Flag::f_reply_to_msg_id;
}
bool channelPost = peer->isChannel() && !peer->isMegagroup();
bool silentPost = channelPost && _session->data().notifySilentPosts(peer);
if (channelPost) {
flags |= MTPDmessage::Flag::f_views;
flags |= MTPDmessage::Flag::f_post;
}
if (!channelPost) {
flags |= MTPDmessage::Flag::f_from_id;
} else if (peer->asChannel()->addsSignature()) {
flags |= MTPDmessage::Flag::f_post_author;
}
if (silentPost) {
sendFlags |= MTPmessages_SendInlineBotResult::Flag::f_silent;
}
if (bot) {
flags |= MTPDmessage::Flag::f_via_bot_id;
}
auto messageFromId = channelPost ? 0 : Auth().userId();
auto messagePostAuthor = channelPost
? App::peerName(Auth().user())
: QString();
MTPint messageDate = MTP_int(unixtime());
UserId messageViaBotId = bot ? peerToUser(bot->id) : 0;
MsgId messageId = newId.msg;
App::historyRegRandom(randomId, newId);
data->addToHistory(
history,
flags,
messageId,
messageFromId,
messageDate,
messageViaBotId,
options.replyTo,
messagePostAuthor);
history->clearCloudDraft();
history->setSentDraftText(QString());
history->sendRequestId = request(MTPmessages_SendInlineBotResult(
MTP_flags(sendFlags),
peer->input,
MTP_int(options.replyTo),
MTP_long(randomId),
MTP_long(data->getQueryId()),
MTP_string(data->getId())
)).done([=](const MTPUpdates &result) {
applyUpdates(result, randomId);
history->clearSentDraftText(QString());
}).fail([=](const RPCError &error) {
sendMessageFail(error);
history->clearSentDraftText(QString());
}).afterRequest(history->sendRequestId
).send();
if (const auto main = App::main()) {
main->finishForwarding(history);
}
}
void ApiWrap::uploadAlbumMedia(
not_null<HistoryItem*> item,
const MessageGroupId &groupId,
@@ -4176,10 +4423,21 @@ void ApiWrap::sendAlbumIfReady(not_null<SendingAlbum*> album) {
).send();
}
FileLoadTo ApiWrap::fileLoadTaskOptions(const SendOptions &options) const {
const auto peer = options.history->peer;
return FileLoadTo(
peer->id,
_session->data().notifySilentPosts(peer),
options.replyTo);
}
void ApiWrap::readServerHistory(not_null<History*> history) {
if (history->unreadCount()) {
readServerHistoryForce(history);
}
if (history->unreadMark()) {
changeDialogUnreadMark(history, false);
}
}
void ApiWrap::readServerHistoryForce(not_null<History*> history) {

View File

@@ -21,6 +21,11 @@ class AuthSession;
struct MessageGroupId;
struct SendingAlbum;
enum class SendMediaType;
struct FileLoadTo;
namespace InlineBots {
class Result;
} // namespace InlineBots
namespace Storage {
enum class SharedMediaType : signed char;
@@ -80,6 +85,8 @@ public:
//void setFeedChannels(
// not_null<Data::Feed*> feed,
// const std::vector<not_null<ChannelData*>> &channels);
void changeDialogUnreadMark(not_null<History*> history, bool unread);
//void changeDialogUnreadMark(not_null<Data::Feed*> feed, bool unread); // #feed
void requestFullPeer(PeerData *peer);
void requestPeer(PeerData *peer);
@@ -221,8 +228,7 @@ public:
Fn<void()> callbackNotModified = nullptr);
struct SendOptions {
SendOptions(not_null<History*> history) : history(history) {
}
SendOptions(not_null<History*> history);
not_null<History*> history;
MsgId replyTo = 0;
@@ -277,6 +283,21 @@ public:
bool silent);
void cancelLocalItem(not_null<HistoryItem*> item);
struct MessageToSend {
MessageToSend(not_null<History*> history);
not_null<History*> history;
TextWithTags textWithTags;
MsgId replyTo = 0;
WebPageId webPageId = 0;
bool clearDraft = true;
};
void sendMessage(MessageToSend &&message);
void sendInlineResult(
not_null<UserData*> bot,
not_null<InlineBots::Result*> data,
const SendOptions &options);
~ApiWrap();
private:
@@ -439,6 +460,7 @@ private:
const MTPInputMedia &media,
bool silent,
uint64 randomId);
FileLoadTo fileLoadTaskOptions(const SendOptions &options) const;
void readFeeds();

View File

@@ -17,6 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "styles/style_history.h"
#include "styles/style_boxes.h"
#include "lang/lang_keys.h"
#include "boxes/confirm_box.h"
#include "data/data_abstract_structure.h"
#include "data/data_media_types.h"
#include "data/data_session.h"
@@ -50,8 +51,7 @@ namespace {
UserData *self = nullptr;
using PeersData = QHash<PeerId, PeerData*>;
PeersData peersData;
std::unordered_map<PeerId, std::unique_ptr<PeerData>> peersData;
using LocationsData = QHash<LocationCoords, LocationData*>;
LocationsData locationsData;
@@ -747,7 +747,7 @@ namespace App {
} else if (chat->version <= d.vversion.v && chat->count > 0) {
chat->version = d.vversion.v;
auto canEdit = chat->canEdit();
UserData *user = App::userLoaded(d.vuser_id.v);
const auto user = App::userLoaded(d.vuser_id.v);
if (user) {
if (chat->participants.empty()) {
if (chat->count > 0) {
@@ -1074,40 +1074,43 @@ namespace App {
}
PeerData *peer(const PeerId &id, PeerData::LoadedStatus restriction) {
if (!id) return nullptr;
if (!id) {
return nullptr;
}
auto i = peersData.constFind(id);
auto i = peersData.find(id);
if (i == peersData.cend()) {
PeerData *newData = nullptr;
if (peerIsUser(id)) {
newData = new UserData(id);
} else if (peerIsChat(id)) {
newData = new ChatData(id);
} else if (peerIsChannel(id)) {
newData = new ChannelData(id);
}
Assert(newData != nullptr);
auto newData = [&]() -> std::unique_ptr<PeerData> {
if (peerIsUser(id)) {
return std::make_unique<UserData>(id);
} else if (peerIsChat(id)) {
return std::make_unique<ChatData>(id);
} else if (peerIsChannel(id)) {
return std::make_unique<ChannelData>(id);
}
Unexpected("Peer id type.");
}();
newData->input = MTPinputPeer(MTP_inputPeerEmpty());
i = peersData.insert(id, newData);
i = peersData.emplace(id, std::move(newData)).first;
}
switch (restriction) {
case PeerData::MinimalLoaded: {
if (i.value()->loadedStatus == PeerData::NotLoaded) {
if (i->second->loadedStatus == PeerData::NotLoaded) {
return nullptr;
}
} break;
case PeerData::FullLoaded: {
if (i.value()->loadedStatus != PeerData::FullLoaded) {
if (i->second->loadedStatus != PeerData::FullLoaded) {
return nullptr;
}
} break;
}
return i.value();
return i->second.get();
}
void enumerateUsers(Fn<void(not_null<UserData*>)> action) {
for_const (const auto peer, peersData) {
for (const auto &[peerId, peer] : peersData) {
if (const auto user = peer->asUser()) {
action(user);
}
@@ -1116,9 +1119,9 @@ namespace App {
void enumerateChatsChannels(
Fn<void(not_null<PeerData*>)> action) {
for_const (const auto peer, peersData) {
for (const auto &[peerId, peer] : peersData) {
if (!peer->isUser()) {
action(peer);
action(peer.get());
}
}
}
@@ -1128,10 +1131,10 @@ namespace App {
}
PeerData *peerByName(const QString &username) {
QString uname(username.trimmed());
for_const (PeerData *peer, peersData) {
const auto uname = username.trimmed();
for (const auto &[peerId, peer] : peersData) {
if (!peer->userName().compare(uname, Qt::CaseInsensitive)) {
return peer;
return peer.get();
}
}
return nullptr;
@@ -1246,24 +1249,16 @@ namespace App {
void historyClearMsgs() {
::dependentItems.clear();
QVector<HistoryItem*> toDelete;
for_const (auto item, msgsData) {
if (!item->mainView()) {
toDelete.push_back(item);
}
}
for_const (auto &chMsgsData, channelMsgsData) {
for_const (auto item, chMsgsData) {
if (!item->mainView()) {
toDelete.push_back(item);
}
}
}
msgsData.clear();
channelMsgsData.clear();
for_const (auto item, toDelete) {
const auto oldData = base::take(msgsData);
const auto oldChannelData = base::take(channelMsgsData);
for (const auto item : oldData) {
delete item;
}
for (const auto &data : oldChannelData) {
for (const auto item : data) {
delete item;
}
}
clearMousedItems();
}
@@ -1275,10 +1270,7 @@ namespace App {
cSetSavedPeersByTime(SavedPeersByTime());
cSetRecentInlineBots(RecentInlineBots());
for_const (auto peer, ::peersData) {
delete peer;
}
::peersData.clear();
peersData.clear();
if (AuthSession::Exists()) {
Auth().api().clearWebPageRequests();
@@ -1598,7 +1590,13 @@ namespace App {
}
void quit() {
if (quitting()) return;
if (quitting()) {
return;
} else if (AuthSession::Exists()
&& Auth().data().exportInProgress()) {
Auth().data().stopExportWithConfirmation([] { App::quit(); });
return;
}
setLaunchState(QuitRequested);
if (auto window = wnd()) {
@@ -1625,11 +1623,9 @@ namespace App {
}
void restart() {
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
bool updateReady = (Core::UpdateChecker().state() == Core::UpdateChecker::State::Ready);
#else // !TDESKTOP_DISABLE_AUTOUPDATE
bool updateReady = false;
#endif // else for !TDESKTOP_DISABLE_AUTOUPDATE
using namespace Core;
const auto updateReady = !UpdaterDisabled()
&& (UpdateChecker().state() == UpdateChecker::State::Ready);
if (updateReady) {
cSetRestartingUpdate(true);
} else {

View File

@@ -91,10 +91,9 @@ Application::Application(
char **argv)
: QApplication(argc, argv)
, _launcher(launcher)
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
, _updateChecker(std::make_unique<Core::UpdateChecker>())
#endif // TDESKTOP_DISABLE_AUTOUPDATE
{
, _updateChecker(Core::UpdaterDisabled()
? nullptr
: std::make_unique<Core::UpdateChecker>()) {
const auto d = QFile::encodeName(QDir(cWorkingDir()).absolutePath());
char h[33] = { 0 };
hashMd5Hex(d.constData(), d.size(), h);
@@ -204,13 +203,13 @@ void Application::socketError(QLocalSocket::LocalSocketError e) {
}
#endif // !Q_OS_WINRT
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
if (!cNoStartUpdate() && Core::checkReadyUpdate()) {
if (!Core::UpdaterDisabled()
&& !cNoStartUpdate()
&& Core::checkReadyUpdate()) {
cSetRestartingUpdate(true);
DEBUG_LOG(("Application Info: installing update instead of starting app..."));
return App::quit();
}
#endif // !TDESKTOP_DISABLE_AUTOUPDATE
singleInstanceChecked();
}
@@ -384,9 +383,7 @@ void Application::closeApplication() {
_localSocket.close();
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
_updateChecker = nullptr;
#endif // !TDESKTOP_DISABLE_AUTOUPDATE
}
inline Application *application() {

View File

@@ -61,9 +61,7 @@ private:
void singleInstanceChecked();
private:
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
std::unique_ptr<Core::UpdateChecker> _updateChecker;
#endif // !TDESKTOP_DISABLE_AUTOUPDATE
};

View File

@@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include <gsl/gsl>
#include <gsl/gsl_byte>
namespace bytes {
@@ -134,4 +135,7 @@ vector concatenate(SpanRange args) {
return result;
}
// Implemented in base/openssl_help.h
void set_random(span destination);
} // namespace bytes

View File

@@ -417,8 +417,9 @@ public:
if (range.first == range.second) {
return 0;
}
const auto result = (range.second - range.first);
impl().erase(range.first, range.second);
return (range.second - range.first);
return result;
}
iterator erase(const_iterator where) {

View File

@@ -297,8 +297,9 @@ public:
if (range.first == range.second) {
return 0;
}
const auto result = (range.second - range.first);
impl().erase(range.first, range.second);
return (range.second - range.first);
return result;
}
iterator erase(const_iterator where) {

View File

@@ -0,0 +1,28 @@
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include <rpl/details/callable.h>
namespace base {
template <typename Data, typename Method, typename ...Methods>
inline decltype(auto) match_method(
Data &&data,
Method &&method,
Methods &&...methods) {
if constexpr (rpl::details::is_callable_plain_v<Method, Data&&>) {
return std::forward<Method>(method)(std::forward<Data>(data));
} else {
return match_method(
std::forward<Data>(data),
std::forward<Methods>(methods)...);
}
}
} // namespace base

View File

@@ -109,6 +109,15 @@ public:
return _impl.template get_unchecked<T>();
}
template <typename ...Methods>
decltype(auto) match(Methods &&...methods) {
return base::match(_impl, std::forward<Methods>(methods)...);
}
template <typename ...Methods>
decltype(auto) match(Methods &&...methods) const {
return base::match(_impl, std::forward<Methods>(methods)...);
}
private:
variant<none_type, Types...> _impl;
@@ -124,6 +133,20 @@ inline const T *get_if(const optional_variant<Types...> *v) {
return (v && v->template is<T>()) ? &v->template get_unchecked<T>() : nullptr;
}
template <typename ...Types, typename ...Methods>
inline decltype(auto) match(
optional_variant<Types...> &value,
Methods &&...methods) {
return value.match(std::forward<Methods>(methods)...);
}
template <typename ...Types, typename ...Methods>
inline decltype(auto) match(
const optional_variant<Types...> &value,
Methods &&...methods) {
return value.match(std::forward<Methods>(methods)...);
}
template <typename Type>
class optional;
@@ -160,12 +183,17 @@ class optional : public optional_variant<Type> {
public:
using parent::parent;
Type &operator*() {
Type &operator*() & {
Expects(parent::template is<Type>());
return parent::template get_unchecked<Type>();
}
const Type &operator*() const {
Type &&operator*() && {
Expects(parent::template is<Type>());
return std::move(parent::template get_unchecked<Type>());
}
const Type &operator*() const & {
Expects(parent::template is<Type>());
return parent::template get_unchecked<Type>();

View File

@@ -7,7 +7,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include <QtCore/QObject>
#include <QtCore/QThread>
#include "base/observer.h"
#include "base/flat_map.h"
namespace base {

View File

@@ -69,11 +69,11 @@ public:
unique_any(const unique_any &other) = delete;
unique_any &operator=(const unique_any &other) = delete;
unique_any(unique_any &&other) noexcept
: _impl(std::move(other._impl)) {
}
unique_any &operator=(unique_any &&other) noexcept {
_impl = std::move(other._impl);
return *this;
@@ -88,7 +88,7 @@ public:
std::forward<Value>(other),
std::is_copy_constructible<std::decay_t<Value>>()) {
}
template <
typename Value,
typename = std::enable_if_t<
@@ -106,7 +106,7 @@ public:
}
return *this;
}
template <
typename Value,
typename ...Args,
@@ -143,7 +143,7 @@ private:
unique_any(Value &&other, std::true_type)
: _impl(std::forward<Value>(other)) {
}
template <
typename Value,
typename = std::enable_if_t<
@@ -177,7 +177,7 @@ inline void swap(unique_any &a, unique_any &b) noexcept {
template <
typename Value,
typename ...Args>
inline auto make_any(Args &&...args)
inline auto make_any(Args &&...args)
-> std::enable_if_t<
std::is_copy_constructible_v<std::decay_t<Value>>,
unique_any> {
@@ -187,7 +187,7 @@ inline auto make_any(Args &&...args)
template <
typename Value,
typename ...Args>
inline auto make_any(Args &&...args)
inline auto make_any(Args &&...args)
-> std::enable_if_t<
!std::is_copy_constructible_v<std::decay_t<Value>>
&& std::is_move_constructible_v<std::decay_t<Value>>,

View File

@@ -124,7 +124,10 @@ public:
_impl.swap(other._impl);
}
template <typename ...OtherArgs>
template <
typename ...OtherArgs,
typename = decltype(std::declval<std::function<Return(Args...)>>()(
std::declval<OtherArgs>()...))>
Return operator()(OtherArgs &&...args) {
return _impl(std::forward<OtherArgs>(args)...);
}

View File

@@ -7,6 +7,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include <utility>
namespace base {
namespace details {

View File

@@ -8,6 +8,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#pragma once
#include <mapbox/variant.hpp>
#include <rpl/details/type_list.h>
#include "base/match_method.h"
#include "base/assertion.h"
// We use base::variant<> alias and base::get_if() helper while we don't have std::variant<>.
namespace base {
@@ -25,20 +28,79 @@ inline const T *get_if(const variant<Types...> *v) {
return (v && v->template is<T>()) ? &v->template get_unchecked<T>() : nullptr;
}
// Simplified visit
template <typename Method, typename... Types>
inline auto visit(Method &&method, const variant<Types...> &value) {
return value.match(std::forward<Method>(method));
namespace type_list = rpl::details::type_list;
template <typename ...Types>
struct normalized_variant {
using list = type_list::list<Types...>;
using distinct = type_list::distinct_t<list>;
using type = std::conditional_t<
type_list::size_v<distinct> == 1,
type_list::get_t<0, distinct>,
type_list::extract_to_t<distinct, base::variant>>;
};
template <typename ...Types>
using normalized_variant_t
= typename normalized_variant<Types...>::type;
template <typename TypeList, typename Variant, typename ...Methods>
struct match_helper;
template <
typename Type,
typename ...Types,
typename Variant,
typename ...Methods>
struct match_helper<type_list::list<Type, Types...>, Variant, Methods...> {
static decltype(auto) call(Variant &value, Methods &&...methods) {
if (const auto v = get_if<Type>(&value)) {
return match_method(
*v,
std::forward<Methods>(methods)...);
}
return match_helper<
type_list::list<Types...>,
Variant,
Methods...>::call(
value,
std::forward<Methods>(methods)...);
}
};
template <
typename Type,
typename Variant,
typename ...Methods>
struct match_helper<type_list::list<Type>, Variant, Methods...> {
static decltype(auto) call(Variant &value, Methods &&...methods) {
if (const auto v = get_if<Type>(&value)) {
return match_method(
*v,
std::forward<Methods>(methods)...);
}
Unexpected("Valueless variant in base::match().");
}
};
template <typename ...Types, typename ...Methods>
inline decltype(auto) match(
variant<Types...> &value,
Methods &&...methods) {
return match_helper<
type_list::list<Types...>,
variant<Types...>,
Methods...>::call(value, std::forward<Methods>(methods)...);
}
template <typename Method, typename... Types>
inline auto visit(Method &&method, variant<Types...> &value) {
return value.match(std::forward<Method>(method));
}
template <typename Method, typename... Types>
inline auto visit(Method &&method, variant<Types...> &&value) {
return value.match(std::forward<Method>(method));
template <typename ...Types, typename ...Methods>
inline decltype(auto) match(
const variant<Types...> &value,
Methods &&...methods) {
return match_helper<
type_list::list<Types...>,
const variant<Types...>,
Methods...>::call(value, std::forward<Methods>(methods)...);
}
} // namespace base

View File

@@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#pragma once
#include <atomic>
#include <memory>
namespace base {
namespace details {
@@ -315,24 +316,3 @@ struct guard_traits<
};
} // namespace crl
#ifdef QT_VERSION
template <typename Lambda>
inline void InvokeQueued(const base::has_weak_ptr *context, Lambda &&lambda) {
auto callback = [
guard = base::make_weak(context),
lambda = std::forward<Lambda>(lambda)
] {
if (guard) {
lambda();
}
};
QObject proxy;
QObject::connect(
&proxy,
&QObject::destroyed,
QCoreApplication::instance(),
std::move(callback),
Qt::QueuedConnection);
}
#endif // QT_VERSION

View File

@@ -31,18 +31,18 @@ void AboutBox::prepare() {
addButton(langFactory(lng_close), [this] { closeBox(); });
const auto linkHook = [](const ClickHandlerPtr &link, auto button) {
const auto linkFilter = [](const ClickHandlerPtr &link, auto button) {
if (const auto url = dynamic_cast<UrlClickHandler*>(link.get())) {
url->UrlClickHandler::onClick(button);
url->UrlClickHandler::onClick({ button });
return false;
}
return true;
};
_text3->setRichText(lng_about_text_3(lt_faq_open, qsl("[a href=\"%1\"]").arg(telegramFaqLink()), lt_faq_close, qsl("[/a]")));
_text1->setClickHandlerHook(linkHook);
_text2->setClickHandlerHook(linkHook);
_text3->setClickHandlerHook(linkHook);
_text1->setClickHandlerFilter(linkFilter);
_text2->setClickHandlerFilter(linkFilter);
_text3->setClickHandlerFilter(linkFilter);
_version->setClickedCallback([this] { showVersionHistory(); });

View File

@@ -738,8 +738,7 @@ ProxyData ProxyBox::collectData() {
} else if ((result.type == Type::Http || result.type == Type::Socks5)
&& !result.password.isEmpty() && result.user.isEmpty()) {
_user->showError();
} else if (result.type == Type::Mtproto
&& result.password.size() != 32) {
} else if (result.type == Type::Mtproto && !result.valid()) {
_secret->showError();
} else if (!result) {
_host->showError();
@@ -850,7 +849,7 @@ void ProxyBox::setupMtprotoCredentials(const ProxyData &data) {
st::connectionUserInputField,
langFactory(lng_connection_proxy_secret_ph),
(data.type == Type::Mtproto) ? data.password : QString());
_secret->setMaxLength(32);
_secret->setMaxLength(ProxyData::MaxMtprotoPasswordLength());
_secret->move(0, 0);
_secret->heightValue(
) | rpl::start_with_next([=, wrap = secretWrap.data()](int height) {
@@ -1107,7 +1106,7 @@ void ProxiesBoxController::refreshChecker(Item &item) {
item.checker->connectToServer(
item.data.host,
item.data.port,
MTP::ProtocolSecretFromPassword(item.data.password),
item.data.secretFromMtprotoPassword(),
dcId);
} else {
const auto options = mtproto->dcOptions()->lookup(

View File

@@ -91,7 +91,7 @@ void DownloadPathBox::onEditPath() {
}();
const auto handleFolder = [=](const QString &result) {
if (!result.isEmpty()) {
_path = result + '/';
_path = result.endsWith('/') ? result : (result + '/');
_pathBookmark = psDownloadPathBookmark(_path);
setPathText(QDir::toNativeSeparators(_path));
_group->setValue(Directory::Custom);

View File

@@ -21,6 +21,10 @@ constexpr auto kForeverHours = 24 * 365;
} // namespace
MuteSettingsBox::MuteSettingsBox(QWidget *parent, not_null<PeerData*> peer)
: _peer(peer) {
}
void MuteSettingsBox::prepare() {
setTitle(langFactory(lng_disable_notifications_from_tray));
auto y = 0;
@@ -67,15 +71,25 @@ void MuteSettingsBox::prepare() {
- st::boxOptionListSkip
+ st::defaultCheckbox.margin.bottom();
addButton(langFactory(lng_box_ok), [this, group] {
auto muteForSeconds = group->value() * 3600;
_save = [=] {
const auto muteForSeconds = group->value() * 3600;
Auth().data().updateNotifySettings(
_peer,
muteForSeconds);
closeBox();
});
};
addButton(langFactory(lng_box_ok), _save);
addButton(langFactory(lng_cancel), [this] { closeBox(); });
setDimensions(st::boxWidth, y);
}
void MuteSettingsBox::keyPressEvent(QKeyEvent *e) {
if (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return) {
if (_save) {
_save();
}
}
}
// vi: ts=4 tw=80

View File

@@ -13,17 +13,17 @@ Copyright (C) 2017, Nicholas Guriev <guriev-ns@ya.ru>
* turning off notifications from a chat. The widget is opened by a context menu
* in the left list of dialogues. */
class MuteSettingsBox : public BoxContent {
Q_OBJECT
public:
MuteSettingsBox(QWidget *parent, not_null<PeerData*> peer);
public:
MuteSettingsBox(QWidget *parent, not_null<PeerData*> peer)
: _peer(peer) {
}
protected:
protected:
void prepare() override;
private:
void keyPressEvent(QKeyEvent *e) override;
private:
not_null<PeerData*> _peer;
Fn<void()> _save;
};
// vi: ts=4 tw=80

View File

@@ -54,6 +54,14 @@ PasscodeBox::PasscodeBox(
if (!hint.isEmpty()) _hintText.setText(st::passcodeTextStyle, lng_signin_hint(lt_password_hint, hint));
}
rpl::producer<QByteArray> PasscodeBox::newPasswordSet() const {
return _newPasswordSet.events();
}
rpl::producer<> PasscodeBox::passwordReloadNeeded() const {
return _passwordReloadNeeded.events();
}
void PasscodeBox::prepare() {
addButton(langFactory(_turningOff ? lng_passcode_remove_button : lng_settings_save), [=] { save(); });
addButton(langFactory(lng_cancel), [=] { closeBox(); });
@@ -197,9 +205,9 @@ void PasscodeBox::setInnerFocus() {
}
}
void PasscodeBox::setPasswordDone() {
void PasscodeBox::setPasswordDone(const QByteArray &newPasswordBytes) {
_setRequest = 0;
emit reloadPassword();
_newPasswordSet.fire_copy(newPasswordBytes);
auto text = lang(_reenterPasscode->isHidden() ? lng_cloud_password_removed : (_oldPasscode->isHidden() ? lng_cloud_password_was_set : lng_cloud_password_updated));
getDelegate()->show(Box<InformBox>(text), LayerOption::CloseOther);
}
@@ -236,7 +244,7 @@ bool PasscodeBox::setPasswordFail(const RPCError &error) {
QString err = error.type();
if (err == qstr("PASSWORD_HASH_INVALID")) {
if (_oldPasscode->isHidden()) {
emit reloadPassword();
_passwordReloadNeeded.fire({});
closeBox();
} else {
badOldPasscode();
@@ -247,20 +255,36 @@ bool PasscodeBox::setPasswordFail(const RPCError &error) {
_newError = lang(lng_cloud_password_bad);
update();
} else if (err == qstr("NEW_SALT_INVALID")) {
emit reloadPassword();
_passwordReloadNeeded.fire({});
closeBox();
} else if (err == qstr("EMAIL_INVALID")) {
_emailError = lang(lng_cloud_password_bad_email);
_recoverEmail->setFocus();
_recoverEmail->showError();
update();
} else if (err == qstr("EMAIL_UNCONFIRMED")) {
}
return true;
}
bool PasscodeBox::setPasswordFail(
const QByteArray &newPasswordBytes,
const RPCError &error) {
if (MTP::isFloodError(error)) {
return setPasswordFail(error);
} else if (MTP::isDefaultHandledError(error)) {
return setPasswordFail(error);
} else if (error.type() == qstr("EMAIL_UNCONFIRMED")) {
closeReplacedBy();
_setRequest = 0;
_newPasswordSet.fire_copy(newPasswordBytes);
getDelegate()->show(
Box<InformBox>(lang(lng_cloud_password_almost)),
LayerOption::CloseOther);
emit reloadPassword();
return true;
} else {
return setPasswordFail(error);
}
return true;
}
void PasscodeBox::save(bool force) {
@@ -386,14 +410,15 @@ void PasscodeBox::sendClearCloudPassword(const QString &oldPassword) {
MTPbytes(), // new_secure_secret
MTPlong()) // new_secure_secret_id
)).done([=](const MTPBool &result) {
setPasswordDone();
setPasswordDone({});
}).fail([=](const RPCError &error) {
setPasswordFail(error);
setPasswordFail({}, error);
}).send();
}
void PasscodeBox::setNewCloudPassword(const QString &newPassword) {
const auto newPasswordData = (_newSalt + newPassword.toUtf8() + _newSalt);
const auto newPasswordBytes = newPassword.toUtf8();
const auto newPasswordData = (_newSalt + newPasswordBytes + _newSalt);
auto newPasswordHash = QByteArray(32, Qt::Uninitialized);
hashSha256(newPasswordData.constData(), newPasswordData.size(), newPasswordHash.data());
const auto oldPasswordData = QByteArray();
@@ -416,9 +441,9 @@ void PasscodeBox::setNewCloudPassword(const QString &newPassword) {
MTPbytes(), // new_secure_secret
MTPlong()) // new_secure_secret_id
)).done([=](const MTPBool &result) {
setPasswordDone();
setPasswordDone(newPasswordBytes);
}).fail([=](const RPCError &error) {
setPasswordFail(error);
setPasswordFail(newPasswordBytes, error);
}).send();
}
@@ -443,9 +468,10 @@ void PasscodeBox::changeCloudPassword(
return;
}
const auto secret = Passport::DecryptSecureSecret(
bytes::make_span(data.vsecure_salt.v),
bytes::make_span(data.vsecure_secret.v),
bytes::make_span(passwordUtf));
Passport::CountPasswordHashForSecret(
bytes::make_span(data.vsecure_salt.v),
bytes::make_span(passwordUtf)));
if (secret.empty()) {
LOG(("API Error: Failed to decrypt secure secret."));
suggestSecretReset(oldPasswordHash, newPassword);
@@ -505,8 +531,8 @@ void PasscodeBox::sendChangeCloudPassword(
const QByteArray &oldPasswordHash,
const QString &newPassword,
const QByteArray &secureSecret) {
const auto passwordUtf = newPassword.toUtf8();
const auto newPasswordData = (_newSalt + passwordUtf + _newSalt);
const auto newPasswordBytes = newPassword.toUtf8();
const auto newPasswordData = (_newSalt + newPasswordBytes + _newSalt);
auto newPasswordHash = QByteArray(32, Qt::Uninitialized);
hashSha256(newPasswordData.constData(), newPasswordData.size(), newPasswordHash.data());
const auto hint = _passwordHint->getLastText();
@@ -522,9 +548,10 @@ void PasscodeBox::sendChangeCloudPassword(
newSecureSecretId = Passport::CountSecureSecretId(
bytes::make_span(secureSecret));
newSecureSecret = Passport::EncryptSecureSecret(
bytes::make_span(_newSecureSecretSalt),
bytes::make_span(secureSecret),
bytes::make_span(passwordUtf));
Passport::CountPasswordHashForSecret(
bytes::make_span(_newSecureSecretSalt),
bytes::make_span(newPasswordBytes)));
}
_setRequest = request(MTPaccount_UpdatePasswordSettings(
MTP_bytes(oldPasswordHash),
@@ -538,9 +565,9 @@ void PasscodeBox::sendChangeCloudPassword(
MTP_bytes(newSecureSecret),
MTP_long(newSecureSecretId))
)).done([=](const MTPBool &result) {
setPasswordDone();
setPasswordDone(newPasswordBytes);
}).fail([=](const RPCError &error) {
setPasswordFail(error);
setPasswordFail(newPasswordBytes, error);
}).send();
}
@@ -603,8 +630,17 @@ void PasscodeBox::recover() {
const auto box = getDelegate()->show(Box<RecoverBox>(
_pattern,
_notEmptyPassport));
connect(box, &RecoverBox::reloadPassword, this, &PasscodeBox::reloadPassword);
connect(box, &RecoverBox::recoveryExpired, this, &PasscodeBox::recoverExpired);
box->passwordCleared(
) | rpl::map([] {
return QByteArray();
}) | rpl::start_to_stream(_newPasswordSet, lifetime());
box->recoveryExpired(
) | rpl::start_with_next([=] {
recoverExpired();
}, lifetime());
_replacedBy = box;
}
@@ -630,6 +666,14 @@ RecoverBox::RecoverBox(
, _recoverCode(this, st::defaultInputField, langFactory(lng_signin_code)) {
}
rpl::producer<> RecoverBox::passwordCleared() const {
return _passwordCleared.events();
}
rpl::producer<> RecoverBox::recoveryExpired() const {
return _recoveryExpired.events();
}
void RecoverBox::prepare() {
setTitle(langFactory(lng_signin_recover_title));
@@ -707,10 +751,12 @@ void RecoverBox::codeChanged() {
update();
}
void RecoverBox::codeSubmitDone(bool recover, const MTPauth_Authorization &result) {
void RecoverBox::codeSubmitDone(
bool recover,
const MTPauth_Authorization &result) {
_submitRequest = 0;
emit reloadPassword();
_passwordCleared.fire({});
getDelegate()->show(
Box<InformBox>(lang(lng_cloud_password_removed)),
LayerOption::CloseOther);
@@ -730,7 +776,7 @@ bool RecoverBox::codeSubmitFail(const RPCError &error) {
const QString &err = error.type();
if (err == qstr("PASSWORD_EMPTY")) {
emit reloadPassword();
_passwordCleared.fire({});
getDelegate()->show(
Box<InformBox>(lang(lng_cloud_password_removed)),
LayerOption::CloseOther);
@@ -739,7 +785,7 @@ bool RecoverBox::codeSubmitFail(const RPCError &error) {
closeBox();
return true;
} else if (err == qstr("PASSWORD_RECOVERY_EXPIRED")) {
emit recoveryExpired();
_recoveryExpired.fire({});
closeBox();
return true;
} else if (err == qstr("CODE_INVALID")) {

View File

@@ -17,8 +17,6 @@ class LinkButton;
} // namespace Ui
class PasscodeBox : public BoxContent, private MTP::Sender {
Q_OBJECT
public:
PasscodeBox(QWidget*, bool turningOff);
PasscodeBox(
@@ -31,8 +29,8 @@ public:
const QByteArray &newSecureSecretSalt,
bool turningOff = false);
signals:
void reloadPassword();
rpl::producer<QByteArray> newPasswordSet() const;
rpl::producer<> passwordReloadNeeded() const;
protected:
void prepare() override;
@@ -52,8 +50,11 @@ private:
void recoverByEmail();
void recoverExpired();
void setPasswordDone();
void setPasswordDone(const QByteArray &newPasswordBytes);
bool setPasswordFail(const RPCError &error);
bool setPasswordFail(
const QByteArray &newPasswordBytes,
const RPCError &error);
void recoverStarted(const MTPauth_PasswordRecovery &result);
bool recoverStartFail(const RPCError &error);
@@ -101,17 +102,20 @@ private:
QString _oldError, _newError, _emailError;
rpl::event_stream<QByteArray> _newPasswordSet;
rpl::event_stream<> _passwordReloadNeeded;
};
class RecoverBox : public BoxContent, public RPCSender {
Q_OBJECT
public:
RecoverBox(QWidget*, const QString &pattern, bool notEmptyPassport);
signals:
void reloadPassword();
void recoveryExpired();
rpl::producer<> passwordCleared() const;
rpl::producer<> recoveryExpired() const;
//void reloadPassword();
//void recoveryExpired();
protected:
void prepare() override;
@@ -135,4 +139,7 @@ private:
QString _error;
rpl::event_stream<> _passwordCleared;
rpl::event_stream<> _recoveryExpired;
};

View File

@@ -710,7 +710,7 @@ object_ptr<Ui::RpWidget> Controller::createInviteLinkEdit() {
_controls.inviteLink->setSelectable(true);
_controls.inviteLink->setContextCopyText(QString());
_controls.inviteLink->setBreakEverywhere(true);
_controls.inviteLink->setClickHandlerHook([this](auto&&...) {
_controls.inviteLink->setClickHandlerFilter([=](auto&&...) {
Application::clipboard()->setText(inviteLinkText());
Ui::Toast::Show(lang(lng_group_invite_copied));
return false;

View File

@@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "history/history_media_types.h"
#include "chat_helpers/message_field.h"
#include "core/file_utilities.h"
#include "core/mime_type.h"
#include "ui/widgets/checkbox.h"
#include "ui/widgets/buttons.h"
#include "ui/widgets/input_fields.h"
@@ -801,7 +802,7 @@ void SingleFilePreview::preparePreview(const Storage::PreparedFile &file) {
} else {
auto fileinfo = QFileInfo(filepath);
auto filename = fileinfo.fileName();
_fileIsImage = fileIsImage(filename, mimeTypeForFile(fileinfo).name());
_fileIsImage = fileIsImage(filename, Core::MimeTypeForFile(fileinfo).name());
auto songTitle = QString();
auto songPerformer = QString();

View File

@@ -632,7 +632,7 @@ void Call::handleControllerBarCountChange(
// Expects(controller == _controller.get());
Expects(controller->implData == static_cast<void*>(this));
InvokeQueued(this, [=] {
crl::on_main(this, [=] {
setSignalBarCount(count);
});
}
@@ -763,10 +763,17 @@ void Call::finish(FinishType type, const MTPPhoneCallDiscardReason &reason) {
auto duration = getDurationMs() / 1000;
auto connectionId = _controller ? _controller->GetPreferredRelayID() : 0;
_finishByTimeoutTimer.call(kHangupTimeoutMs, [this, finalState] { setState(finalState); });
request(MTPphone_DiscardCall(MTP_inputPhoneCall(MTP_long(_id), MTP_long(_accessHash)), MTP_int(duration), reason, MTP_long(connectionId))).done([this, finalState](const MTPUpdates &result) {
request(MTPphone_DiscardCall(
MTP_inputPhoneCall(
MTP_long(_id),
MTP_long(_accessHash)),
MTP_int(duration),
reason,
MTP_long(connectionId)
)).done([=](const MTPUpdates &result) {
// This could be destroyed by updates, so we set Ended after
// updates being handled, but in a guarded way.
InvokeQueued(this, [this, finalState] { setState(finalState); });
crl::on_main(this, [=] { setState(finalState); });
App::main()->sentUpdatesReceived(result);
}).fail([this, finalState](const RPCError &error) {
setState(finalState);
@@ -774,13 +781,13 @@ void Call::finish(FinishType type, const MTPPhoneCallDiscardReason &reason) {
}
void Call::setStateQueued(State state) {
InvokeQueued(this, [=] {
crl::on_main(this, [=] {
setState(state);
});
}
void Call::setFailedQueued(int error) {
InvokeQueued(this, [=] {
crl::on_main(this, [=] {
handleControllerError(error);
});
}

View File

@@ -57,7 +57,10 @@ void FieldAutocomplete::paintEvent(QPaintEvent *e) {
p.fillRect(rect(), st::mentionBg);
}
void FieldAutocomplete::showFiltered(PeerData *peer, QString query, bool addInlineBots) {
void FieldAutocomplete::showFiltered(
not_null<PeerData*> peer,
QString query,
bool addInlineBots) {
_chat = peer->asChat();
_user = peer->asUser();
_channel = peer->asChannel();
@@ -105,9 +108,9 @@ void FieldAutocomplete::showStickers(EmojiPtr emoji) {
return;
}
_chat = 0;
_user = 0;
_channel = 0;
_chat = nullptr;
_user = nullptr;
_channel = nullptr;
updateFiltered(resetScroll);
}

View File

@@ -32,7 +32,10 @@ public:
FieldAutocomplete(QWidget *parent);
bool clearFilteredBotCommands();
void showFiltered(PeerData *peer, QString query, bool addInlineBots);
void showFiltered(
not_null<PeerData*> peer,
QString query,
bool addInlineBots);
void showStickers(EmojiPtr emoji);
void setBoundings(QRect boundings);

View File

@@ -860,7 +860,14 @@ void GifsListWidget::sendInlineRequest() {
}
_footer->setLoading(true);
_inlineRequestId = request(MTPmessages_GetInlineBotResults(MTP_flags(0), _searchBot->inputUser, _inlineQueryPeer->input, MTPInputGeoPoint(), MTP_string(_inlineQuery), MTP_string(nextOffset))).done([this](const MTPmessages_BotResults &result, mtpRequestId requestId) {
_inlineRequestId = request(MTPmessages_GetInlineBotResults(
MTP_flags(0),
_searchBot->inputUser,
_inlineQueryPeer->input,
MTPInputGeoPoint(),
MTP_string(_inlineQuery),
MTP_string(nextOffset)
)).done([this](const MTPmessages_BotResults &result) {
inlineResultsDone(result);
}).fail([this](const RPCError &error) {
// show error?

View File

@@ -609,19 +609,21 @@ void MessageLinksParser::parse() {
const auto markdownTagsEnd = markdownTags.end();
const auto markdownTagsAllow = [&](int from, int length) {
while (markdownTag != markdownTagsEnd
&& (markdownTag->start + markdownTag->length <= from
&& (markdownTag->adjustedStart
+ markdownTag->adjustedLength <= from
|| !markdownTag->closed)) {
++markdownTag;
continue;
}
if (markdownTag == markdownTagsEnd
|| markdownTag->start >= from + length) {
|| markdownTag->adjustedStart >= from + length) {
return true;
}
// Ignore http-links that are completely inside some tags.
// This will allow sending http://test.com/__test__/test correctly.
return (markdownTag->start > from
|| markdownTag->start + markdownTag->length < from + length);
return (markdownTag->adjustedStart > from)
|| (markdownTag->adjustedStart
+ markdownTag->adjustedLength < from + length);
};
const auto len = text.size();

View File

@@ -1011,39 +1011,4 @@ RecentStickerPack &GetRecentPack() {
return cRefRecentStickers();
}
void IncrementRecentHashtag(RecentHashtagPack &recent, const QString &tag) {
auto i = recent.begin(), e = recent.end();
for (; i != e; ++i) {
if (i->first == tag) {
++i->second;
if (qAbs(i->second) > 0x4000) {
for (auto j = recent.begin(); j != e; ++j) {
if (j->second > 1) {
j->second /= 2;
} else if (j->second > 0) {
j->second = 1;
}
}
}
for (; i != recent.begin(); --i) {
if (qAbs((i - 1)->second) > qAbs(i->second)) {
break;
}
qSwap(*i, *(i - 1));
}
break;
}
}
if (i == e) {
while (recent.size() >= 64) recent.pop_back();
recent.push_back(qMakePair(tag, 1));
for (i = recent.end() - 1; i != recent.begin(); --i) {
if ((i - 1)->second > i->second) {
break;
}
qSwap(*i, *(i - 1));
}
}
}
} // namespace Stickers

View File

@@ -99,6 +99,4 @@ QString GetSetTitle(const MTPDstickerSet &s);
RecentStickerPack &GetRecentPack();
void IncrementRecentHashtag(RecentHashtagPack &recent, const QString &tag);
} // namespace Stickers

View File

@@ -55,7 +55,7 @@ addChildParentFlags('MTPDchannelForbidden', 'MTPDchannel');
parentFlagsCheck = {};
countedTypeIdExceptions = {};
for i in range(77, 82):
for i in range(77, 83):
countedTypeIdExceptions[i] = {}
countedTypeIdExceptions[i]['channel'] = True
countedTypeIdExceptions['ipPortSecret'] = True
@@ -84,6 +84,7 @@ factories = '';
flagOperators = '';
methods = '';
inlineMethods = '';
visitorMethods = '';
textSerializeInit = '';
textSerializeMethods = '';
forwards = '';
@@ -461,7 +462,7 @@ def addTextSerialize(lst, dct, dataLetter):
templateArgument = ''
if (isTemplate != ''):
templateArgument = '<mtpRequest>'
templateArgument = '<MTP::SecureRequest>'
result += 'void Serialize_' + name + '(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, uint32 iflag) {\n';
if (len(conditions)):
@@ -577,6 +578,7 @@ for restype in typesList:
switchLines = '';
friendDecl = '';
getters = '';
visitor = '';
reader = '';
writer = '';
sizeList = [];
@@ -594,9 +596,14 @@ for restype in typesList:
trivialConditions = data[7];
dataText = '';
dataText += '\nclass MTPD' + name + ' : public MTP::internal::TypeData {\n'; # data class
if (len(prms) > len(trivialConditions)):
withData = 1;
dataText += '\nclass MTPD' + name + ' : public MTP::internal::TypeData {\n'; # data class
else:
dataText += '\nclass MTPD' + name + ' {\n'; # empty data class for visitors
dataText += 'public:\n';
dataText += '\ttemplate <typename Other>\n';
dataText += '\tstatic constexpr bool Is() { return std::is_same_v<std::decay_t<Other>, MTPD' + name + '>; };\n\n';
sizeList = [];
creatorParams = [];
creatorParamsList = [];
@@ -626,16 +633,18 @@ for restype in typesList:
dataText += '\tbool has_' + paramName + '() const { return v' + hasFlags + '.v & Flag::f_' + paramName + '; }\n';
dataText += '\n';
dataText += '\tMTPD' + name + '() = default;\n'; # default constructor
switchLines += '\t\tcase mtpc_' + name + ': '; # for by-type-id type constructor
if (len(prms) > len(trivialConditions)):
switchLines += 'setData(new MTPD' + name + '()); ';
withData = 1;
switchLines += '\tcase mtpc_' + name + ': '; # for by-type-id type constructor
getters += '\tconst MTPD' + name + ' &c_' + name + '() const;\n'; # const getter
visitor += '\tcase mtpc_' + name + ': return base::match_method(c_' + name + '(), std::forward<Method>(method), std::forward<Methods>(methods)...);\n';
forwards += 'class MTPD' + name + ';\n'; # data class forward declaration
if (len(prms) > len(trivialConditions)):
dataText += '\tMTPD' + name + '() = default;\n'; # default constructor
switchLines += 'setData(new MTPD' + name + '()); ';
getters += '\tconst MTPD' + name + ' &c_' + name + '() const;\n'; # const getter
constructsBodies += 'const MTPD' + name + ' &MTP' + restype + '::c_' + name + '() const {\n';
if (withType):
constructsBodies += '\tAssert(_type == mtpc_' + name + ');\n';
constructsBodies += '\tExpects(_type == mtpc_' + name + ');\n\n';
constructsBodies += '\treturn queryData<MTPD' + name + '>();\n';
constructsBodies += '}\n';
@@ -662,8 +671,8 @@ for restype in typesList:
creatorParamsList.append('_' + paramName);
prmsInit.append('v' + paramName + '(_' + paramName + ')');
if (withType):
readText += '\t\t';
writeText += '\t\t';
readText += '\t';
writeText += '\t';
if (paramName in conditions):
readText += '\tif (v->has_' + paramName + '()) { v->v' + paramName + '.read(from, end); } else { v->v' + paramName + ' = MTP' + paramType + '(); }\n';
writeText += '\tif (v.has_' + paramName + '()) v.v' + paramName + '.write(to);\n';
@@ -673,8 +682,6 @@ for restype in typesList:
writeText += '\tv.v' + paramName + '.write(to);\n';
sizeList.append('v.v' + paramName + '.innerLength()');
forwards += 'class MTPD' + name + ';\n'; # data class forward declaration
dataText += ', '.join(prmsStr) + ');\n';
constructsBodies += 'MTPD' + name + '::MTPD' + name + '(' + ', '.join(prmsStr) + ') : ' + ', '.join(prmsInit) + ' {\n}\n';
@@ -685,20 +692,26 @@ for restype in typesList:
continue;
paramType = prms[paramName];
dataText += '\tMTP' + paramType + ' v' + paramName + ';\n';
sizeCases += '\t\tcase mtpc_' + name + ': {\n';
sizeCases += '\t\t\tconst MTPD' + name + ' &v(c_' + name + '());\n';
sizeCases += '\t\t\treturn ' + ' + '.join(sizeList) + ';\n';
sizeCases += '\t\t}\n';
sizeCases += '\tcase mtpc_' + name + ': {\n';
sizeCases += '\t\tconst MTPD' + name + ' &v(c_' + name + '());\n';
sizeCases += '\t\treturn ' + ' + '.join(sizeList) + ';\n';
sizeCases += '\t}\n';
sizeFast = '\tconst MTPD' + name + ' &v(c_' + name + '());\n\treturn ' + ' + '.join(sizeList) + ';\n';
newFast = 'new MTPD' + name + '()';
else:
constructsBodies += 'const MTPD' + name + ' &MTP' + restype + '::c_' + name + '() const {\n';
if (withType):
constructsBodies += '\tExpects(_type == mtpc_' + name + ');\n\n';
constructsBodies += '\tstatic const MTPD' + name + ' result;\n';
constructsBodies += '\treturn result;\n';
constructsBodies += '}\n';
sizeFast = '\treturn 0;\n';
switchLines += 'break;\n';
dataText += '};\n'; # class ending
if (len(prms) > len(trivialConditions)):
dataTexts += dataText; # add data class
dataTexts += dataText; # add data class
if (not friendDecl):
friendDecl += '\tfriend class MTP::internal::TypeCreator;\n';
@@ -717,18 +730,18 @@ for restype in typesList:
creatorsBodies += '}\n';
if (withType):
reader += '\t\tcase mtpc_' + name + ': _type = cons; '; # read switch line
reader += '\tcase mtpc_' + name + ': _type = cons; '; # read switch line
if (len(prms) > len(trivialConditions)):
reader += '{\n';
reader += '\t\t\tauto v = new MTPD' + name + '();\n';
reader += '\t\t\tsetData(v);\n';
reader += '\t\tauto v = new MTPD' + name + '();\n';
reader += '\t\tsetData(v);\n';
reader += readText;
reader += '\t\t} break;\n';
reader += '\t} break;\n';
writer += '\t\tcase mtpc_' + name + ': {\n'; # write switch line
writer += '\t\t\tauto &v = c_' + name + '();\n';
writer += '\tcase mtpc_' + name + ': {\n'; # write switch line
writer += '\t\tauto &v = c_' + name + '();\n';
writer += writeText;
writer += '\t\t} break;\n';
writer += '\t} break;\n';
else:
reader += 'break;\n';
else:
@@ -737,7 +750,7 @@ for restype in typesList:
reader += '\tsetData(v);\n';
reader += readText;
writer += '\tauto &v = c_' + name + '();\n';
writer += '\tconst auto &v = c_' + name + '();\n';
writer += writeText;
forwards += '\n';
@@ -754,8 +767,20 @@ for restype in typesList:
else:
typesText += ' = default;\n';
if (withData):
typesText += getters;
typesText += getters;
typesText += '\n';
typesText += '\ttemplate <typename Method, typename ...Methods>\n';
typesText += '\tdecltype(auto) match(Method &&method, Methods &&...methods) const;\n';
visitorMethods += 'template <typename Method, typename ...Methods>\n';
visitorMethods += 'decltype(auto) MTP' + restype + '::match(Method &&method, Methods &&...methods) const {\n';
if (withType):
visitorMethods += '\tswitch (_type) {\n';
visitorMethods += visitor;
visitorMethods += '\t}\n';
visitorMethods += '\tUnexpected("Type in MTP' + restype + '::match.");\n';
else:
visitorMethods += '\treturn base::match_method(c_' + v[0][0] + '(), std::forward<Method>(method), std::forward<Methods>(methods)...);\n';
visitorMethods += '}\n\n';
typesText += '\n\tuint32 innerLength() const;\n'; # size method
methods += '\nuint32 MTP' + restype + '::innerLength() const {\n';
@@ -771,7 +796,7 @@ for restype in typesList:
typesText += '\tmtpTypeId type() const;\n'; # type id method
methods += 'mtpTypeId MTP' + restype + '::type() const {\n';
if (withType):
methods += '\tAssert(_type != 0);\n';
methods += '\tExpects(_type != 0);\n\n';
methods += '\treturn _type;\n';
else:
methods += '\treturn mtpc_' + v[0][0] + ';\n';
@@ -788,7 +813,7 @@ for restype in typesList:
if (withType):
methods += '\tswitch (cons) {\n'
methods += reader;
methods += '\t\tdefault: throw mtpErrorUnexpected(cons, "MTP' + restype + '");\n';
methods += '\tdefault: throw mtpErrorUnexpected(cons, "MTP' + restype + '");\n';
methods += '\t}\n';
else:
methods += reader;
@@ -814,12 +839,12 @@ for restype in typesList:
methods += ' {\n';
methods += '\tswitch (type) {\n'; # type id check
methods += switchLines;
methods += '\t\tdefault: throw mtpErrorBadTypeId(type, "MTP' + restype + '");\n\t}\n';
methods += '\tdefault: throw mtpErrorBadTypeId(type, "MTP' + restype + '");\n\t}\n';
methods += '}\n'; # by-type-id constructor end
if (withData):
typesText += constructsText;
methods += constructsBodies;
methods += constructsBodies;
if (friendDecl):
typesText += '\n' + friendDecl;
@@ -953,6 +978,8 @@ enum {\n\
' + funcsText + '\n\
// Template methods definition\n\
' + inlineMethods + '\n\
// Visitor definition\n\
' + visitorMethods + '\n\
// Flag operators definition\n\
' + flagOperators + '\n\
// Factory methods declaration\n\

View File

@@ -26,8 +26,6 @@ enum {
MTPKillFileSessionTimeout = 5000, // how much time without upload / download causes additional session kill
MTPDebugBufferSize = 1024 * 1024, // 1 mb start size
MaxUsersPerInvite = 100, // max users in one super group invite request
MTPChannelGetDifferenceLimit = 100,
@@ -82,9 +80,6 @@ enum {
MaxMessageSize = 4096,
WriteMapTimeout = 1000,
SaveDraftTimeout = 1000, // save draft after 1 secs of not changing text
SaveDraftAnywayTimeout = 5000, // or save anyway each 5 secs
SaveCloudDraftIdleTimeout = 14000, // save draft to the cloud after 14 more seconds
SetOnlineAfterActivity = 30, // user with hidden last seen stays online for such amount of seconds in the interface

View File

@@ -12,8 +12,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <memory>
#include <ctime>
#include <functional>
#include <gsl/gsl>
#include <crl/crl.h>
#include "base/build_config.h"
#include "base/ordered_set.h"
#include "base/unique_function.h"
@@ -39,5 +39,8 @@ using uint64 = quint64;
using float32 = float;
using float64 = double;
using TimeMs = int64;
using TimeId = int32;
#define qsl(s) QStringLiteral(s)
#define qstr(s) QLatin1String((s), sizeof(s) - 1)

View File

@@ -10,6 +10,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
class ClickHandler;
using ClickHandlerPtr = std::shared_ptr<ClickHandler>;
struct ClickContext {
Qt::MouseButton button = Qt::LeftButton;
QVariant other;
};
enum ExpandLinksMode {
ExpandLinksNone,
ExpandLinksShortened,
@@ -35,7 +40,7 @@ public:
virtual ~ClickHandler() {
}
virtual void onClick(Qt::MouseButton) const = 0;
virtual void onClick(ClickContext context) const = 0;
// What text to show in a tooltip when mouse is over that click handler as a link in Text.
virtual QString tooltip() const {
@@ -159,9 +164,10 @@ private:
class LeftButtonClickHandler : public ClickHandler {
public:
void onClick(Qt::MouseButton button) const override final {
if (button != Qt::LeftButton) return;
onClickImpl();
void onClick(ClickContext context) const override final {
if (context.button == Qt::LeftButton) {
onClickImpl();
}
}
protected:
@@ -173,8 +179,8 @@ class LambdaClickHandler : public ClickHandler {
public:
LambdaClickHandler(Fn<void()> handler) : _handler(std::move(handler)) {
}
void onClick(Qt::MouseButton button) const override final {
if (button == Qt::LeftButton && _handler) {
void onClick(ClickContext context) const override final {
if (context.button == Qt::LeftButton && _handler) {
_handler();
}
}

View File

@@ -103,7 +103,7 @@ QString UrlClickHandler::url() const {
return result;
}
void UrlClickHandler::doOpen(QString url) {
void UrlClickHandler::Open(QString url, QVariant context) {
Ui::Tooltip::Hide();
if (isEmail(url)) {
@@ -114,7 +114,7 @@ void UrlClickHandler::doOpen(QString url) {
url = tryConvertUrlToLocal(url);
if (url.startsWith(qstr("tg://"), Qt::CaseInsensitive)) {
Messenger::Instance().openLocalUrl(url);
Messenger::Instance().openLocalUrl(url, context);
} else {
QDesktopServices::openUrl(url);
}
@@ -140,38 +140,52 @@ TextWithEntities UrlClickHandler::getExpandedLinkTextWithEntities(ExpandLinksMod
return result;
}
void HiddenUrlClickHandler::doOpen(QString url) {
void HiddenUrlClickHandler::Open(QString url, QVariant context) {
auto urlText = tryConvertUrlToLocal(url);
if (urlText.startsWith(qstr("tg://"), Qt::CaseInsensitive)) {
Messenger::Instance().openLocalUrl(urlText);
Messenger::Instance().openLocalUrl(urlText, context);
} else {
const auto open = [=] {
UrlClickHandler::Open(urlText, context);
};
auto parsedUrl = QUrl::fromUserInput(urlText);
if (UrlRequiresConfirmation(urlText)) {
auto displayUrl = parsedUrl.isValid() ? parsedUrl.toDisplayString() : urlText;
Ui::show(Box<ConfirmBox>(lang(lng_open_this_link) + qsl("\n\n") + displayUrl, lang(lng_open_link), [urlText] {
Ui::hideLayer();
UrlClickHandler::doOpen(urlText);
}), LayerOption::KeepOther);
auto displayUrl = parsedUrl.isValid()
? parsedUrl.toDisplayString()
: urlText;
Ui::show(
Box<ConfirmBox>(
lang(lng_open_this_link) + qsl("\n\n") + displayUrl,
lang(lng_open_link),
[=] { Ui::hideLayer(); open(); }),
LayerOption::KeepOther);
} else {
UrlClickHandler::doOpen(urlText);
open();
}
}
}
void BotGameUrlClickHandler::onClick(Qt::MouseButton button) const {
void BotGameUrlClickHandler::onClick(ClickContext context) const {
auto urlText = tryConvertUrlToLocal(url());
const auto open = [=] {
UrlClickHandler::Open(urlText, context.other);
};
if (urlText.startsWith(qstr("tg://"), Qt::CaseInsensitive)) {
Messenger::Instance().openLocalUrl(urlText);
Messenger::Instance().openLocalUrl(urlText, context.other);
} else if (!_bot || _bot->isVerified() || Local::isBotTrusted(_bot)) {
doOpen(urlText);
open();
} else {
Ui::show(Box<ConfirmBox>(lng_allow_bot_pass(lt_bot_name, _bot->name), lang(lng_allow_bot), [bot = _bot, urlText] {
const auto callback = [=, bot = _bot] {
Ui::hideLayer();
Local::makeBotTrusted(bot);
UrlClickHandler::doOpen(urlText);
}));
open();
};
Ui::show(Box<ConfirmBox>(
lng_allow_bot_pass(lt_bot_name, _bot->name),
lang(lng_allow_bot),
callback));
}
}
@@ -203,7 +217,8 @@ QString MentionClickHandler::copyToClipboardContextItemText() const {
return lang(lng_context_copy_mention);
}
void MentionClickHandler::onClick(Qt::MouseButton button) const {
void MentionClickHandler::onClick(ClickContext context) const {
const auto button = context.button;
if (button == Qt::LeftButton || button == Qt::MiddleButton) {
App::openPeerByName(_tag.mid(1), ShowAtProfileMsgId);
}
@@ -213,7 +228,8 @@ TextWithEntities MentionClickHandler::getExpandedLinkTextWithEntities(ExpandLink
return simpleTextWithEntity({ EntityInTextMention, entityOffset, textPart.size() });
}
void MentionNameClickHandler::onClick(Qt::MouseButton button) const {
void MentionNameClickHandler::onClick(ClickContext context) const {
const auto button = context.button;
if (button == Qt::LeftButton || button == Qt::MiddleButton) {
if (auto user = App::userLoaded(_userId)) {
Ui::showPeerProfile(user);
@@ -240,7 +256,8 @@ QString HashtagClickHandler::copyToClipboardContextItemText() const {
return lang(lng_context_copy_hashtag);
}
void HashtagClickHandler::onClick(Qt::MouseButton button) const {
void HashtagClickHandler::onClick(ClickContext context) const {
const auto button = context.button;
if (button == Qt::LeftButton || button == Qt::MiddleButton) {
App::searchByHashtag(_tag, Ui::getPeerForMouseAction());
}
@@ -254,7 +271,8 @@ QString CashtagClickHandler::copyToClipboardContextItemText() const {
return lang(lng_context_copy_hashtag);
}
void CashtagClickHandler::onClick(Qt::MouseButton button) const {
void CashtagClickHandler::onClick(ClickContext context) const {
const auto button = context.button;
if (button == Qt::LeftButton || button == Qt::MiddleButton) {
App::searchByHashtag(_tag, Ui::getPeerForMouseAction());
}
@@ -269,7 +287,8 @@ TextWithEntities CashtagClickHandler::getExpandedLinkTextWithEntities(
PeerData *BotCommandClickHandler::_peer = nullptr;
UserData *BotCommandClickHandler::_bot = nullptr;
void BotCommandClickHandler::onClick(Qt::MouseButton button) const {
void BotCommandClickHandler::onClick(ClickContext context) const {
const auto button = context.button;
if (button == Qt::LeftButton || button == Qt::MiddleButton) {
if (auto peer = peerForCommand()) {
if (auto bot = peer->isUser() ? peer->asUser() : botForCommand()) {

View File

@@ -11,7 +11,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
class TextClickHandler : public ClickHandler {
public:
TextClickHandler(bool fullDisplayed = true)
: _fullDisplayed(fullDisplayed) {
}
@@ -56,10 +55,11 @@ public:
int entityOffset,
const QStringRef &textPart) const override;
static void doOpen(QString url);
void onClick(Qt::MouseButton button) const override {
static void Open(QString url, QVariant context = {});
void onClick(ClickContext context) const override {
const auto button = context.button;
if (button == Qt::LeftButton || button == Qt::MiddleButton) {
doOpen(url());
Open(url(), context.other);
}
}
@@ -87,15 +87,16 @@ public:
HiddenUrlClickHandler(QString url) : UrlClickHandler(url, false) {
}
QString copyToClipboardContextItemText() const override {
return url().isEmpty()
return (url().isEmpty() || url().startsWith(qstr("internal:")))
? QString()
: UrlClickHandler::copyToClipboardContextItemText();
}
static void doOpen(QString url);
void onClick(Qt::MouseButton button) const override {
static void Open(QString url, QVariant context = {});
void onClick(ClickContext context) const override {
const auto button = context.button;
if (button == Qt::LeftButton || button == Qt::MiddleButton) {
doOpen(url());
Open(url(), context.other);
}
}
@@ -115,7 +116,7 @@ public:
: UrlClickHandler(url, false)
, _bot(bot) {
}
void onClick(Qt::MouseButton button) const override;
void onClick(ClickContext context) const override;
private:
UserData *_bot;
@@ -127,7 +128,7 @@ public:
MentionClickHandler(const QString &tag) : _tag(tag) {
}
void onClick(Qt::MouseButton button) const override;
void onClick(ClickContext context) const override;
QString dragText() const override {
return _tag;
@@ -158,7 +159,7 @@ public:
, _accessHash(accessHash) {
}
void onClick(Qt::MouseButton button) const override;
void onClick(ClickContext context) const override;
TextWithEntities getExpandedLinkTextWithEntities(
ExpandLinksMode mode,
@@ -179,7 +180,7 @@ public:
HashtagClickHandler(const QString &tag) : _tag(tag) {
}
void onClick(Qt::MouseButton button) const override;
void onClick(ClickContext context) const override;
QString dragText() const override {
return _tag;
@@ -207,7 +208,7 @@ public:
CashtagClickHandler(const QString &tag) : _tag(tag) {
}
void onClick(Qt::MouseButton button) const override;
void onClick(ClickContext context) const override;
QString dragText() const override {
return _tag;
@@ -237,7 +238,7 @@ public:
BotCommandClickHandler(const QString &cmd) : _cmd(cmd) {
}
void onClick(Qt::MouseButton button) const override;
void onClick(ClickContext context) const override;
QString dragText() const override {
return _cmd;

View File

@@ -194,6 +194,11 @@ void NotStartedWindow::resizeEvent(QResizeEvent *e) {
_close.setGeometry(width() - padding - _close.width(), height() - padding - _close.height(), _close.width(), _close.height());
}
LastCrashedWindow::UpdaterData::UpdaterData(QWidget *buttonParent)
: check(buttonParent)
, skip(buttonParent, false) {
}
LastCrashedWindow::LastCrashedWindow()
: _port(80)
, _label(this)
@@ -218,11 +223,9 @@ LastCrashedWindow::LastCrashedWindow()
, _sendingTotal(0)
, _checkReply(0)
, _sendReply(0)
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
, _updatingCheck(this)
, _updatingSkip(this, false)
#endif // !TDESKTOP_DISABLE_AUTOUPDATE
{
, _updaterData(Core::UpdaterDisabled()
? nullptr
: std::make_unique<UpdaterData>(this)) {
excludeReportUsername();
if (!cAlphaVersion() && !cBetaVersion()) { // currently accept crash reports only from testers
@@ -293,49 +296,49 @@ LastCrashedWindow::LastCrashedWindow()
_label.setText(qsl("Last time Telegram Desktop crashed :("));
}
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
_updatingCheck.setText(qsl("TRY AGAIN"));
connect(&_updatingCheck, SIGNAL(clicked()), this, SLOT(onUpdateRetry()));
_updatingSkip.setText(qsl("SKIP"));
connect(&_updatingSkip, SIGNAL(clicked()), this, SLOT(onUpdateSkip()));
if (_updaterData) {
_updaterData->check.setText(qsl("TRY AGAIN"));
connect(&_updaterData->check, SIGNAL(clicked()), this, SLOT(onUpdateRetry()));
_updaterData->skip.setText(qsl("SKIP"));
connect(&_updaterData->skip, SIGNAL(clicked()), this, SLOT(onUpdateSkip()));
Core::UpdateChecker checker;
using Progress = Core::UpdateChecker::Progress;
checker.checking(
) | rpl::start_with_next([=] { onUpdateChecking(); }, _lifetime);
checker.isLatest(
) | rpl::start_with_next([=] { onUpdateLatest(); }, _lifetime);
checker.progress(
) | rpl::start_with_next([=](const Progress &result) {
onUpdateDownloading(result.already, result.size);
}, _lifetime);
checker.failed(
) | rpl::start_with_next([=] { onUpdateFailed(); }, _lifetime);
checker.ready(
) | rpl::start_with_next([=] { onUpdateReady(); }, _lifetime);
Core::UpdateChecker checker;
using Progress = Core::UpdateChecker::Progress;
checker.checking(
) | rpl::start_with_next([=] { onUpdateChecking(); }, _lifetime);
checker.isLatest(
) | rpl::start_with_next([=] { onUpdateLatest(); }, _lifetime);
checker.progress(
) | rpl::start_with_next([=](const Progress &result) {
onUpdateDownloading(result.already, result.size);
}, _lifetime);
checker.failed(
) | rpl::start_with_next([=] { onUpdateFailed(); }, _lifetime);
checker.ready(
) | rpl::start_with_next([=] { onUpdateReady(); }, _lifetime);
switch (checker.state()) {
case Core::UpdateChecker::State::Download:
setUpdatingState(UpdatingDownload, true);
setDownloadProgress(checker.already(), checker.size());
break;
case Core::UpdateChecker::State::Ready:
setUpdatingState(UpdatingReady, true);
break;
default:
setUpdatingState(UpdatingCheck, true);
break;
switch (checker.state()) {
case Core::UpdateChecker::State::Download:
setUpdatingState(UpdatingDownload, true);
setDownloadProgress(checker.already(), checker.size());
break;
case Core::UpdateChecker::State::Ready:
setUpdatingState(UpdatingReady, true);
break;
default:
setUpdatingState(UpdatingCheck, true);
break;
}
cSetLastUpdateCheck(0);
checker.start();
} else {
_updating.setText(qsl("Please check if there is a new version available."));
if (_sendingState != SendingNoReport) {
_sendingState = SendingNone;
}
}
cSetLastUpdateCheck(0);
checker.start();
#else // !TDESKTOP_DISABLE_AUTOUPDATE
_updating.setText(qsl("Please check if there is a new version available."));
if (_sendingState != SendingNoReport) {
_sendingState = SendingNone;
}
#endif // else for !TDESKTOP_DISABLE_AUTOUPDATE
_pleaseSendReport.setText(qsl("Please send us a crash report."));
_yourReportName.setText(qsl("Your Report Tag: %1\nYour User Tag: %2").arg(QString(_minidumpName).replace(".dmp", "")).arg(Sandbox::UserTag(), 0, 16));
_yourReportName.setCursor(style::cur_text);
@@ -552,69 +555,41 @@ void LastCrashedWindow::updateControls() {
int padding = _size, h = padding + _networkSettings.height() + padding;
_label.show();
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
h += _networkSettings.height() + padding;
if (_updatingState == UpdatingFail && (_sendingState == SendingNoReport || _sendingState == SendingUpdateCheck)) {
_networkSettings.show();
_updatingCheck.show();
_updatingSkip.show();
_send.hide();
_sendSkip.hide();
_continue.hide();
_pleaseSendReport.hide();
_yourReportName.hide();
_includeUsername.hide();
_getApp.hide();
_showReport.hide();
_report.hide();
_minidump.hide();
_saveReport.hide();
h += padding + _updatingCheck.height() + padding;
} else {
if (_updatingState == UpdatingCheck || _sendingState == SendingFail || _sendingState == SendingProgress) {
if (_updaterData) {
h += _networkSettings.height() + padding;
if (_updaterData->state == UpdatingFail && (_sendingState == SendingNoReport || _sendingState == SendingUpdateCheck)) {
_networkSettings.show();
_updaterData->check.show();
_updaterData->skip.show();
_send.hide();
_sendSkip.hide();
_continue.hide();
_pleaseSendReport.hide();
_yourReportName.hide();
_includeUsername.hide();
_getApp.hide();
_showReport.hide();
_report.hide();
_minidump.hide();
_saveReport.hide();
h += padding + _updaterData->check.height() + padding;
} else {
_networkSettings.hide();
}
if (_updatingState == UpdatingNone || _updatingState == UpdatingLatest || _updatingState == UpdatingFail) {
h += padding + _updatingCheck.height() + padding;
if (_sendingState == SendingNoReport) {
_pleaseSendReport.hide();
_yourReportName.hide();
_includeUsername.hide();
_getApp.hide();
_showReport.hide();
_report.hide();
_minidump.hide();
_saveReport.hide();
_send.hide();
_sendSkip.hide();
_continue.show();
if (_updaterData->state == UpdatingCheck
|| _sendingState == SendingFail
|| _sendingState == SendingProgress) {
_networkSettings.show();
} else {
h += _showReport.height() + padding + _yourReportName.height() + padding;
_pleaseSendReport.show();
_yourReportName.show();
if (_reportUsername.isEmpty()) {
_networkSettings.hide();
}
if (_updaterData->state == UpdatingNone
|| _updaterData->state == UpdatingLatest
|| _updaterData->state == UpdatingFail) {
h += padding + _updaterData->check.height() + padding;
if (_sendingState == SendingNoReport) {
_pleaseSendReport.hide();
_yourReportName.hide();
_includeUsername.hide();
} else {
h += _includeUsername.height() + padding;
_includeUsername.show();
}
if (_sendingState == SendingTooOld || _sendingState == SendingUnofficial) {
QString verStr = getReportField(qstr("version"), qstr("Version:"));
qint64 ver = verStr.isEmpty() ? 0 : verStr.toLongLong();
if (!ver || (ver == AppVersion) || (ver < 0 && (-ver / 1000) == AppVersion)) {
h += _getApp.height() + padding;
_getApp.show();
h -= _yourReportName.height() + padding; // hide report name
_yourReportName.hide();
if (!_reportUsername.isEmpty()) {
h -= _includeUsername.height() + padding;
_includeUsername.hide();
}
} else {
_getApp.hide();
}
_getApp.hide();
_showReport.hide();
_report.hide();
_minidump.hide();
@@ -623,48 +598,104 @@ void LastCrashedWindow::updateControls() {
_sendSkip.hide();
_continue.show();
} else {
_getApp.hide();
if (_reportShown) {
h += (_pleaseSendReport.height() * 12.5) + padding + (_minidumpName.isEmpty() ? 0 : (_minidump.height() + padding));
_report.show();
if (_minidumpName.isEmpty()) {
_minidump.hide();
h += _showReport.height() + padding + _yourReportName.height() + padding;
_pleaseSendReport.show();
_yourReportName.show();
if (_reportUsername.isEmpty()) {
_includeUsername.hide();
} else {
h += _includeUsername.height() + padding;
_includeUsername.show();
}
if (_sendingState == SendingTooOld || _sendingState == SendingUnofficial) {
QString verStr = getReportField(qstr("version"), qstr("Version:"));
qint64 ver = verStr.isEmpty() ? 0 : verStr.toLongLong();
if (!ver || (ver == AppVersion) || (ver < 0 && (-ver / 1000) == AppVersion)) {
h += _getApp.height() + padding;
_getApp.show();
h -= _yourReportName.height() + padding; // hide report name
_yourReportName.hide();
if (!_reportUsername.isEmpty()) {
h -= _includeUsername.height() + padding;
_includeUsername.hide();
}
} else {
_minidump.show();
}
if (_reportSaved || _sendingState == SendingFail || _sendingState == SendingProgress || _sendingState == SendingUploading) {
_saveReport.hide();
} else {
_saveReport.show();
_getApp.hide();
}
_showReport.hide();
} else {
_report.hide();
_minidump.hide();
_saveReport.hide();
if (_sendingState == SendingFail || _sendingState == SendingProgress || _sendingState == SendingUploading) {
_showReport.hide();
} else {
_showReport.show();
}
}
if (_sendingState == SendingTooMany || _sendingState == SendingDone) {
_send.hide();
_sendSkip.hide();
_continue.show();
} else {
if (_sendingState == SendingProgress || _sendingState == SendingUploading) {
_send.hide();
_getApp.hide();
if (_reportShown) {
h += (_pleaseSendReport.height() * 12.5) + padding + (_minidumpName.isEmpty() ? 0 : (_minidump.height() + padding));
_report.show();
if (_minidumpName.isEmpty()) {
_minidump.hide();
} else {
_minidump.show();
}
if (_reportSaved || _sendingState == SendingFail || _sendingState == SendingProgress || _sendingState == SendingUploading) {
_saveReport.hide();
} else {
_saveReport.show();
}
_showReport.hide();
} else {
_send.show();
_report.hide();
_minidump.hide();
_saveReport.hide();
if (_sendingState == SendingFail || _sendingState == SendingProgress || _sendingState == SendingUploading) {
_showReport.hide();
} else {
_showReport.show();
}
}
if (_sendingState == SendingTooMany || _sendingState == SendingDone) {
_send.hide();
_sendSkip.hide();
_continue.show();
} else {
if (_sendingState == SendingProgress || _sendingState == SendingUploading) {
_send.hide();
} else {
_send.show();
}
_sendSkip.show();
_continue.hide();
}
_sendSkip.show();
_continue.hide();
}
}
} else {
_getApp.hide();
_pleaseSendReport.hide();
_yourReportName.hide();
_includeUsername.hide();
_showReport.hide();
_report.hide();
_minidump.hide();
_saveReport.hide();
_send.hide();
_sendSkip.hide();
_continue.hide();
}
} else {
_getApp.hide();
_updaterData->check.hide();
if (_updaterData->state == UpdatingCheck
|| _updaterData->state == UpdatingDownload) {
h += padding + _updaterData->skip.height() + padding;
_updaterData->skip.show();
} else {
_updaterData->skip.hide();
}
}
} else {
h += _networkSettings.height() + padding;
h += padding + _send.height() + padding;
if (_sendingState == SendingNoReport) {
_pleaseSendReport.hide();
_yourReportName.hide();
_includeUsername.hide();
@@ -672,91 +703,68 @@ void LastCrashedWindow::updateControls() {
_report.hide();
_minidump.hide();
_saveReport.hide();
_send.hide();
_sendSkip.hide();
_continue.hide();
}
_updatingCheck.hide();
if (_updatingState == UpdatingCheck || _updatingState == UpdatingDownload) {
h += padding + _updatingSkip.height() + padding;
_updatingSkip.show();
} else {
_updatingSkip.hide();
}
}
#else // !TDESKTOP_DISABLE_AUTOUPDATE
h += _networkSettings.height() + padding;
h += padding + _send.height() + padding;
if (_sendingState == SendingNoReport) {
_pleaseSendReport.hide();
_yourReportName.hide();
_includeUsername.hide();
_showReport.hide();
_report.hide();
_minidump.hide();
_saveReport.hide();
_send.hide();
_sendSkip.hide();
_continue.show();
_networkSettings.hide();
} else {
h += _showReport.height() + padding + _yourReportName.height() + padding;
_pleaseSendReport.show();
_yourReportName.show();
if (_reportUsername.isEmpty()) {
_includeUsername.hide();
} else {
h += _includeUsername.height() + padding;
_includeUsername.show();
}
if (_reportShown) {
h += (_pleaseSendReport.height() * 12.5) + padding + (_minidumpName.isEmpty() ? 0 : (_minidump.height() + padding));
_report.show();
if (_minidumpName.isEmpty()) {
_minidump.hide();
} else {
_minidump.show();
}
_showReport.hide();
if (_reportSaved || _sendingState == SendingFail || _sendingState == SendingProgress || _sendingState == SendingUploading) {
_saveReport.hide();
} else {
_saveReport.show();
}
} else {
_report.hide();
_minidump.hide();
_saveReport.hide();
if (_sendingState == SendingFail || _sendingState == SendingProgress || _sendingState == SendingUploading) {
_showReport.hide();
} else {
_showReport.show();
}
}
if (_sendingState == SendingDone) {
_send.hide();
_sendSkip.hide();
_continue.show();
_networkSettings.hide();
} else {
if (_sendingState == SendingProgress || _sendingState == SendingUploading) {
h += _showReport.height() + padding + _yourReportName.height() + padding;
_pleaseSendReport.show();
_yourReportName.show();
if (_reportUsername.isEmpty()) {
_includeUsername.hide();
} else {
h += _includeUsername.height() + padding;
_includeUsername.show();
}
if (_reportShown) {
h += (_pleaseSendReport.height() * 12.5) + padding + (_minidumpName.isEmpty() ? 0 : (_minidump.height() + padding));
_report.show();
if (_minidumpName.isEmpty()) {
_minidump.hide();
} else {
_minidump.show();
}
_showReport.hide();
if (_reportSaved || _sendingState == SendingFail || _sendingState == SendingProgress || _sendingState == SendingUploading) {
_saveReport.hide();
} else {
_saveReport.show();
}
} else {
_report.hide();
_minidump.hide();
_saveReport.hide();
if (_sendingState == SendingFail || _sendingState == SendingProgress || _sendingState == SendingUploading) {
_showReport.hide();
} else {
_showReport.show();
}
}
if (_sendingState == SendingDone) {
_send.hide();
} else {
_send.show();
}
_sendSkip.show();
if (_sendingState == SendingFail) {
_networkSettings.show();
} else {
_sendSkip.hide();
_continue.show();
_networkSettings.hide();
} else {
if (_sendingState == SendingProgress || _sendingState == SendingUploading) {
_send.hide();
} else {
_send.show();
}
_sendSkip.show();
if (_sendingState == SendingFail) {
_networkSettings.show();
} else {
_networkSettings.hide();
}
_continue.hide();
}
_continue.hide();
}
}
_getApp.show();
h += _networkSettings.height() + padding;
#endif // else for !TDESKTOP_DISABLE_AUTOUPDATE
_getApp.show();
h += _networkSettings.height() + padding;
}
QRect scr(QApplication::primaryScreen()->availableGeometry());
QSize s(2 * padding + QFontMetrics(_label.font()).width(qsl("Last time Telegram Desktop was not closed properly.")) + padding + _networkSettings.width(), h);
@@ -801,24 +809,27 @@ void LastCrashedWindow::onNetworkSettingsSaved(
Sandbox::refreshGlobalProxy();
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
if ((_updatingState == UpdatingFail && (_sendingState == SendingNoReport || _sendingState == SendingUpdateCheck)) || (_updatingState == UpdatingCheck)) {
if (_updaterData
&& ((_updaterData->state == UpdatingCheck)
|| (_updaterData->state == UpdatingFail
&& (_sendingState == SendingNoReport
|| _sendingState == SendingUpdateCheck)))) {
Core::UpdateChecker checker;
checker.stop();
cSetLastUpdateCheck(0);
checker.start();
} else
#endif // !TDESKTOP_DISABLE_AUTOUPDATE
if (_sendingState == SendingFail || _sendingState == SendingProgress) {
} else if (_sendingState == SendingFail
|| _sendingState == SendingProgress) {
onSendReport();
}
activate();
}
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
void LastCrashedWindow::setUpdatingState(UpdatingState state, bool force) {
if (_updatingState != state || force) {
_updatingState = state;
Expects(_updaterData != nullptr);
if (_updaterData->state != state || force) {
_updaterData->state = state;
switch (state) {
case UpdatingLatest:
_updating.setText(qsl("Latest version is installed."));
@@ -850,29 +861,35 @@ void LastCrashedWindow::setUpdatingState(UpdatingState state, bool force) {
}
void LastCrashedWindow::setDownloadProgress(qint64 ready, qint64 total) {
Expects(_updaterData != nullptr);
qint64 readyTenthMb = (ready * 10 / (1024 * 1024)), totalTenthMb = (total * 10 / (1024 * 1024));
QString readyStr = QString::number(readyTenthMb / 10) + '.' + QString::number(readyTenthMb % 10);
QString totalStr = QString::number(totalTenthMb / 10) + '.' + QString::number(totalTenthMb % 10);
QString res = qsl("Downloading update {ready} / {total} MB..").replace(qstr("{ready}"), readyStr).replace(qstr("{total}"), totalStr);
if (_newVersionDownload != res) {
_newVersionDownload = res;
_updating.setText(_newVersionDownload);
if (_updaterData->newVersionDownload != res) {
_updaterData->newVersionDownload = res;
_updating.setText(_updaterData->newVersionDownload);
updateControls();
}
}
void LastCrashedWindow::onUpdateRetry() {
Expects(_updaterData != nullptr);
cSetLastUpdateCheck(0);
Core::UpdateChecker checker;
checker.start();
}
void LastCrashedWindow::onUpdateSkip() {
Expects(_updaterData != nullptr);
if (_sendingState == SendingNoReport) {
onContinue();
} else {
if (_updatingState == UpdatingCheck
|| _updatingState == UpdatingDownload) {
if (_updaterData->state == UpdatingCheck
|| _updaterData->state == UpdatingDownload) {
Core::UpdateChecker checker;
checker.stop();
setUpdatingState(UpdatingFail);
@@ -883,26 +900,35 @@ void LastCrashedWindow::onUpdateSkip() {
}
void LastCrashedWindow::onUpdateChecking() {
Expects(_updaterData != nullptr);
setUpdatingState(UpdatingCheck);
}
void LastCrashedWindow::onUpdateLatest() {
Expects(_updaterData != nullptr);
setUpdatingState(UpdatingLatest);
}
void LastCrashedWindow::onUpdateDownloading(qint64 ready, qint64 total) {
Expects(_updaterData != nullptr);
setUpdatingState(UpdatingDownload);
setDownloadProgress(ready, total);
}
void LastCrashedWindow::onUpdateReady() {
Expects(_updaterData != nullptr);
setUpdatingState(UpdatingReady);
}
void LastCrashedWindow::onUpdateFailed() {
Expects(_updaterData != nullptr);
setUpdatingState(UpdatingFail);
}
#endif // !TDESKTOP_DISABLE_AUTOUPDATE
void LastCrashedWindow::onContinue() {
if (CrashReports::Restart() == CrashReports::CantOpen) {
@@ -973,36 +999,37 @@ void LastCrashedWindow::resizeEvent(QResizeEvent *e) {
_updating.move(padding, padding * 2 + _networkSettings.height() + (_networkSettings.height() - _updating.height()) / 2);
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
_pleaseSendReport.move(padding, padding * 2 + _networkSettings.height() + _networkSettings.height() + padding + (_showReport.height() - _pleaseSendReport.height()) / 2);
_showReport.move(padding * 2 + _pleaseSendReport.width(), padding * 2 + _networkSettings.height() + _networkSettings.height() + padding);
_yourReportName.move(padding, _showReport.y() + _showReport.height() + padding);
_includeUsername.move(padding, _yourReportName.y() + _yourReportName.height() + padding);
_getApp.move((width() - _getApp.width()) / 2, _showReport.y() + _showReport.height() + padding);
if (_updaterData) {
_pleaseSendReport.move(padding, padding * 2 + _networkSettings.height() + _networkSettings.height() + padding + (_showReport.height() - _pleaseSendReport.height()) / 2);
_showReport.move(padding * 2 + _pleaseSendReport.width(), padding * 2 + _networkSettings.height() + _networkSettings.height() + padding);
_yourReportName.move(padding, _showReport.y() + _showReport.height() + padding);
_includeUsername.move(padding, _yourReportName.y() + _yourReportName.height() + padding);
_getApp.move((width() - _getApp.width()) / 2, _showReport.y() + _showReport.height() + padding);
if (_sendingState == SendingFail || _sendingState == SendingProgress) {
_networkSettings.move(padding * 2 + _pleaseSendReport.width(), padding * 2 + _networkSettings.height() + _networkSettings.height() + padding);
if (_sendingState == SendingFail || _sendingState == SendingProgress) {
_networkSettings.move(padding * 2 + _pleaseSendReport.width(), padding * 2 + _networkSettings.height() + _networkSettings.height() + padding);
} else {
_networkSettings.move(padding * 2 + _updating.width(), padding * 2 + _networkSettings.height());
}
if (_updaterData->state == UpdatingCheck
|| _updaterData->state == UpdatingDownload) {
_updaterData->check.move(width() - padding - _updaterData->check.width(), height() - padding - _updaterData->check.height());
_updaterData->skip.move(width() - padding - _updaterData->skip.width(), height() - padding - _updaterData->skip.height());
} else {
_updaterData->check.move(width() - padding - _updaterData->check.width(), height() - padding - _updaterData->check.height());
_updaterData->skip.move(width() - padding - _updaterData->check.width() - padding - _updaterData->skip.width(), height() - padding - _updaterData->skip.height());
}
} else {
_networkSettings.move(padding * 2 + _updating.width(), padding * 2 + _networkSettings.height());
_getApp.move((width() - _getApp.width()) / 2, _updating.y() + _updating.height() + padding);
_pleaseSendReport.move(padding, padding * 2 + _networkSettings.height() + _networkSettings.height() + padding + _getApp.height() + padding + (_showReport.height() - _pleaseSendReport.height()) / 2);
_showReport.move(padding * 2 + _pleaseSendReport.width(), padding * 2 + _networkSettings.height() + _networkSettings.height() + padding + _getApp.height() + padding);
_yourReportName.move(padding, _showReport.y() + _showReport.height() + padding);
_includeUsername.move(padding, _yourReportName.y() + _yourReportName.height() + padding);
_networkSettings.move(padding * 2 + _pleaseSendReport.width(), padding * 2 + _networkSettings.height() + _networkSettings.height() + padding + _getApp.height() + padding);
}
if (_updatingState == UpdatingCheck || _updatingState == UpdatingDownload) {
_updatingCheck.move(width() - padding - _updatingCheck.width(), height() - padding - _updatingCheck.height());
_updatingSkip.move(width() - padding - _updatingSkip.width(), height() - padding - _updatingSkip.height());
} else {
_updatingCheck.move(width() - padding - _updatingCheck.width(), height() - padding - _updatingCheck.height());
_updatingSkip.move(width() - padding - _updatingCheck.width() - padding - _updatingSkip.width(), height() - padding - _updatingSkip.height());
}
#else // !TDESKTOP_DISABLE_AUTOUPDATE
_getApp.move((width() - _getApp.width()) / 2, _updating.y() + _updating.height() + padding);
_pleaseSendReport.move(padding, padding * 2 + _networkSettings.height() + _networkSettings.height() + padding + _getApp.height() + padding + (_showReport.height() - _pleaseSendReport.height()) / 2);
_showReport.move(padding * 2 + _pleaseSendReport.width(), padding * 2 + _networkSettings.height() + _networkSettings.height() + padding + _getApp.height() + padding);
_yourReportName.move(padding, _showReport.y() + _showReport.height() + padding);
_includeUsername.move(padding, _yourReportName.y() + _yourReportName.height() + padding);
_networkSettings.move(padding * 2 + _pleaseSendReport.width(), padding * 2 + _networkSettings.height() + _networkSettings.height() + padding + _getApp.height() + padding);
#endif // else for !TDESKTOP_DISABLE_AUTOUPDATE
if (_reportUsername.isEmpty()) {
_report.setGeometry(padding, _yourReportName.y() + _yourReportName.height() + padding, width() - 2 * padding, _pleaseSendReport.height() * 12.5);
} else {

View File

@@ -95,7 +95,6 @@ public slots:
void onSendingFinished();
void onSendingProgress(qint64 uploaded, qint64 total);
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
void onUpdateRetry();
void onUpdateSkip();
@@ -104,7 +103,6 @@ public slots:
void onUpdateDownloading(qint64 ready, qint64 total);
void onUpdateReady();
void onUpdateFailed();
#endif // !TDESKTOP_DISABLE_AUTOUPDATE
protected:
void closeEvent(QCloseEvent *e);
@@ -153,8 +151,6 @@ private:
QNetworkAccessManager _sendManager;
QNetworkReply *_checkReply, *_sendReply;
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
PreLaunchButton _updatingCheck, _updatingSkip;
enum UpdatingState {
UpdatingNone,
UpdatingCheck,
@@ -163,12 +159,17 @@ private:
UpdatingFail,
UpdatingReady
};
UpdatingState _updatingState;
QString _newVersionDownload;
struct UpdaterData {
UpdaterData(QWidget *buttonParent);
PreLaunchButton check, skip;
UpdatingState state;
QString newVersionDownload;
};
const std::unique_ptr<UpdaterData> _updaterData;
void setUpdatingState(UpdatingState state, bool force = false);
void setDownloadProgress(qint64 ready, qint64 total);
#endif // !TDESKTOP_DISABLE_AUTOUPDATE
rpl::lifetime _lifetime;

View File

@@ -76,8 +76,10 @@ QString filedialogDefaultName(
if (skipExistance) {
name = base + extension;
} else {
QDir dir(directoryPath);
QString nameBase = dir.absolutePath() + '/' + base;
QDir directory(directoryPath);
const auto dir = directory.absolutePath();
const auto nameBase = (dir.endsWith('/') ? dir : (dir + '/'))
+ base;
name = nameBase + extension;
for (int i = 0; QFileInfo(name).exists(); ++i) {
name = nameBase + qsl(" (%1)").arg(i + 2) + extension;
@@ -90,14 +92,16 @@ QString filedialogNextFilename(
const QString &name,
const QString &cur,
const QString &path) {
QDir dir(path.isEmpty() ? cDialogLastPath() : path);
QDir directory(path.isEmpty() ? cDialogLastPath() : path);
int32 extIndex = name.lastIndexOf('.');
QString prefix = name, extension;
if (extIndex >= 0) {
extension = name.mid(extIndex);
prefix = name.mid(0, extIndex);
}
QString nameBase = dir.absolutePath() + '/' + prefix, result = nameBase + extension;
const auto dir = directory.absolutePath();
const auto nameBase = (dir.endsWith('/') ? dir : (dir + '/')) + prefix;
auto result = nameBase + extension;
for (int i = 0; result.toLower() != cur.toLower() && QFileInfo(result).exists(); ++i) {
result = nameBase + qsl(" (%1)").arg(i + 2) + extension;
}

View File

@@ -11,6 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "platform/platform_specific.h"
#include "core/crash_reports.h"
#include "core/main_queue_processor.h"
#include "core/update_checker.h"
#include "application.h"
namespace Core {
@@ -61,15 +62,12 @@ int Launcher::exec() {
DEBUG_LOG(("Telegram finished, result: %1").arg(result));
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
if (cRestartingUpdate()) {
if (!UpdaterDisabled() && cRestartingUpdate()) {
DEBUG_LOG(("Application Info: executing updater to install update..."));
if (!launchUpdater(UpdaterLaunch::PerformUpdate)) {
psDeleteDir(cWorkingDir() + qsl("tupdates/temp"));
}
} else
#endif // !TDESKTOP_DISABLE_AUTOUPDATE
if (cRestarting()) {
} else if (cRestarting()) {
DEBUG_LOG(("Application Info: executing Telegram, because of restart..."));
launchUpdater(UpdaterLaunch::JustRelaunch);
}
@@ -151,7 +149,8 @@ void Launcher::prepareSettings() {
info = info.symLinkTarget();
}
if (info.exists()) {
gExeDir = info.absoluteDir().absolutePath() + '/';
const auto dir = info.absoluteDir().absolutePath();
gExeDir = (dir.endsWith('/') ? dir : (dir + '/'));
gExeName = info.fileName();
}
}
@@ -177,19 +176,20 @@ void Launcher::processArguments() {
AllLeftValues,
};
auto parseMap = std::map<QByteArray, KeyFormat> {
{ "-testmode" , KeyFormat::NoValues },
{ "-debug" , KeyFormat::NoValues },
{ "-many" , KeyFormat::NoValues },
{ "-key" , KeyFormat::OneValue },
{ "-autostart" , KeyFormat::NoValues },
{ "-fixprevious", KeyFormat::NoValues },
{ "-cleanup" , KeyFormat::NoValues },
{ "-noupdate" , KeyFormat::NoValues },
{ "-tosettings" , KeyFormat::NoValues },
{ "-startintray", KeyFormat::NoValues },
{ "-sendpath" , KeyFormat::AllLeftValues },
{ "-workdir" , KeyFormat::OneValue },
{ "--" , KeyFormat::OneValue },
{ "-testmode" , KeyFormat::NoValues },
{ "-debug" , KeyFormat::NoValues },
{ "-many" , KeyFormat::NoValues },
{ "-key" , KeyFormat::OneValue },
{ "-autostart" , KeyFormat::NoValues },
{ "-fixprevious" , KeyFormat::NoValues },
{ "-cleanup" , KeyFormat::NoValues },
{ "-noupdate" , KeyFormat::NoValues },
{ "-externalupdater", KeyFormat::NoValues },
{ "-tosettings" , KeyFormat::NoValues },
{ "-startintray" , KeyFormat::NoValues },
{ "-sendpath" , KeyFormat::AllLeftValues },
{ "-workdir" , KeyFormat::OneValue },
{ "--" , KeyFormat::OneValue },
};
auto parseResult = QMap<QByteArray, QStringList>();
auto parsingKey = QByteArray();
@@ -214,6 +214,9 @@ void Launcher::processArguments() {
}
}
if (parseResult.contains("-externalupdater")) {
SetUpdaterDisabledAtStartup();
}
gTestMode = parseResult.contains("-testmode");
Logs::SetDebugEnabled(parseResult.contains("-debug"));
gManyInstance = parseResult.contains("-many");

View File

@@ -0,0 +1,93 @@
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "core/mime_type.h"
namespace Core {
MimeType::MimeType(const QMimeType &type) : _typeStruct(type) {
}
MimeType::MimeType(Known type) : _type(type) {
}
QStringList MimeType::globPatterns() const {
switch (_type) {
case Known::WebP: return QStringList(qsl("*.webp"));
case Known::TDesktopTheme: return QStringList(qsl("*.tdesktop-theme"));
case Known::TDesktopPalette: return QStringList(qsl("*.tdesktop-palette"));
default: break;
}
return _typeStruct.globPatterns();
}
QString MimeType::filterString() const {
switch (_type) {
case Known::WebP: return qsl("WebP image (*.webp)");
case Known::TDesktopTheme: return qsl("Theme files (*.tdesktop-theme)");
case Known::TDesktopPalette: return qsl("Palette files (*.tdesktop-palette)");
default: break;
}
return _typeStruct.filterString();
}
QString MimeType::name() const {
switch (_type) {
case Known::WebP: return qsl("image/webp");
case Known::TDesktopTheme: return qsl("application/x-tdesktop-theme");
case Known::TDesktopPalette: return qsl("application/x-tdesktop-palette");
default: break;
}
return _typeStruct.name();
}
MimeType MimeTypeForName(const QString &mime) {
if (mime == qsl("image/webp")) {
return MimeType(MimeType::Known::WebP);
} else if (mime == qsl("application/x-tdesktop-theme")) {
return MimeType(MimeType::Known::TDesktopTheme);
} else if (mime == qsl("application/x-tdesktop-palette")) {
return MimeType(MimeType::Known::TDesktopPalette);
}
return MimeType(QMimeDatabase().mimeTypeForName(mime));
}
MimeType MimeTypeForFile(const QFileInfo &file) {
QString path = file.absoluteFilePath();
if (path.endsWith(qstr(".webp"), Qt::CaseInsensitive)) {
return MimeType(MimeType::Known::WebP);
} else if (path.endsWith(qstr(".tdesktop-theme"), Qt::CaseInsensitive)) {
return MimeType(MimeType::Known::TDesktopTheme);
} else if (path.endsWith(qstr(".tdesktop-palette"), Qt::CaseInsensitive)) {
return MimeType(MimeType::Known::TDesktopPalette);
}
{
QFile f(path);
if (f.open(QIODevice::ReadOnly)) {
QByteArray magic = f.read(12);
if (magic.size() >= 12) {
if (!memcmp(magic.constData(), "RIFF", 4) && !memcmp(magic.constData() + 8, "WEBP", 4)) {
return MimeType(MimeType::Known::WebP);
}
}
f.close();
}
}
return MimeType(QMimeDatabase().mimeTypeForFile(file));
}
MimeType MimeTypeForData(const QByteArray &data) {
if (data.size() >= 12) {
if (!memcmp(data.constData(), "RIFF", 4) && !memcmp(data.constData() + 8, "WEBP", 4)) {
return MimeType(MimeType::Known::WebP);
}
}
return MimeType(QMimeDatabase().mimeTypeForData(data));
}
} // namespace Core

View File

@@ -0,0 +1,41 @@
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QMimeType>
namespace Core {
class MimeType {
public:
enum class Known {
Unknown,
TDesktopTheme,
TDesktopPalette,
WebP,
};
explicit MimeType(const QMimeType &type);
explicit MimeType(Known type);
QStringList globPatterns() const;
QString filterString() const;
QString name() const;
private:
QMimeType _typeStruct;
Known _type = Known::Unknown;
};
MimeType MimeTypeForName(const QString &mime);
MimeType MimeTypeForFile(const QFileInfo &file);
MimeType MimeTypeForData(const QByteArray &data);
} // namespace Core

View File

@@ -32,9 +32,6 @@ extern "C" {
#endif // else of Q_OS_WIN
namespace Core {
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
namespace {
constexpr auto kUpdaterTimeout = 10 * TimeMs(1000);
@@ -42,6 +39,12 @@ constexpr auto kMaxResponseSize = 1024 * 1024;
constexpr auto kMaxUpdateSize = 256 * 1024 * 1024;
constexpr auto kChunkSize = 128 * 1024;
#ifdef TDESKTOP_DISABLE_AUTOUPDATE
bool UpdaterIsDisabled = true;
#else // TDESKTOP_DISABLE_AUTOUPDATE
bool UpdaterIsDisabled = false;
#endif // TDESKTOP_DISABLE_AUTOUPDATE
std::weak_ptr<Updater> UpdaterInstance;
using ErrorSignal = void(QNetworkReply::*)(QNetworkReply::NetworkError);
@@ -1254,7 +1257,7 @@ MtpChecker::MtpChecker(QPointer<MTP::Instance> instance, bool testing)
void MtpChecker::start() {
if (!_mtp.valid()) {
LOG(("Update Info: MTP is unavailable."));
InvokeQueued(this, [=] { fail(); });
crl::on_main(this, [=] { fail(); });
return;
}
constexpr auto kFeedUsername = "tdhbcfeed";
@@ -1560,6 +1563,16 @@ Fn<void(const RPCError &)> MtpLoader::failHandler() {
} // namespace
bool UpdaterDisabled() {
return UpdaterIsDisabled;
}
void SetUpdaterDisabledAtStartup() {
Expects(UpdaterInstance.lock() == nullptr);
UpdaterIsDisabled = true;
}
class Updater : public base::has_weak_ptr {
public:
Updater();
@@ -2099,35 +2112,32 @@ bool checkReadyUpdate() {
}
void UpdateApplication() {
cSetLastUpdateCheck(0);
Core::UpdateChecker().start();
if (const auto window = App::wnd()) {
auto settings = Box<Settings::Widget>();
const auto weak = make_weak(settings.data());
window->showSpecialLayer(std::move(settings), anim::type::normal);
if (weak) {
weak->scrollToUpdateRow();
if (UpdaterDisabled()) {
const auto url = [&] {
#ifdef OS_WIN_STORE
return "https://www.microsoft.com/en-us/store/p/telegram-desktop/9nztwsqntd0s";
#elif defined OS_MAC_STORE // OS_WIN_STORE
return "https://itunes.apple.com/ae/app/telegram-desktop/id946399090";
#else // OS_WIN_STORE || OS_MAC_STORE
return "https://desktop.telegram.org";
#endif // OS_WIN_STORE || OS_MAC_STORE
}();
UrlClickHandler::Open(url);
} else {
cSetLastUpdateCheck(0);
Core::UpdateChecker().start();
if (const auto window = App::wnd()) {
auto settings = Box<Settings::Widget>();
const auto weak = make_weak(settings.data());
window->showSpecialLayer(std::move(settings), anim::type::normal);
if (weak) {
weak->scrollToUpdateRow();
}
window->showFromTray();
}
}
}
#else // !TDESKTOP_DISABLE_AUTOUPDATE
void UpdateApplication() {
const auto url = [&] {
#ifdef OS_WIN_STORE
return "https://www.microsoft.com/en-us/store/p/telegram-desktop/9nztwsqntd0s";
#elif defined OS_MAC_STORE // OS_WIN_STORE
return "https://itunes.apple.com/ae/app/telegram-desktop/id946399090";
#else // OS_WIN_STORE || OS_MAC_STORE
return "https://desktop.telegram.org";
#endif // OS_WIN_STORE || OS_MAC_STORE
}();
UrlClickHandler::doOpen(url);
}
#endif // !TDESKTOP_DISABLE_AUTOUPDATE
QString countBetaVersionSignature(uint64 version) { // duplicated in packer.cpp
if (cBetaPrivateKey().isEmpty()) {
LOG(("Error: Trying to count beta version signature without beta private key!"));

View File

@@ -13,7 +13,8 @@ class Instance;
namespace Core {
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
bool UpdaterDisabled();
void SetUpdaterDisabledAtStartup();
class Updater;
@@ -53,13 +54,6 @@ private:
};
bool checkReadyUpdate();
#else // TDESKTOP_DISABLE_AUTOUPDATE
class UpdateChecker {
};
#endif // TDESKTOP_DISABLE_AUTOUPDATE
void UpdateApplication();
QString countBetaVersionSignature(uint64 version);

Some files were not shown because too many files have changed in this diff Show More