Commit Graph

5850 Commits

Author SHA1 Message Date
levlam
6da151a402 Set DownloadManager callback in constructor. 2022-03-02 13:56:04 +03:00
levlam
4d7afaedbb Improve DownloadManager initialization. 2022-03-01 23:09:40 +03:00
levlam
119999e684 Improve log message. 2022-03-01 22:12:59 +03:00
levlam
a59e6b8ffe Add static_assert that flag in STORE_FLAG/PARSE_FLAG is bool. 2022-03-01 21:39:24 +03:00
Arseny Smirnov
17d38edc19 DownloadManager: load hints only after first search 2022-03-01 19:17:48 +01:00
Arseny Smirnov
9fdf346ee6 Revert "DownloadManager: use messages db only for search query"
This reverts commit e253f857bd.
2022-03-01 19:17:48 +01:00
levlam
68e1e7c0e8 Don't try to reload yet unreceived messages with unread reactions. 2022-03-01 20:50:28 +03:00
Arseny Smirnov
e253f857bd DownloadManager: use messages db only for search query 2022-03-01 16:41:22 +01:00
levlam
c9bd5d3651 Minor improvements. 2022-03-01 18:01:50 +03:00
Arseny Smirnov
99a1b6fff9 DownloadManager: bugfix 2022-03-01 15:39:05 +01:00
Arseny Smirnov
52abb9c5d5 DownloadManager create unique callback for each download 2022-03-01 15:34:51 +01:00
levlam
1fce347ee0 Add some logging in DownloadManager. 2022-03-01 16:29:08 +03:00
levlam
f6d71f8b9d DownloadManager: add files with correct size and downloaded_size. 2022-03-01 16:01:40 +03:00
levlam
60c35f2192 Add get_file_view for DownloadManager::callback. 2022-03-01 15:54:04 +03:00
levlam
9ead1f0b34 Add td_api::updateFileRemovedFromDownloads. 2022-03-01 15:44:25 +03:00
levlam
f1ffe765a5 Fix downloads search. 2022-02-28 19:10:43 +03:00
levlam
6821ad4ba8 Add DownloadManager::add_file_info. 2022-02-28 19:09:41 +03:00
levlam
3c54e37402 DownloadManager: store FileInfo in unique_ptr. 2022-02-28 18:55:05 +03:00
levlam
1f300c50e0 DownloadManager fixes. 2022-02-28 18:25:07 +03:00
Arseny Smirnov
08675f2df1 FileManager: support limit={KEEP,IGNORE}_DOWNLOAD_LIMIT in download method 2022-02-28 13:15:00 +01:00
levlam
3e4128fc1d Add triggers for file removal from Downloads and search text changes. 2022-02-28 02:43:53 +03:00
levlam
a3cef00551 DownloadManager fixes and improvements. 2022-02-27 18:23:06 +03:00
Arseny Smirnov
b2ae91ef48 DownloadManager: WIP 2022-02-26 21:54:01 +01:00
Arseny Smirnov
f13598ec83 DownloadManager: WIP 2022-02-26 19:56:43 +01:00
levlam
4524ba0380 Add FileReferenceManager::get_file_info. 2022-02-26 21:52:14 +03:00
Arseny Smirnov
29f8f79b16 DownloadManager: WIP 2022-02-25 23:18:07 +01:00
Arseny Smirnov
d4a4f5fb5d Proxy some updates about file to DownloadManger. 2022-02-25 23:17:30 +01:00
Arseny Smirnov
da436915c1 implement DownloadManagerCallback 2022-02-25 16:06:57 +01:00
levlam
21a71e6441 Minor improvements. 2022-02-25 16:18:23 +03:00
Arseny Smirnov
97b2d3edd2 Td: proxy queries to DownloadManager 2022-02-25 13:11:30 +01:00
Arseny Smirnov
a59f262b26 AddFileToDownloads method 2022-02-23 20:56:03 +01:00
Arseny Smirnov
e2c7601c2b DownloadManager: draft 2022-02-23 19:34:26 +01:00
levlam
408aa95f76 Remove preloading of users from database before adding them from binlog. It makes no sense, because users will be rewritten by binlog data anyway. 2022-02-22 23:06:37 +03:00
levlam
7af61c03af Fix get_channel_difference_if_needed for searchCallMessages. 2022-02-22 22:54:00 +03:00
levlam
4c3755cdce tg_cli: add FileId. 2022-02-19 02:42:18 +03:00
levlam
b20a98036f File Downloads API draft. 2022-02-18 01:37:04 +03:00
levlam
deafeee33b Guess format of sent stickers by file extension. 2022-02-17 20:45:58 +03:00
levlam
a5ed61393c Improve logging. 2022-02-17 18:42:50 +03:00
levlam
38fe0cc6fc Preload users from database before adding them from binlog. 2022-02-17 16:09:17 +03:00
levlam
e618758302 Add message sender to get_message_text source. 2022-02-17 15:48:39 +03:00
levlam
0fb84181ec Add mkv to the list of allowed video extensions. 2022-02-17 15:14:49 +03:00
levlam
e6aed3b99e Preload contact user to avoid loading all contacts. 2022-02-17 15:14:15 +03:00
levlam
9c62385b02 Don't load contacts after receiving a non-contact. It will be saved to database anyway and deleted from the saved list of contacts after it is loaded if appropriate. 2022-02-16 21:58:57 +03:00
levlam
8d48190748 Add warning if failed to find message edit pts. 2022-02-16 21:21:37 +03:00
levlam
24d2505f5b Improve pts extraction from updates. 2022-02-16 21:18:36 +03:00
levlam
b2077f72e4 Fix getWebPageInstantView for loaded web pages with non-loaded instant view. 2022-02-16 19:14:25 +03:00
levlam
786f2dc504 Use invoke after for reaction-related queries. 2022-02-16 18:36:55 +03:00
levlam
0646eb3f2e Combine reload_message_reactions queries. 2022-02-16 17:09:26 +03:00
levlam
ddf1bdc5c4 Simplify parse_message and on_get_message_from_database. 2022-02-16 01:39:20 +03:00
levlam
644971c314 Always save and update available_reactions_generation. 2022-02-15 23:25:00 +03:00
levlam
b4d5d00f1e Add available_reactions_generation and increase it each time reactions are shown or hidden in the chat. 2022-02-15 17:11:29 +03:00
levlam
ec4069b96a Sync reactions after getMessageAddedReactions if needed. 2022-02-14 11:34:12 +03:00
levlam
0d79671f15 Add MessagesManager::update_message_reactions. 2022-02-12 14:15:14 +03:00
levlam
15f27455c5 Move other big classes inside FlatHashMap to unique_ptr. 2022-02-11 19:27:32 +03:00
levlam
e64811ba31 Store unique_ptr instead of a big class in a FlatHashMap. 2022-02-11 18:26:43 +03:00
levlam
fc73b94a59 Fix outline of animated sticker sets. 2022-02-11 18:07:56 +03:00
levlam
1b8844b300 tg_cli: improve sticker set list output. 2022-02-11 18:02:11 +03:00
levlam
dc198f537c Ignore stickerPack with an empty emoticon. 2022-02-11 17:46:57 +03:00
levlam
aa1f7592e8 Support JSON response in get_simple_config. 2022-02-10 23:23:10 +03:00
levlam
b8ab910b81 Various improvements. 2022-02-10 23:01:28 +03:00
levlam
3d8e5e00e4 Allow arbitrary reaction order in setChatAvailableReactions. 2022-02-10 20:35:42 +03:00
levlam
d5d4f4acf7 Fix remaining FlatHashMap usages. 2022-02-10 18:03:03 +03:00
levlam
f5d8e4de83 Use table_remove_if. 2022-02-10 12:23:52 +03:00
levlam
9e6d106585 Minor improvements. 2022-02-10 11:55:32 +03:00
levlam
2b1314295d Check and fix half of FlatHashMap usages. 2022-02-10 00:59:52 +03:00
levlam
22ed61e1b7 More FlatHashMap usages. 2022-02-09 17:05:27 +03:00
levlam
b4fda2d45a Use FlatHashMap in mtproto and td_json_client. 2022-02-09 16:05:53 +03:00
levlam
4eacaa3ebd FlatHashMap improvements. 2022-02-09 03:08:18 +03:00
Arseny Smirnov
e3a5b29d20 FlatHashMap: use same code for const and non-const methods 2022-02-08 19:38:09 +01:00
levlam
c88955a8b7 Load unknown messages to process updateMessageReaction. 2022-02-08 18:48:09 +03:00
levlam
7f7b3b6653 Add separate ChainId(DialogId) constructor. 2022-02-08 17:30:06 +03:00
levlam
367a0101d2 Send updateChatUnreadReactionCount if can't sent updateMessageUnreadReactions. 2022-02-08 14:56:25 +03:00
levlam
b62ced6d95 Minor improvements. 2022-02-08 00:42:53 +03:00
levlam
bcc2adeb47 Fix includes and formatting. 2022-02-08 00:04:34 +03:00
Arseny Smirnov
86bceb2972 td: replace most of std::unordered_map usages to td::FlatHashMap 2022-02-07 21:21:31 +01:00
levlam
822257b90a Resend requests on CONNECTION_NOT_INITED and CONNECTION_LAYER_INVALID errors. 2022-02-07 22:05:01 +03:00
levlam
5d58734568 tg_cli: simplify sending of photos with caption. 2022-02-06 01:42:43 +03:00
levlam
77060757eb Improve ordering of all message send requests. 2022-02-06 00:56:19 +03:00
levlam
f3bb075f62 Use InvokeAfter for all queries changing sticker sets. 2022-02-06 00:16:16 +03:00
levlam
b845766bd1 Add class ChainId. 2022-02-05 23:28:43 +03:00
levlam
46e23a407f Use int32 ro store last/next/total_timeout. 2022-02-04 17:05:35 +03:00
levlam
1ffb1ebb2f Remove unused Td::create_net_actor. 2022-02-04 16:34:11 +03:00
levlam
17fb8ff6fc Replace SendSecretMessageActor with a function. 2022-02-04 16:25:37 +03:00
levlam
6e82e51243 Remove all NetActorOnce usages. 2022-02-04 00:46:10 +03:00
levlam
4bfdd1e7a8 Support empty callback in SequenceDispatcher. 2022-02-04 00:43:31 +03:00
levlam
649f2b85f5 Rename chains to chain_ids in NetQuery. 2022-02-03 22:32:47 +03:00
levlam
0b33522821 Improve ChainScheduler. 2022-02-03 22:01:09 +03:00
levlam
634767d986 Optimize MultiSequenceDispatcherImpl::on_resend usage. 2022-02-03 21:21:15 +03:00
levlam
1ad5658aee Remove "using ChainId". 2022-02-03 18:07:48 +03:00
levlam
8b92e8f978 Optimize checked insert to std::map. 2022-02-03 16:24:09 +03:00
levlam
9881a4dbe2 Fix format::as_hex usage. 2022-02-03 14:34:10 +03:00
levlam
877b5fce00 Allow to set again the same big reaction. 2022-02-03 13:47:18 +03:00
levlam
02b99d0fbf Remove includes of SequenceDispatcher.h from headers. 2022-02-01 19:34:14 +03:00
Arseny Smirnov
ad38f712e8 SequenceDispatcher: hide usage into NetQueryDispatcher 2022-02-01 18:51:36 +03:00
levlam
950876b496 Minor improvements. 2022-02-01 18:25:02 +03:00
Arseny Smirnov
7c9d698023 SequenceDispatcher: bugfixes 2022-02-01 17:05:23 +03:00
Arseny Smirnov
da4d6318fc SequenceDispatcher: distribute food limits to net queries in the same chain and with the same tl_constructor 2022-02-01 16:06:48 +03:00
Arseny Smirnov
24766fdad8 ChainScheduler: pass new test 2022-02-01 16:04:58 +03:00
levlam
19daec8ca1 Increase MessageUnsupported version. 2022-02-01 13:26:23 +03:00
levlam
92c2a9c4e5 Update version to 1.8.1. 2022-01-31 22:07:31 +03:00
levlam
c783115974 Fix warnings. 2022-01-31 22:00:00 +03:00
levlam
d5d6e520e0 Fix creation of WEBM documents. 2022-01-31 20:41:11 +03:00
levlam
e503195e0e Upload WEBM stickers as documents. 2022-01-31 20:22:07 +03:00
levlam
8e09fab0e7 Temporarily use old MultiSequenceDispatcher. 2022-01-31 19:21:44 +03:00
levlam
ee3c674df1 Fix setChatAvailableReactions. 2022-01-31 18:59:39 +03:00
levlam
d348f205f2 Improve handling of invalid values in setOption. 2022-01-31 18:57:37 +03:00
levlam
b1b945e239 Minor fixes. 2022-01-31 15:56:44 +03:00
levlam
ccd450789b Fix message index mask. 2022-01-31 04:04:20 +03:00
levlam
24f6ba4faf Improve updates order and logging in update_message. 2022-01-31 03:27:29 +03:00
levlam
a4d80c76b3 Allow middle dot in hashtags. 2022-01-31 02:19:17 +03:00
levlam
d3c712e660 Increase maximum allowed TLD length in email address. 2022-01-30 13:51:28 +03:00
levlam
462797b48a Disable local can_get_added_reactions in private chats. 2022-01-30 13:48:32 +03:00
levlam
fe4232ca79 Add MessageReactions logging. 2022-01-30 13:24:27 +03:00
levlam
abb2c1a105 Ignore reaction updates while setting reaction. 2022-01-30 12:55:27 +03:00
levlam
3150b3d491 Add readAllChatReactions. 2022-01-30 12:37:24 +03:00
levlam
d187d14660 Treat video stickers as stickers. 2022-01-30 11:59:37 +03:00
levlam
3739c5b92f Replace translateMessage with translateText. 2022-01-29 23:43:57 +03:00
levlam
e1bd34cda8 Update scheme. 2022-01-29 01:53:50 +03:00
levlam
41a5248169 Read unread reactions. 2022-01-28 20:27:39 +03:00
levlam
1cf2a9e9c9 Check that unread_reaction_count was changed before setting it. 2022-01-28 19:59:18 +03:00
levlam
5098dac338 Add and use has_unread_message_reactions. 2022-01-28 19:57:50 +03:00
levlam
fd8d15e2d2 Add td_api::searchMessagesFilterUnreadReaction. 2022-01-28 19:12:33 +03:00
levlam
e7406475ff Fix compilation errors. 2022-01-28 19:12:20 +03:00
levlam
71a8abb92d Implement Chat.unread_reaction_count. 2022-01-28 18:39:13 +03:00
levlam
e5084491f6 Add Message.unread_reactions. 2022-01-28 17:10:17 +03:00
Arseny Smirnov
cab16967d0 SequenceDispatcher: calculate session_rand from first chain id 2022-01-28 17:49:26 +03:00
Arseny Smirnov
c202974d47 SequenceDispatcher: set error to all NetQueries at tear_down 2022-01-28 17:43:22 +03:00
Arseny Smirnov
452f60be0b SequenceDispatcher: support multiple chains 2022-01-28 17:06:54 +03:00
Arseny Smirnov
355c2950ad ChainScheduler - new implementation of SequenceDispatcher 2022-01-28 15:50:59 +03:00
levlam
4c98811b03 Reload linked chat full info when a chat is opened. 2022-01-27 18:53:03 +03:00
levlam
c0a2c0de8b Use get_message_active_reactions instead of get_dialog_active_reactions if appropriate. 2022-01-27 18:17:29 +03:00
levlam
e9a155a2a6 Fix MessagesManager::get_message_available_reactions for private chats. 2022-01-27 17:00:44 +03:00
levlam
274d0babb8 Add Message.can_get_added_reactions. 2022-01-27 15:58:20 +03:00
levlam
1fdfd036bb Use get_dialog_active_reactions if appropriate. 2022-01-27 15:25:41 +03:00
levlam
f00e7aae59 Fix empty reaction in setMessageReaction. 2022-01-27 14:19:51 +03:00
levlam
4e4d7c1e83 Fix inputGroupCallStream flags. 2022-01-27 01:59:36 +03:00
levlam
6ebb83a194 Improve class names and documentation. 2022-01-27 01:52:21 +03:00
levlam
81a3544cc8 Drop main auth key if receive 401 for temporary auth key with an error different from AUTH_KEY_PERM_EMPTY and SESSION_PASSWORD_NEEDED. 2022-01-26 21:50:42 +03:00
levlam
fd4b9a5a79 Handle missing updateMessageReactions in response to getMessagesReactions as a message without reactions. 2022-01-26 20:06:27 +03:00
levlam
f9c6fb14f6 Relaod message reactions if failed to set reaction. 2022-01-26 18:48:46 +03:00
levlam
79f1890613 Use td_api::StickerType instead of td_api::StickerFormat. 2022-01-26 17:53:38 +03:00
levlam
eaf859409e Check MIME-type of received stickers. 2022-01-26 17:30:57 +03:00
levlam
262d63564d Fix misprint. 2022-01-26 17:25:55 +03:00
levlam
97e0288363 Check that reaction is among available reactions before set it locally. 2022-01-26 16:51:47 +03:00
levlam
ba5c326ba8 Support sending big reactions. 2022-01-26 16:41:41 +03:00
levlam
1901eafe8a Add td_api::getMessageAvailableReactions. 2022-01-26 15:25:03 +03:00
levlam
6a288e2516 Hide reactions if they are disabled in the chat. 2022-01-26 13:49:17 +03:00
levlam
5edc92dd72 Update recent reaction choosers in setMessageReaction. 2022-01-26 12:50:41 +03:00
levlam
bad018bc32 Sort message reactions by the number of choosers. 2022-01-26 12:01:14 +03:00
levlam
9eb3a9a403 Remove chosen reaction when it is again. 2022-01-26 11:02:20 +03:00