Commit Graph

596 Commits

Author SHA1 Message Date
John Preston
76593b0f3d Fix migrating background image. 2020-06-26 13:23:10 +04:00
John Preston
9703f7460a Fix build on Linux. 2020-06-26 12:27:54 +04:00
John Preston
5d6a494934 Move some more settings to Core::App. 2020-06-25 16:25:53 +04:00
John Preston
0bc2bfe630 Don't allow two same accounts being logged in. 2020-06-24 13:32:07 +04:00
John Preston
4d65df6ca2 Remove legacy temp download folder. 2020-06-23 21:53:44 +04:00
23rd
e318a7d65f Simplified ranges::find_if with ranges::any_of and ranges::none_of. 2020-06-23 21:53:43 +04:00
John Preston
f129b6b90d Fix invalid cache settings being read. 2020-06-23 21:53:43 +04:00
John Preston
28570b45e3 Fix working with settings before Domain::started. 2020-06-23 21:53:43 +04:00
John Preston
3bb352e0e5 Fix build and working on macOS. 2020-06-23 21:53:42 +04:00
John Preston
0824d2da20 Reset some settings on full logout. 2020-06-23 21:53:42 +04:00
John Preston
2635ca33f8 Move background to global settings. 2020-06-23 21:53:42 +04:00
John Preston
997913be25 One Window::Notifications system for all sessions. 2020-06-23 21:53:42 +04:00
John Preston
83538675ce Move a lot of settings to Core::Settings. 2020-06-23 21:53:42 +04:00
John Preston
4d6cc58f0d Move session settings to main_session_settings. 2020-06-23 21:53:42 +04:00
John Preston
3a5ede534e Count all accounts in Core::App().unreadBadge. 2020-06-23 21:53:41 +04:00
John Preston
357caf8007 Keep separate MTP::Config's for separate accounts. 2020-06-23 21:53:41 +04:00
23rd
3ef45f5431 Fixed starting with touchbar. 2020-06-23 21:53:41 +04:00
John Preston
c83659f0c7 Fix logouting from the passcode. 2020-06-23 21:53:41 +04:00
John Preston
bc144377c0 Support logout of a secondary account. 2020-06-23 21:53:41 +04:00
John Preston
ab5796c117 Several working accounts together. 2020-06-23 21:53:40 +04:00
John Preston
6fc5e22882 Allow several accounts in Core::App. 2020-06-23 21:53:40 +04:00
John Preston
dddd355f6c Fix language and theme writing / reading. 2020-06-23 21:53:40 +04:00
John Preston
f450f81215 Remove non-UI calls to App::main. 2020-06-23 21:53:40 +04:00
John Preston
0ad7dcaef9 Remove MTP::MainInstance() global access point. 2020-06-23 21:53:40 +04:00
John Preston
7f09da9e32 Use MTP::Sender in Intro. 2020-06-23 21:53:39 +04:00
John Preston
0b028b959b Move updates handling MainWidget -> Api::Updates. 2020-06-23 21:53:39 +04:00
John Preston
ea86433be5 Remove some activeAccount() calls. 2020-06-23 21:53:39 +04:00
John Preston
598fb67cdf Remove Session::Exists() global access point. 2020-06-23 21:53:39 +04:00
John Preston
5f8d22f1f2 Remove Auth() global access point. 2020-06-23 21:53:39 +04:00
John Preston
7892ba97e6 Fix clearing storage_account files on logout. 2020-06-23 21:53:39 +04:00
John Preston
ad4afe9293 Move session data localstorage -> storage_account. 2020-06-23 21:53:39 +04:00
John Preston
fc174f742a Move stickers code to Data::Stickers class. 2020-06-23 21:53:38 +04:00
John Preston
4b354b0928 Use Main::Session in download/upload. 2020-06-23 21:53:38 +04:00
John Preston
bdbcd8e540 Use Main::Session in entities parsing. 2020-06-08 12:05:17 +04:00
23rd
d4f2b8dd0e Fixed ability to edit media with sticker.
Regression was introduced in efa4deef6a.
2020-06-05 19:46:34 +04:00
John Preston
bfafdd5b38 Fix crash in streaming+loading of a document. 2020-06-04 12:16:44 +04:00
John Preston
f066e0f05a Use Data::CloudImage for userpics. 2020-06-01 18:09:33 +04:00
John Preston
ae9ed820ee Fix sticker set icons display. 2020-06-01 18:09:33 +04:00
John Preston
803593cd8d Change Stickers::Set from value to object type. 2020-06-01 18:09:33 +04:00
John Preston
74ef8104a7 Fix photo edit caption box, remove 's' size. 2020-06-01 18:09:32 +04:00
John Preston
700d3db4cc Correctly unload heavy parts on quit. 2020-06-01 18:09:32 +04:00
John Preston
e27d2bc2d5 Move photo data to Data::PhotoMedia. 2020-06-01 18:09:32 +04:00
John Preston
f4ed2c26ba Save video thumbnail location to local storage. 2020-06-01 18:09:32 +04:00
John Preston
3c9ca2eb94 Load and show video thumbnails in the panel. 2020-06-01 18:09:31 +04:00
John Preston
33c1c48ad9 Update API scheme to layer 114. 2020-06-01 18:09:31 +04:00
John Preston
58f82620e0 Simplify media overview layouts. 2020-06-01 18:09:31 +04:00
John Preston
fb322b5fc5 Use empty Storage::Cache::Key as nullopt. 2020-06-01 18:09:31 +04:00
John Preston
cbb9657044 Fix download task finalizing. 2020-06-01 18:09:30 +04:00
John Preston
3797753d16 Support different location types for thumbnails. 2020-06-01 18:09:30 +04:00
John Preston
956c3af0ae Start DocumentData::thumbnail move to DocumentMedia. 2020-06-01 18:09:30 +04:00
John Preston
ff6365ec72 Fix crash in still downloaded ~DocumentData. 2020-06-01 18:09:30 +04:00
John Preston
97bab388ea Use rpl for file download progress notifications. 2020-06-01 18:09:30 +04:00
John Preston
33f4946242 Start using document bytes from DocumentMedia. 2020-06-01 18:09:30 +04:00
John Preston
bdd3c51ab8 Move inline thumbnail image to DocumentMedia. 2020-06-01 18:09:30 +04:00
John Preston
7db53599e8 Use Data::DocumentMedia to store good thumbnails. 2020-06-01 18:09:29 +04:00
John Preston
6f760d513e Add a checkbox to disable taskbar flash.
Also add ability to set urgent flag for the window on Linux.

Fixes #223, fixes #897, fixes #906.
2020-05-12 14:16:24 +04:00
John Preston
36997f084a Automatically load and apply old emoji set by id. 2020-05-08 11:22:22 +04:00
VictorienXP
85fcec2fb5 Add .opus and .oga files as song formats 2020-04-21 14:04:51 +04:00
John Preston
2ad48f18f2 Use only safe file saving in localstorage. 2020-04-02 18:31:15 +04:00
John Preston
49111814e4 Add fallback codepath for QSaveFile::open failure. 2020-03-30 13:46:58 +04:00
John Preston
4881981cf6 Enable / disable side bar based on filters. 2020-03-27 20:36:03 +04:00
John Preston
d5bd9fa54d View filter box, removing chats and chat types. 2020-03-27 20:36:02 +04:00
John Preston
c83e297554 Implement dice media display. 2020-03-27 20:36:02 +04:00
John Preston
71f7aae948 Replace dialogs mode with filters. 2020-03-27 20:36:01 +04:00
John Preston
6777b20453 Beta version 1.9.20: Fix build on GCC. 2020-03-14 14:11:41 +04:00
John Preston
6bf3dd10c1 Make checked read of sticker sets order.
In case local data is corrupted previously it lead to OOM crash.
2020-03-13 22:53:59 +04:00
John Preston
14aa455164 Fix freeze in complex file location saving.
Fixes #6986.
2020-03-13 22:53:59 +04:00
John Preston
6fbd0d7deb Fix logout on second relaunch.
Fixes #7279.
2020-02-25 07:58:29 +04:00
23rd
bb8aead078 Added sequential background dictionary loader.
- Moved the Loader from the dictionaries manager to the spellchecker
 common space as a DictLoader.
2020-02-24 18:48:33 +03:00
23rd
efdf5f1767 Moved producer of state description to CloudBlob. 2020-02-24 18:48:33 +03:00
23rd
8ca0b614d7 Moved loader of emoji sets and dictionaries to CloudBlob. 2020-02-24 18:48:33 +03:00
23rd
704dcc8d65 Moved emoji sets and dictionaries loader states to CloudBlob.
- Moved CloudBlob to second namespace.
2020-02-24 18:48:33 +03:00
23rd
9f4d05b04c Moved emoji sets from lib_ui. Added parent struct to storage_cloud_blob. 2020-02-24 18:48:33 +03:00
23rd
08cd7450ff Added storage/storage_cloud_blob.
- This file is needed to store same code parts related
 to management of dictionaries and emoji sets.
 - Moved extracting of zip files to storage_cloud_blob.
2020-02-24 18:48:33 +03:00
John Preston
60612635ef Use QSaveFile to write sensitive settings / data. 2020-02-24 18:54:16 +04:00
John Preston
3bb9e8c7eb Fix power outage logout only by fsync. 2020-02-14 18:12:08 +04:00
John Preston
555fe70df3 Don't delete old localstorage file copies. 2020-02-13 18:39:44 +04:00
John Preston
356e3c6907 Enable night mode by default on Mac App Store. 2020-02-11 16:00:19 +04:00
23rd
7b36c91e0d Fixed insertion of 11th image from clipboard in SendFilesBox. 2020-01-28 16:56:03 +03:00
John Preston
1bcde1b55c Pass cdn_supported flag to upload.getFile. 2020-01-23 10:46:57 +03:00
23rd
e266dc153b Implemented ability to add more than 1 file to albums via SendFilesBox. 2020-01-23 10:09:34 +03:00
23rd
d1d5312ead Moved searching of sticker mimes to single place. 2020-01-23 10:09:33 +03:00
23rd
5f8c2f90ff Added button to add new files in SendFilesBox to album only. 2020-01-23 10:09:33 +03:00
23rd
efa4deef6a Moved media editing via FileDialog to separate static method. 2020-01-23 10:09:33 +03:00
John Preston
960f50824d Fix one more crash in CDN file download.
The sessionTimedOut could remove a session right between a request
for a file part and a request for additional cdn file hashes.

In this case requestData.sessionIndex was not updated and this
was leading to an assertion violation in changeRequestedAmount.
2020-01-22 16:13:50 +03:00
John Preston
2d7f6fc2e7 Removed old lib_storage sources. 2020-01-21 18:47:57 +03:00
John Preston
98bc7ce49b Revert "Pass cdn_supported flag to upload.getFile."
This reverts commit 7751f383ca.
2020-01-20 13:39:18 +03:00
John Preston
12873f8be0 Fix crash in CDN file download. 2020-01-20 13:04:12 +03:00
John Preston
7751f383ca Pass cdn_supported flag to upload.getFile. 2020-01-20 13:01:38 +03:00
John Preston
d24735b217 Fix possible crash in CDN file loading. 2020-01-17 17:45:43 +03:00
John Preston
616957e46f Add file size limit to autoplay settings. 2019-12-24 13:09:04 +03:00
John Preston
fa4d8f2fbd Support priorities in download tasks. 2019-12-23 12:37:03 +03:00
John Preston
8ae6156477 Fix video quality when opening from chat. 2019-12-23 11:10:11 +03:00
John Preston
ae8fb14f9e Use 8 seconds timeout for request duration. 2019-12-06 10:05:38 +03:00
John Preston
7fb24d77c0 Check request duration when adding sessions. 2019-12-05 16:38:28 +03:00
John Preston
e426f2895b Add download sessions if it works fast enough. 2019-12-05 14:46:28 +03:00
John Preston
ee94e78533 All mtproto downloads using DownloadMtprotoTask. 2019-12-05 11:32:33 +03:00
John Preston
4611727ab9 Rewrite webFileLoader without Storage::DownloadManager. 2019-12-04 15:15:58 +03:00
John Preston
f522cc9444 Load streaming parts using Storage::DownloadManager. 2019-12-04 10:42:55 +03:00
John Preston
3ae2986c25 Allow variable count of download sessions. 2019-12-04 09:51:21 +03:00
John Preston
fb86bb579b Correctly track DC index in Downloader-s. 2019-12-03 15:45:35 +03:00
John Preston
12f5ccaaa5 Use vector queues in mtproto file downloader. 2019-12-03 10:25:27 +03:00
John Preston
91f50e8bdc Move some more code to lib_mtproto. 2019-12-02 16:11:22 +03:00
John Preston
d5718f96b8 First working auth by QR code. 2019-11-29 15:36:04 +03:00
John Preston
cfe12f773f Move some modules to lib_mtproto. 2019-11-18 12:28:14 +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
09a7daf164 Update submodules. 2019-10-19 12:27:56 +04:00
John Preston
a6c84c36c0 Use layers and boxes from lib_ui. 2019-10-19 12:27:52 +04:00
John Preston
246c45ce0e Use lib_ui from submodule. 2019-10-19 12:27:28 +04:00
John Preston
849deb57e2 Move many widget classes to lib_ui. 2019-10-01 23:59:46 +03:00
John Preston
c5845f17ae Remove twidget header. 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
ee5423762a Generate previews for cloud theme links. 2019-09-09 14:56:05 +03:00
John Preston
51c1dc20e1 Unregister randomId if send message fails. 2019-09-09 11:13:41 +03:00
John Preston
9c86f0e0a5 Save themes, apply and close editor on save. 2019-09-06 19:31:07 +03:00
John Preston
910f16312c Show not supported themes placeholders. 2019-09-06 19:31:07 +03:00
John Preston
79106e0c01 Correctly show custom themes in list. 2019-09-06 19:31:07 +03:00
John Preston
7485f0c960 Don't change real theme when editing. 2019-09-06 19:31:07 +03:00
John Preston
03bdd80b2f Open theme editor for existing themes. 2019-09-06 19:31:07 +03:00
John Preston
6343221d7b Remove many includes from stdafx.pch. 2019-09-06 19:31:07 +03:00
John Preston
4929de2bfb Apply cloud themes. 2019-09-06 19:31:06 +03:00
John Preston
229bc56cc8 Upload saved theme to the cloud. 2019-09-06 19:31:06 +03:00
John Preston
a3e993253c Keep colorized theme in editor. 2019-08-29 10:01:28 +03:00
John Preston
c2117e7722 Save embedded themes accent colors. 2019-08-27 19:10:37 +03:00
John Preston
caef7dde24 Bundle silent and scheduled to Api::SendOptions. 2019-08-27 19:10:37 +03:00
John Preston
694f771131 Allow to send scheduled messages instantly. 2019-08-27 19:10:37 +03:00
John Preston
63203ecc00 Fix int32 overflow in local storage stats. 2019-08-09 11:51:35 +01:00
John Preston
93a52bb66e Move some settings from global to Session. 2019-08-09 11:50:49 +01:00
John Preston
708b1d7ad4 Add 'Loop animated stickers' setting. 2019-08-09 11:50:49 +01:00
John Preston
abf49e1672 Update API scheme. 2019-08-09 11:50:49 +01: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
873b77cf40 Use UserData::isBot where applicable. 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
c5df4db621 Fix possible race conditions in msgid(). 2019-07-15 16:00:30 +02:00
John Preston
8135f4b427 Support base64 encoding of the secret. 2019-07-15 15:59:20 +02:00
John Preston
f2b3d9714f Fix sticker sending from clipboard. 2019-07-15 14:12:28 +02:00
John Preston
567bf60644 Use getters in MTP classes. 2019-07-05 16:23:07 +02:00
John Preston
b1807938ad Remove legacy langpacks. 2019-07-04 14:25:16 +02:00
John Preston
0a63eac4f6 Generate good thumbnail for animated stickers. 2019-07-04 10:20:36 +02:00
John Preston
7034df49e9 Fix sending of .tgs stickers. 2019-07-03 13:03:01 +02:00
John Preston
3b645422ff Implement animated stickerset thumbnails. 2019-07-02 14:43:17 +02:00
John Preston
4a7b5a8e01 Fix caching for large sticker area. 2019-07-01 17:57:37 +02:00
John Preston
dc102bd9e8 Finish working with localstorage before ~AuthSession. 2019-06-22 12:36:35 +02:00
John Preston
4917ca7b32 Remove all legacy global namespace langs. 2019-06-21 11:06:52 +02:00
John Preston
87fc066e67 Use tr:: instead of lang(). 2019-06-21 11:06:51 +02:00
John Preston
5e3734d7bf ReportSpamPanel -> HistoryView::ContactStatus. 2019-06-21 11:06:45 +02:00
John Preston
30dea3a2e7 Use isConstant bool instead of ContactStatus enum. 2019-06-21 11:06:45 +02:00
John Preston
d9e93fb5cc Fix possible crash in auth session destruction. 2019-06-17 14:23:50 +02:00
John Preston
a547f80ae9 Rename Window::Controller to Window::SessionController. 2019-06-06 13:21:40 +03:00
John Preston
f91e11efc9 Fix crash in absent file reading. 2019-06-05 14:27:33 +03:00
John Preston
04e3b250e7 Keep track of fully cached media files. 2019-06-04 14:30:44 +03:00
John Preston
46d8d9f97a Remove CancelledFileLoader hack. 2019-06-04 14:30:43 +03:00
John Preston
eb438e35ee Remove old download priority arguments. 2019-06-04 14:30:43 +03:00
John Preston
b2895a39ed Register streaming loaders in Storage::Downloader. 2019-06-04 14:30:43 +03:00
John Preston
cca906d383 Use ready parts from loader in streaming. 2019-06-04 14:30:43 +03:00
John Preston
8704f6efd0 Use simple loader for non-streamable file types. 2019-06-04 14:30:43 +03:00
John Preston
e1114530ab Working code for streaming downloader. 2019-06-04 14:30:43 +03:00
John Preston
ebf2a678b1 Use a special FileLoader for streamed documents. 2019-06-04 14:30:43 +03:00
John Preston
8c0cd9b9e9 Prepare Media::Streaming::Reader to be shared. 2019-06-04 14:30:43 +03:00
John Preston
8b804d1995 Allow sending animated stickers. 2019-05-28 17:45:30 +02:00
John Preston
c4aac5fa0e Update API scheme to layer 100. 2019-05-27 15:09:06 +02:00
23rd
47910b2ae1 Added '-scale' command-line argument for custom scale.
- Fixed #5272.
 - Fixed #5365.
 - Fixed #6055.
2019-05-27 14:10:36 +02:00
John Preston
0247e876df Remove locally saved empty histories. 2019-05-03 15:18:18 +04:00
John Preston
08bddc5579 Move messages data to AuthSession. 2019-05-01 16:11:42 +04:00
John Preston
9bf8a8108d Comment out non-folder feed code. 2019-04-25 14:16:30 +04:00
23rd
37af963717 Fixed work with _msgIdToEdit in FileLoadTask.
- Added check is allowed media editing in paintEvent.
 - Fixes #5885.
2019-04-06 11:24:11 +04:00
John Preston
456a949d01 Fix working with document thumbnails. 2019-04-04 00:08:05 +04:00
23rd
5d8888bb8b Refactored code.
- Refactored passing message id to edit media.
 - Removed get/setEditMedia from mainwidget.
 - Combined onEditMedia and onSendFileConfirm in single method.
 - Added argument in FileLoadTask to pass message id to edit media.
 - Renamed flags in apiwrap.
 - Added check for allowing edit media when use clipboard.
 - Removed unused fileIsValidForAlbum.
 - Removed LOGs.
 - Replaced _isNotAlbum with _isAlbum.
 - Removed _viaRemoteContent.
 - Removed _newMediaPath.
 - Added empty() to MessageGroupId.
2019-04-02 18:14:12 +04:00
23rd
94964c35ce Fixed false definition FileMediaInformation as Image. 2019-04-02 18:14:12 +04:00
23rd
d605b18ec0 Fixed checking for song without file path. 2019-04-02 18:14:12 +04:00
23rd
25e3674819 Added allowsEditMedia() to Media. Slightly refactored. 2019-04-02 18:14:12 +04:00
23rd
c84f99cf3a Fixed uploading edit media with thumbnails. 2019-04-02 18:14:12 +04:00
23rd
1ed83cf193 Fixed subscribeToUploader. 2019-04-02 18:14:12 +04:00
23rd
be58e23775 Init edit media. 2019-04-02 18:14:11 +04:00
John Preston
d3bf489bea Improve base::binary_guard interface. 2019-04-02 14:33:52 +04:00
John Preston
8759d637ff Use StorageFileLocation in mtpFileLoader. 2019-03-29 14:24:07 +04:00
John Preston
3f49796c43 Fix file reference updating. 2019-03-29 14:24:07 +04:00
John Preston
aa8f62da9d Support new ('modern') API file locations. 2019-03-29 14:24:07 +04:00
John Preston
eba2a98703 Add general StorageFileLocation abstraction. 2019-03-29 14:24:06 +04:00
John Preston
386600baf9 Save and load sticker set thumbnails. 2019-03-24 12:12:44 +04:00
John Preston
0d888eea85 Fix local cache time limit setting storing.
Fixes #5611.
2019-03-14 13:22:42 +04:00
John Preston
13a9b967e9 Use user phrases for support accounts. 2019-03-12 14:38:59 +04:00
John Preston
01d763eed1 Use DocumentData::getDuration for all types. 2019-03-11 12:08:15 +04:00
John Preston
e631d98230 Implement media cache management. 2019-03-11 12:08:09 +04:00
John Preston
648cd44ddd Display correct video / music state. 2019-03-11 12:08:08 +04:00
John Preston
2208621050 First version of caching in media streaming. 2019-03-11 11:49:54 +04:00
John Preston
f133dd396c Return pair<iterator,bool> from flat_set::emplace. 2019-03-11 11:49:54 +04:00
John Preston
fe618bd652 Use crl::time/now instead of TimeMs/getms. 2019-02-19 11:06:33 +04:00
John Preston
d208236994 Accept binary_guard in crl::guard(). 2019-02-17 15:56:07 +04:00
John Preston
98cb85df66 Polymorphic classes without virtual dtor warning. 2019-02-15 15:55:34 +04:00
John Preston
032694ad9e Move files to media/audio and media/clip. 2019-02-13 15:41:33 +03:00
John Preston
95565c39ed Upload wallpapers to the cloud. 2019-02-08 19:20:08 +03:00
John Preston
e2f0886950 Add option to blur chat background. 2019-02-07 19:36:30 +03:00
John Preston
5ca12a73c3 Use new HistoryWallPaper media type for wallpaper. 2019-01-29 19:26:19 +03:00
John Preston
fd8e9dad92 Fix pattern wallpapers with themes. 2019-01-29 14:52:33 +03:00
John Preston
b6edf4561d Add support for pattern wallpapers. 2019-01-29 14:52:33 +03:00
John Preston
f506a5ea6c Save wallpaper settings locally. 2019-01-29 14:52:33 +03:00