Commit Graph

443 Commits

Author SHA1 Message Date
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
John Preston b3da99c302 Replace gsl::not_null<T*> with just not_null<T*>. 2017-08-30 19:15:41 +03:00
John Preston 782114d644 Add and use base::make_weak_unique() helper. 2017-08-30 19:15:28 +03:00
John Preston 0880c01a20 Replace group admins ContactsBox with PeerListBox. 2017-08-30 19:15:28 +03:00
John Preston c8810f87b9 Move a lot of code from scheme.h to scheme.cpp. 2017-08-25 14:39:32 +03:00
John Preston edbc3f8fde Use QDataStream directly on QByteArray. 2017-08-25 14:39:30 +03:00
John Preston 667eb288d7 Add faved stickers set loading and saving.
Also move stickers loading methods to ApiWrap.
2017-08-25 12:58:13 +03:00
John Preston cf02a4cc31 API scheme updated to layer 70. 2017-07-23 12:34:40 +03:00
Nicholas Guriev 38a53687a0 Fix a couple of typos
Signed-off-by: Nicholas Guriev <guriev-ns@ya.ru> (github: mymedia2)
2017-07-12 14:08:36 +03:00
John Preston 67f2daa43c Closed beta 1001007003: Fix build for old OS X. 2017-06-30 09:21:44 +03:00
John Preston c3db57a4fc Closed beta 1001007003: Fix Xcode build. 2017-06-30 09:21:44 +03:00
John Preston 7245319351 Prefer static dc options when using a proxy. 2017-06-30 09:21:43 +03:00
John Preston 8ae159dd66 Add special dc options config request. 2017-06-29 11:40:07 +03:00
John Preston 5d0e89db5d Switch to the server side changelogs. 2017-06-29 11:40:00 +03:00
John Preston 665a1acfd8 Apply language with app restart if logged in.
Confirm and restart if logged in, just quickly apply if not.
2017-06-29 11:39:54 +03:00
John Preston d51fd7b3ad Update intro change language link.
Also now MTP::Sender isn't bound to MTP::Instance, because Intro
Widget is MTP::Sender, but Intro::PhoneWidget destroys current
MTP::Instance.
2017-06-29 11:39:53 +03:00
John Preston f5353080e7 Use Qt UI language if system was not determined.
Also rename platform/mac/specific_mac.cpp to .mm
2017-06-29 11:39:47 +03:00
John Preston f5dfeb0c50 Support cloud languages list and switching.
Add Lang::Current().updated() observable for retranslating the UI.
2017-06-29 11:39:43 +03:00
John Preston 139d4e72b5 Start cloud langpack support.
Change the way langpacks are stored.
Support custom langpacks in the new storage.
2017-06-29 11:39:42 +03:00
John Preston 110e7c8074 Finalize rename / move. 2017-06-29 11:39:38 +03:00
John Preston a813793007 API scheme updated to layer 67. 2017-06-29 11:39:35 +03:00
John Preston 299143108b Improve protocol support. 2017-05-17 16:39:17 +03:00
John Preston 52f7c8f064 Mark connection as inited only on a non-error response. 2017-05-17 14:01:58 +03:00
John Preston 30d000e139 Toggle calls controls using config and user flags.
Also use calls timeout values from config.
Also request config each time when the auth session changes.
2017-05-09 23:46:22 +03:00
John Preston b267957abe Apply all MTP Key generation checks to calls.
Also move all OpenSSL BN_* calls to base/openssl_help header.
2017-05-09 23:46:16 +03:00
John Preston 0a716036c2 Extract Calls::Call. Add a call button to TopBar. 2017-05-09 23:46:14 +03:00
John Preston 6418c9c718 Handle updates from MTP after RPC responses.
If some RPC responses and MTP updates are received together a fake
requestId in the negative range was used and that way updates were
processed before responses.

That could lead to an incorrect "out" message flag when sending
messages to supergroups, because a broadcast update about the new
message without "out" flag was handled before the request response.

Now a separate response map and updates list are used and responses
are handled always before the updates.
2017-04-30 17:23:57 +03:00
John Preston 8d28d0691f API scheme updated to layer 66.
Support CDN file download.
2017-04-12 22:36:25 +03:00
John Preston 34ab04cbe6 Add lambda-based checked timers.
Also ApiWrap is now not a QObject.
2017-04-07 18:13:21 +03:00
John Preston 0d0307e175 Move ApiWrap to AuthSession.
Also send all ApiWrap requests as an MTP::Sender.
Also create AuthSession only after starting MTProto.
2017-04-07 18:13:19 +03:00
John Preston 5444b8166c Finalize rename / move of files. 2017-04-07 18:13:18 +03:00
John Preston afa9393f38 Expose IsPrimeAndGood() interface from connection.
Also fix a race in MTProto debug type serialization initialization.
2017-04-03 21:28:18 +03:00
John Preston 0cdd0a9ff9 Remove old 'using std::string' from mtproto. 2017-04-02 20:11:30 +03:00
John Preston e8ed307278 Add search in GIFs to EmojiPanel. 2017-03-31 18:58:59 +03:00
John Preston f0ab72ffbc Fix AutoConnection::debugState() for TCP connections. Fix #3171
Also silent new Xcode version warning.
2017-03-30 18:20:51 +03:00
John Preston 5bb68cfd8f Support reading me_url_prefix from config.
The default value 'https://t.me' can be overriden from server config.
2017-03-30 12:49:16 +03:00
John Preston d41372dccd Allow MTP_flags(0) and MTP_flags(single_flag). 2017-03-25 18:42:01 +03:00
John Preston e9ec09b91a Add MTP::Sender to replace RPCSender some day.
Also use c++1z language standard in Xcode build.
Also treat warnings as errors.
2017-03-23 14:37:38 +03:00
John Preston facc729234 Edit account self destruct time in Settings.
Also accept lambda_once in rpcDone() and rpcFail() lambda wrappers.
2017-03-20 23:05:38 +03:00
John Preston 6ad2cd38ed Generate scheme module by GYP action.
Add a new codegen action to generate MTP scheme from scheme.tl file.
2017-03-16 12:37:56 +03:00
John Preston b1ee91b06b Add blocked users box to Settings.
Start a general PeerListBox, it should replace both ContactsBox
and MembersBox in the future. Show blocked users list in it.
2017-03-14 13:58:36 +03:00
John Preston bc254228c9 Alpha 1.0.21: Use custom refcount for MTP types.
It seems that heavy using std::shared_ptr and std::make_shared
like it was before completely kills the compilation time.

Also HistoryItem::_create now uses perfect forwarding.
2017-03-11 20:03:36 +03:00
John Preston f2cd364e14 Alpha 1.0.21: Fix more compilation bugs. 2017-03-11 17:13:57 +03:00
John Preston 28ae5fd65c Alpha 1.0.21: Fix compilation bug. 2017-03-11 13:35:43 +03:00
John Preston f2465eba73 Make MTPstring and MTPvector value types.
Also move MTPstring implementation to QByteArray.
2017-03-10 23:27:26 +03:00
John Preston 1df955e30a Closed beta 1000020001: remove chats list padding. Fix #3098
Also return config requesting at the beginning of each app launch.
2017-03-10 23:27:25 +03:00
John Preston 02da80439b Remove read() constructors from MTP types.
This will allow us to handle errors in parsing not by exceptions.
2017-03-10 23:27:24 +03:00
John Preston 3b373e236e Make all owned MTPD types immutable.
Remove custom refcounting in mtpData, use std::shared_ptr instead.
2017-03-10 23:27:23 +03:00
John Preston 81790b2271 Notifications management moved to AuthSession.
Also implemented Global::WorkMode() as an base::Variable.
2017-03-06 18:38:15 +03:00
John Preston 83720d8789 Finalizing file renaming. 2017-03-04 13:23:56 +03:00
John Preston b0dbe9d353 Renamed / moved a bunch of files.
Next commit fixes the build.
2017-03-04 12:56:07 +03:00
John Preston 08167a6a91 Removed #include "stdafx.h" from all files.
Currently the build without implicitly included precompiled header
is not supported anyway (because Qt MOC source files do not include
stdafx.h, they include plain headers).

So when we decide to support building without implicitly included
precompiled headers we'll have to fix all the headers anyway.
2017-03-04 12:27:52 +03:00
John Preston 0838d21a05 Removed virtual type getters in mtpFileLoader. 2017-03-04 12:01:06 +03:00
John Preston bc76f5ee1e Debug feature added for overriding dc options.
Now you can type "endpoints" in Settings and choose a file with
a complete set of dc_options that will be used instead of built-in
or received through mtproto config till the end of current session.
2017-03-01 20:22:37 +03:00
John Preston f8318177b9 Platform-dependent file methods called async.
Some major platform-dependent file operations refactoring.
All methods like "open file", "open file with", "show in folder"
were moved to core/file_utilities module with platform-dependent
backends. All methods interacting with DesktopServices made async.
2017-02-28 18:03:38 +03:00
John Preston d254058690 Alpha 1.0.16: fighting crashes.
An attempt to fix a crash in MTP::Instance destructor + additional
logging there to find out how this crash happens.
2017-02-27 21:47:29 +03:00
John Preston 2fa2fa41c5 Some special logging added for crash catching.
Special FileLoader destructor crash added to find the code path
leading to crashes that could be observed through the reports.

Looks like progress() signal handlers enter event loop somehow.
2017-02-27 21:33:42 +03:00
John Preston 6c2f16e9a0 Some improvements in mtproto data processing.
Readability improvements. Checking maximum padding size.
Checking SHA1 hash before validating inner message length.
2017-02-27 12:51:03 +03:00
John Preston c207743338 Made base::lambda a copyable value type.
Now base::lambda can be copied and can wrap any immutable lambda.
For mutable lambdas there is base::lambda_once (which you're
supposed to call only once to pass data through lambda captures,
for example by using std::unique_ptr). Generally base::lambda is
passed by value and base::lambda_once is passed by rvalue reference.
2017-02-26 21:01:23 +03:00
John Preston d1e37864ac Closed beta 1000014001: fixed crash in MTP destructor.
Some of MTP::Instance::Private fields access _instance in
destructors. All that cleanup should be performed before the
Instance::~Instance() (which invalidates _private) is called.
2017-02-25 20:55:11 +03:00
John Preston bcec2f6b84 Closed beta 1000014001: fixed Xcode build. 2017-02-25 20:46:21 +03:00
John Preston 7d89b54d1c Ability to delete authorization keys added.
If we start logging in and we know, that some of the authorization
keys were read from the hard drive, not generated, we destroy all
the existing authorization keys and start generating new keys.
2017-02-25 19:48:22 +03:00
John Preston dd933cf61c MTP global state moved to MTP::Instance class.
Now there will be ability to start multiple mtproto instances.
2017-02-25 19:48:21 +03:00