Commit Graph

705 Commits

Author SHA1 Message Date
John Preston
bdc7f4114f Move some things from SessionData. 2019-11-20 13:41:14 +03:00
John Preston
885738ac32 Always choose correct address for key creation. 2019-11-20 12:16:53 +03:00
John Preston
43bab3eeaa Fix instant restarts with additional timeout. 2019-11-20 11:23:30 +03:00
John Preston
f424cb54f7 Create keys not simultaneously. 2019-11-19 19:22:02 +03:00
John Preston
e6d3b2b098 Fix resending requests after new session. 2019-11-19 19:14:50 +03:00
John Preston
e7e1c9aa5a Don't handle 'msg_resend_req'. 2019-11-19 14:55:39 +03:00
John Preston
173ae746a2 First version of working through temp keys. 2019-11-19 13:10:51 +03:00
John Preston
d9fc3619c2 Remove all signals from ConnectionPrivate. 2019-11-18 15:53:37 +03:00
John Preston
cfe12f773f Move some modules to lib_mtproto. 2019-11-18 12:28:14 +03:00
John Preston
90c6475c8c Closed alpha version 1.9.1.1: Fix build on macOS. 2019-11-15 17:11:05 +03:00
John Preston
be06d68468 Don't lock whole key creation by a mutex. 2019-11-15 16:16:33 +03:00
John Preston
055b99f5b0 Don't use shared_ptr for Dcenters. 2019-11-15 16:16:33 +03:00
John Preston
f37ab6e38e Remove checked key property. 2019-11-15 16:16:33 +03:00
John Preston
fe1e627cac Improve working with sessions. 2019-11-15 16:16:33 +03:00
John Preston
1e252a6505 Remove old debug information. 2019-11-15 16:16:32 +03:00
John Preston
3a7faffa3a Use thread_local counter in logs for thread index. 2019-11-15 16:16:32 +03:00
John Preston
8b14249cd2 Move DumpToText from Telegram to lib_mtproto. 2019-11-15 16:16:32 +03:00
John Preston
7243fb52ad Check keys that receive -404 error codes. 2019-11-15 16:16:32 +03:00
John Preston
1524b4a930 Allow creating temporary keys. 2019-11-15 16:16:32 +03:00
John Preston
08bfe6f1c1 Extract mtproto key generation code. 2019-11-15 16:16:32 +03:00
John Preston
2577bedeac Remove mtproto/facade.h from main pch. 2019-11-13 11:31:12 +03:00
John Preston
88e0342e02 Update to the latest submodules. 2019-11-05 14:27:42 +03:00
John Preston
01936b5f1b Build with Qt 5.12.5 and OpenSSL 1.1.1. 2019-10-19 12:27:56 +04:00
John Preston
bc2a0fb505 Use TL code generator from lib_tl. 2019-10-19 12:27:56 +04:00
John Preston
30a1bd7ba2 Use base::call_delayed. 2019-10-19 12:27:56 +04:00
John Preston
1b89348d89 Use lib_rpl / lib_base from submodules. 2019-10-19 10:30:08 +04:00
John Preston
2cb7d76417 Optimize unixtime refresh. 2019-10-02 11:30:50 +03:00
John Preston
c057f28425 Move standard buttons to lib_ui. 2019-10-01 23:59:46 +03:00
John Preston
a16c6ca41a Support more request types. 2019-10-01 23:59:46 +03:00
John Preston
e2f54eb3e9 Move some style code to lib_ui. 2019-10-01 23:59:46 +03:00
John Preston
0c713a930a Remove app.h / facades.h from precompiled header. 2019-10-01 23:59:46 +03:00
John Preston
6343221d7b Remove many includes from stdafx.pch. 2019-09-06 19:31:07 +03:00
John Preston
7893ad0558 Mark all types of local history items. 2019-09-06 10:53:44 +03:00
John Preston
5fc4dcd172 Closed alpha version 1.8.2.2. 2019-08-30 18:45:07 +03:00
John Preston
d66541989e Improve first socket message. 2019-08-27 19:10:37 +03:00
John Preston
03cdddfe18 Allow sending scheduled messages. 2019-08-27 19:10:37 +03:00
John Preston
02b65a42f7 Move message client flags to a separate field. 2019-08-09 20:19:23 +01:00
John Preston
d298953653 Add large emoji implementation. 2019-08-09 11:50:49 +01:00
John Preston
7e4c9f98a6 Track all single-emoji messages. 2019-08-09 11:50:49 +01:00
John Preston
abf49e1672 Update API scheme. 2019-08-09 11:50:49 +01:00
John Preston
03cf8b6ac2 Improve transport nonce generation. 2019-07-28 18:01:13 +02:00
John Preston
2a8b6f05c8 Fix build for GCC. 2019-07-27 17:19:04 +02:00
John Preston
ff44094ded Rename AuthSession to Main::Session. 2019-07-24 13:45:24 +02:00
John Preston
9cf4cf6dca Move MTP::Instance to Main::Account. 2019-07-24 10:46:23 +02:00
John Preston
4fd50cfb70 Fix build in Xcode. 2019-07-24 08:02:20 +02:00
John Preston
6aa930d510 Remove exceptions in TL parsing. 2019-07-24 08:02:20 +02:00
John Preston
c50ade565a Track sending and failed messages. 2019-07-24 08:02:20 +02:00
John Preston
0005e0a3ce Track local messages, restore on history jump. 2019-07-24 08:02:20 +02:00
John Preston
7c6ede0908 Save domain in different localstorage key. 2019-07-15 16:00:30 +02:00
John Preston
cabe06256b Validate dcOption secrets. 2019-07-15 16:00:30 +02:00
John Preston
c5df4db621 Fix possible race conditions in msgid(). 2019-07-15 16:00:30 +02:00
John Preston
68b1024dd4 Sync local time with HTTP 'Date' header value. 2019-07-15 16:00:29 +02:00
John Preston
c894ce30c4 Fix socket packet reading. 2019-07-15 15:59:20 +02:00
John Preston
8135f4b427 Support base64 encoding of the secret. 2019-07-15 15:59:20 +02:00
John Preston
2f0331b2e0 Implement send/receive for the new type. 2019-07-15 15:59:20 +02:00
John Preston
69b6b48738 Add new socket type. 2019-07-15 15:59:20 +02:00
John Preston
3cda267787 Abstract out tcp socket from tcp connection. 2019-07-15 15:59:20 +02:00
John Preston
96a26b44a9 Fix build for Xcode. 2019-07-05 17:08:33 +02:00
John Preston
567bf60644 Use getters in MTP classes. 2019-07-05 16:23:07 +02:00
John Preston
ce760f0534 Comment out App type in SpecialConfigRequest. 2019-06-07 18:43:06 +03:00
John Preston
263bbf1788 Move _authSession to Main::Account. 2019-06-06 12:37:12 +03:00
John Preston
3d38abce97 Differentiate Windows Store and Mac Store. 2019-06-03 13:54:25 +03:00
John Preston
c4aac5fa0e Update API scheme to layer 100. 2019-05-27 15:09:06 +02:00
John Preston
58519300ea Support pinned chats in folders. 2019-05-01 16:11:37 +04:00
John Preston
905a024aed Update API scheme to layer 99. 2019-04-25 14:16:29 +04:00
Amos Bird
e200a7d502 Do not break type aliasing rule 2019-04-25 13:38:39 +04:00
John Preston
c3c46f8e29 Fix new animations engine bug. 2019-04-04 19:31:03 +04:00
23rd
a6d0fa433e Refactored variables for edit media in HistoryItem.
- Replaced _isLocalUpdateMedia with client flag.
 - Removed _isEditingMedia.
2019-04-04 13:23:14 +03:00
John Preston
77fbf19a72 Use serverside keywords for emoji suggestions. 2019-04-02 14:33:53 +04:00
John Preston
aa8f62da9d Support new ('modern') API file locations. 2019-03-29 14:24:07 +04:00
John Preston
386600baf9 Save and load sticker set thumbnails. 2019-03-24 12:12:44 +04:00
John Preston
a34e998c42 Handle fwd_from without a link to the account. 2019-03-24 12:12:42 +04:00
John Preston
6d1193a751 Update API scheme to layer 97. 2019-03-24 12:12:41 +04:00
John Preston
a59353df9f Fix possible crash in DomainResolver.
App::CallDelayed() could be queued twice for a single key, if before
the delayed call we cleared entry in _attempts and created it again.
2019-03-20 13:23:16 +04:00
John Preston
a886c598c1 Fix non-streamable videos layout. 2019-03-11 12:08:20 +04:00
John Preston
9a616edf2a Add new animations engine. 2019-03-11 12:08:17 +04:00
John Preston
8171828c2a Fix build on GCC. 2019-03-11 12:08:09 +04:00
John Preston
fe618bd652 Use crl::time/now instead of TimeMs/getms. 2019-02-19 11:06:33 +04:00
John Preston
e2f0886950 Add option to blur chat background. 2019-02-07 19:36:30 +03:00
John Preston
f5cc93ec64 Decouple MTP::Instance from Core::App. 2019-02-01 10:48:31 +03:00
John Preston
93a967dc74 Add random_padding to dns requests. 2019-01-31 13:48:10 +03:00
John Preston
a70e72f75d Application->Sandbox, Messenger->Application. 2019-01-23 12:51:58 +04:00
John Preston
314e30272b Replace SingleTimer with base::Timer. 2019-01-18 16:41:08 +04:00
John Preston
2a0b9a44dd Remove supergroup migrate messages. 2019-01-17 12:21:31 +04:00
John Preston
3c44bdb6b7 Support auto-migrate to supergroups. 2019-01-17 12:21:30 +04:00
John Preston
67d12fa6d2 Improve update handling for legacy chats. 2019-01-17 12:21:30 +04:00
John Preston
548a0c8517 Fix MTP logging. 2019-01-17 12:20:50 +04:00
John Preston
f48ae29f22 Load emoji sets from the cloud. 2019-01-11 17:30:00 +04:00
23rd
be0b0c1984 Fixed an editing of unsupported messages. 2018-12-26 15:10:56 +04:00
John Preston
8d27d8efcf Use cloud-based settings for p2p in calls. 2018-11-16 20:17:58 +04:00
John Preston
d0e48a02a1 Apply lang pack versions from config. 2018-11-16 20:17:58 +04:00
John Preston
162da089ec Handle t.me/setlanguage links.
Also support custom langpacks with base langpacks.
2018-11-16 20:17:58 +04:00
John Preston
8b6e24e83d Build alphas only for official targets. 2018-11-08 10:33:44 +04:00
John Preston
e482f041a8 Allow disabling even system proxy settings.
Fixes #4944.
2018-11-05 18:52:01 +04:00
John Preston
c5d20a21f7 Beta version 1.4.4: Correct caption limit. 2018-10-17 14:43:18 +03:00
John Preston
2e5a0e056c Move to std::optional. 2018-09-21 19:28:46 +03:00
John Preston
c4ca180745 Add call peer-to-peer setting in Privacy&Security. 2018-09-19 19:22:14 +03:00
John Preston
2e7f4c2f21 Use Storage::Cache::Database for file caching. 2018-09-01 18:56:08 +03:00
John Preston
cb371f09ac Clear old versions of Storage::Cache::Database. 2018-09-01 18:56:08 +03:00
John Preston
5b88f4d3d2 Update API scheme. 2018-08-20 17:25:06 +03:00
John Preston
bdab477040 Update API scheme to layer 84. 2018-08-11 22:03:34 +03:00
John Preston
4c0551ebb1 Fix crash in tcp connection implementation. 2018-07-31 22:56:02 +03:00
John Preston
091d1157da Fix clearing callbacks for timeout-ed requests. 2018-07-31 22:56:02 +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
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
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
266102df2f Some phrases fixed, some logs added. 2018-06-24 16:17:46 +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
36fb6dac89 Call finish takeout. Handle errors. 2018-06-21 14:50:56 +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
c7aa5ed544 _DEBUG-test ConcurrentSender generic handlers. 2018-06-17 21:29:50 +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
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
5a9d1a3fce Add .visit(many, callbacks) method to MTP types. 2018-06-12 22:59:58 +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
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
9ebeddbed8 Request, show and require accept for updated ToS. 2018-06-06 21:37:01 +03:00
John Preston
c85fd368fe Possible fix of travis build. 2018-06-06 15:16:21 +03:00
John Preston
233be5ec13 Fix crash in web request destructors. 2018-06-06 12:32:38 +03:00
John Preston
72f95b984f Replace cDebug() with Logs::DebugEnabled(). 2018-06-05 21:51:05 +03:00
John Preston
a52392241d Fix some possible crashes. 2018-06-04 22:48:17 +03:00
John Preston
dd81f5d59f Replace base::lambda with shorter term.
base::lambda -> Fn (type alias for std::function).
base::lambda_once -> FnMut (type alias for base::unique_function).
base::lambda_guarded -> crl::guard.
base::lambda_call_type_t -> crl::deduced_call_type.
2018-06-04 18:38:27 +03:00
John Preston
fae4b92d8d Add store version label to sessions list. 2018-06-04 13:41:53 +03:00
John Preston
ead31757d7 Submit passport results. 2018-06-03 23:16:36 +03:00
John Preston
1392e05ab1 Move all gsl::byte helpers to base/bytes module. 2018-06-03 23:16:34 +03:00
John Preston
ddb4527159 Start passport support: handle link, receive form. 2018-06-03 23:16:33 +03:00
John Preston
e122353bfb Show better information in sessions list. 2018-06-03 23:14:44 +03:00
John Preston
03037121aa Add support for autoupdate through MTProto. 2018-05-30 01:00:36 +03:00
John Preston
59a1e13955 Use each AbstractConnection only for one time. 2018-05-28 22:43:14 +03:00
John Preston
4e858ba839 Improve connections debug logs. 2018-05-28 11:36:12 +03:00
John Preston
37bf9ffcff Show bad proxy configuration error. 2018-05-24 16:40:19 +03:00
John Preston
017ec87d60 Replace FlatTextarea with InputField. 2018-05-22 13:45:22 +03:00
John Preston
8e442563f2 Enable checked auth key creation. 2018-05-20 23:20:48 +03:00
John Preston
f2a5a29d12 Alpha version 1.2.21: Fix build for Xcode. 2018-05-18 21:07:31 +03:00
John Preston
96f7c0c02e Don't try to logout CDN dcs. 2018-05-18 19:41:59 +03:00
John Preston
425e56b3ea Apply proxy settings in mtproto-key-destroyer. 2018-05-18 15:20:28 +03:00
John Preston
4478c0a143 Resolve domain names for proxy servers.
Also use dc_id-checked auth key creation.

Fixes #4695.
2018-05-18 10:57:11 +03:00
John Preston
a053384618 Fix mtproto-proxy working with domain names.
Also refactor a bit TcpConnection and HttpConnection classes.
2018-05-17 13:27:49 +03:00
John Preston
d3f85b4c4e Display channels promoted by proxy on top. 2018-05-13 21:26:35 +03:00
John Preston
8764da787b Don't logout on some server-side problems. 2018-05-13 12:19:34 +03:00
John Preston
e3c6abfc3d Fix possible crash in reply returns. 2018-05-10 14:56:36 +03:00
John Preston
257dfa6b3f Improve phone rules checking. 2018-05-05 21:55:39 +03:00
John Preston
e0431d270b Allow cdn requests through mtproto proxy. 2018-05-05 21:55:39 +03:00
John Preston
1af2769209 Closed beta 1.2.17.4: Fix option lookup. 2018-05-05 21:55:39 +03:00
John Preston
db7041f2dc Send different dns requests for simple config. 2018-05-05 21:55:38 +03:00
John Preston
ad1f089802 Read autoupdate prefix from config. 2018-05-05 21:55:38 +03:00
John Preston
62c812858e Improve config re-requesting. 2018-05-05 21:55:38 +03:00
John Preston
4bf66cb6e9 Better special config implementation. 2018-05-05 21:55:38 +03:00
John Preston
95fee543ec Try all available endpoints from config. 2018-05-05 21:55:38 +03:00
John Preston
f794d8dbd8 Check proxy availability in ProxiesBox. 2018-05-05 21:55:38 +03:00
John Preston
900d1ddb36 Support multiple proxies in local storage. 2018-05-05 21:55:38 +03:00
John Preston
dc9483e07a Fix possible deadlock.
Some unknown code (like getSession) was called while holding
_requestsByDcLock mutex which could lead to a deadlock.

Now all access points to _requestsByDc are simple.
2018-05-05 21:55:37 +03:00
John Preston
65f968ec1b Update API scheme to layer 78. 2018-05-05 21:55:37 +03:00
John Preston
93f6d4b6e7 Support many config endpoints for one dc+params. 2018-05-05 21:55:37 +03:00
John Preston
7482025c10 Support work with different dcs on a single IP. 2018-05-05 21:55:37 +03:00
John Preston
909acb25fd Requesting config if can't connect. 2018-05-05 21:55:37 +03:00
John Preston
4a9db99082 Use application level proxy settings. 2018-05-05 21:55:37 +03:00
John Zimmermann
a2606c4fc4 fix libressl-2.7 compat (#4633) 2018-04-28 21:57:02 +03:00
John Preston
38c20fc3c2 Return one old way for requesting special config. 2018-03-20 18:21:36 +04:00
John Preston
8ed167c5fa Change domain fronting url and host header. 2018-03-11 22:55:28 +03:00
John Preston
a0eb64428e Use new config fields for revoke settings. 2018-03-11 22:21:17 +03:00
John
73c0c4507a fix build against libressl 2018-03-09 21:12:34 +03:00
John Preston
56fece6216 Move from req_pq to req_pq_multi in protocol impl. 2018-03-08 15:55:05 +03:00
John Preston
0f901b3728 Update API and use WebDocument for inline bots. 2018-03-06 16:49:44 +03:00
John Preston
7425e80f05 Use HistoryMedia as view, add Data::Media. 2018-02-08 12:20:48 +03:00
John Preston
97a9089ebf Move draw / getState code to HistoryView::Message.
Item dimensions broken for now.
Also remove history.h from pch.
2018-02-08 12:20:48 +03:00
John Preston
ea7441ae77 Use single LEGAL file with license and copyright. 2018-01-03 13:23:14 +03:00
John Preston
06c724df01 Clear callbacks async in MTP::Instance.
Also fix previous build.
2018-01-02 16:44:12 +03:00
John Preston
ddf4a36bdc Remove mtproto/session.h from precompiled header. 2017-12-18 16:40:15 +04:00
John Preston
14034c255e Replace QSharedPointer with std::shared_ptr. 2017-12-18 13:07:18 +04:00
John Preston
4c9931ab02 Support grouped media rendering. 2017-12-16 20:50:42 +04:00
John Preston
97c15865a5 Move some code around.
Move logs:SignalHandlers to core/crash_reports:CrashReports.
Move all pre-launch windows to core/crash_report_window module.
Move some global code to core/launcher:Launcher.
It should replace settings / platform_specific module in some way.
2017-12-12 16:47:32 +04:00
John Preston
273ac5eaf1 Add some more public keys. 2017-12-08 20:26:27 +04:00
John Preston
5bc47e5203 Move shareContact and readServerHistory to ApiWrap.
Also allow non-confirming contact info sharing to Saved Messages.
2017-12-07 17:43:05 +04:00
John Preston
007ab3b7b8 Fix crash in RSA public key wrapper. 2017-12-07 09:34:11 +04:00
Nicholas Guriev
f813bb704f Optimize key initialization
* Do not do redundant copying of numbers.
2017-12-07 09:15:10 +04:00
Nicholas Guriev
93809ec404 Fix build against OpenSSL 1.1
Closes: #3196
2017-12-07 09:15:10 +04:00
John Preston
1d85c8a6b6 API scheme updated to layer 73. 2017-12-05 12:44:27 +04:00
John Preston
e1c68892d4 Show third column only when explicitly requested.
This allows you to show info in layer from mention links.
2017-12-04 13:42:05 +04:00
John Preston
85b3d3f64d Display admin badges in supergroups.
Also prefer std containers to Qt and OrderedSet in data_peer.
2017-12-01 22:38:44 +04:00
John Preston
2432845df2 Optimize and rename base::weak_unique_ptr.
Rename base::enable_weak_from_this -> base::has_weak_ptr.
Rename base::weak_unique_ptr -> base::weak_ptr.
Rename base::make_weak_unique -> base::make_weak.
Rename base/weak_unique_ptr.h -> base/weak_ptr.h
2017-11-30 21:33:27 +04:00
John Preston
ad6ddcb507 Fix crash in selecting unsent messages.
Also add some more checks in file downloads and serialization.
2017-11-30 11:14:31 +04:00
John Preston
6ca105a290 Minimal layer 72 support. 2017-11-20 23:54:05 +04:00
John Preston
ac99318f34 Use ranges:: algorithms instead of base:: 2017-11-20 16:24:00 +04:00
John Preston
eb2719fad1 Added search to files and links shared media. 2017-11-16 07:59:08 +04:00
John Preston
a27edcad1c Extract SparseIdsList module from SharedMedia.
This way it can be reused in search results management.
2017-11-16 07:59:08 +04:00
John Preston
101d4f6444 Use std::function for base::lambda implementation.
base::lambda becomes just std::function and base::lambda_once becomes
base::unique_function - a move-only wrapper around std::function.

This is required because Visual C++ 2017 15.4.1 has a compiler bug
with static member variables of class templates, they may collide.

The std::function uses inheritance and virtual functions instead of
custom vtables done by static members of class templates used in
custom base::lambda implementation, so they work fine.
2017-11-16 07:59:08 +04:00
John Preston
54cc3e6315 Shared media multiple items selection. 2017-11-16 07:59:07 +04:00
John Preston
ed061252a5 Move to Xcode 9.0 and fix errors in Clang build. 2017-11-16 07:59:05 +04:00
John Preston
1a0e524b49 Optimize third column (create it only once).
Before historyPeer and historyPeerCanWrite were independent, so we
created a new Info section for both of them changing.

Now we use Data::CanWriteValue(peer) and rpl::flatten_latest().
2017-11-16 07:59:04 +04:00
John Preston
ffc20e4492 Divide structs into several data/ modules. 2017-11-16 07:59:04 +04:00
John Preston
41ed2d1b84 New storage for shared media messages index. 2017-11-16 07:59:02 +04:00
John Preston
5b77bd5aa0 Limit maximum IP length in case of corrupted data. 2017-09-04 15:21:52 +03:00
John Preston
df64c972d8 Replace QFlags with base::flags. 2017-09-03 15:45:47 +03:00
John Preston
25ffaaaa2d Replace t_assert() with Assert().
Also use this assertions for Expects(), Ensures() and Unexpected().
2017-08-30 19:15:42 +03:00