Commit Graph

7927 Commits

Author SHA1 Message Date
levlam
83648d58d4 Remove now unneeded has_qts_messages checks. 2023-05-11 21:54:28 +03:00
levlam
da91824003 Simplify OrderedMessages::insert. 2023-05-11 20:31:09 +03:00
levlam
432ee4c2c4 Remove now redundant parameters have_previous/have_next from add_message_to_dialog. 2023-05-11 20:27:00 +03:00
levlam
2f091e93cc Improve variable names. 2023-05-11 19:54:48 +03:00
levlam
fca143dca8 Pass from_update == true first time when adding failed_to_send messages. 2023-05-11 19:43:30 +03:00
levlam
87b658f2e2 Explicitly attach messages to the next in on_get_history. 2023-05-11 19:21:58 +03:00
levlam
042c75df63 Mark on_get_message parameters as const. 2023-05-11 17:52:53 +03:00
levlam
f1a12e26b2 Early drop unneeded reply_markup_message_id. 2023-05-11 16:54:17 +03:00
levlam
8495dbe580 Always ignore non-personal RemoveKeyboard/ForceReply keyboards. 2023-05-11 16:37:07 +03:00
levlam
492db8032e Immediately call add_scheduled_message_to_dialog for scheduled messages. 2023-05-11 15:46:54 +03:00
levlam
70b3057627 Avoid redundant message_id checks; it has already been checked. 2023-05-11 13:49:22 +03:00
levlam
bbde50ba03 Use "message" for unique_ptr<Message> variables. 2023-05-11 13:26:41 +03:00
levlam
0cc22ca3da Fix saving of are_media_timestamp_entities_found. 2023-05-11 13:20:39 +03:00
levlam
666af51345 Add MessagesManager::fix_new_message. 2023-05-11 13:12:04 +03:00
levlam
1a4e91a207 Don't try to load from database previously failed to load dialogs in add_dialog. 2023-05-11 12:14:25 +03:00
levlam
ed127c1b8d Add MessagesManager::add_dialog_for_new_message. 2023-05-11 12:12:43 +03:00
levlam
7e82f0f860 Move expected logging from ERROR to INFO. 2023-05-11 00:31:15 +03:00
levlam
372509e838 Always call on_message_deleted_from_database from delete_message_from_database. 2023-05-10 23:26:50 +03:00
levlam
151291dc50 Remove redundant assignments. 2023-05-10 23:05:34 +03:00
levlam
c612ef6764 Explicitly create Dialog before adding a message to it. 2023-05-10 20:56:33 +03:00
levlam
11210427a4 Explicitly pass from_database to add_message_to_dialog. 2023-05-10 20:41:02 +03:00
levlam
cc6082c458 Check that last and last_new messages aren't changed by bots. 2023-05-10 20:00:01 +03:00
levlam
d672fa9faa Check that database message ids aren't set for bots. 2023-05-10 19:35:11 +03:00
levlam
04d9879607 Add OrderedMessages::empty(). 2023-05-10 18:57:17 +03:00
levlam
887b69ec0e Remove unused field. 2023-05-10 15:41:57 +03:00
levlam
de22159b7f Don't keep exact remote location for bots. 2023-05-10 15:29:38 +03:00
levlam
37c46b8b12 Increase min_gzipped_size for bots. 2023-05-10 02:06:24 +03:00
levlam
59fcab80a1 Don't send updateMessageContent for yet unsent messages to bots. 2023-05-10 02:00:20 +03:00
levlam
6c5c26db7f Immediately ignore user photo if it's identifier is still the same. 2023-05-10 01:50:06 +03:00
levlam
b41bb654e4 Drop via_bot when recending failed to send message. 2023-05-10 01:13:32 +03:00
levlam
e00c66123a Reopen sessions after receiving MTPROTO_CLUSTER_INVALID. 2023-05-09 01:10:14 +03:00
levlam
c41fb7f6df Drop reopen_sessions_after_get_config_ after successful session reopen. 2023-05-09 01:08:45 +03:00
levlam
ce76e164a9 Update basic group position when it is joined or left. 2023-05-08 17:29:50 +03:00
levlam
ac8c4718d3 Reload information about empty joined chats once to check whether they are still joined. 2023-05-08 17:17:35 +03:00
levlam
a2439e9f55 Sort directly received IP addresses. 2023-05-07 01:43:00 +03:00
levlam
a05c86d6ec Improve replies for bots. 2023-05-06 21:47:10 +03:00
levlam
7eb512a0b2 Disable ordered messages for bots. 2023-05-06 02:39:17 +03:00
levlam
22a82c117d Find unloadable messages using LRU. 2023-05-06 02:37:53 +03:00
levlam
b482ffbbeb Check that bots doesn't use suffix load. 2023-05-06 01:56:29 +03:00
levlam
ad20309a1d Don't use last_new_message_id by bots. 2023-05-06 01:46:11 +03:00
levlam
47b225c11f Move limit increase to OrderedMessages::get_history. 2023-05-05 16:31:33 +03:00
levlam
aef0cfe4bc Add OrderedMessages::get_history. 2023-05-05 16:03:03 +03:00
levlam
96979d91b6 Check parameters first in MessagesManager::get_dialog_history. 2023-05-05 15:37:50 +03:00
levlam
dbcf3e5eec Use more empty names for unused parameters. 2023-05-05 14:18:46 +03:00
levlam
c0911577f7 Use empty name for unused move constructor/assignment parameter. 2023-05-05 13:51:19 +03:00
levlam
c2795ca904 Remove OrderedMessages::Iterator copy constructor. 2023-05-05 13:02:54 +03:00
levlam
a7c963dabb Add OrderedMessage::Iterator::clear. 2023-05-05 12:51:48 +03:00
levlam
fc136f46df Randomize temporary auth key validity time. 2023-05-04 16:00:14 +03:00
levlam
d3ade3d64d Persist temporary keys for main sessions if multiple sessions enabled. 2023-05-04 15:54:21 +03:00
levlam
648c6cd3ef Improve error message. 2023-05-04 15:13:31 +03:00
levlam
b5b0dbe331 Reuse get_auth_key_state. 2023-05-04 14:59:09 +03:00
levlam
14c570f334 Move AuthKeyState to a separate header. 2023-05-04 14:53:07 +03:00
levlam
53cd6c1a79 Improve includes. 2023-05-03 16:38:49 +03:00
levlam
c47dde6ea9 Don't warn about yet unsent messages with small identifiers for bots. 2023-05-03 16:28:40 +03:00
levlam
f2d11e12f6 Use small identifiers for yet unsent and local messages for bots. 2023-05-03 14:34:06 +03:00
levlam
7507d8e20c Don't restart on message_id overflow. 2023-05-03 14:23:18 +03:00
levlam
d64d3fe258 Ignore last_/first_database_message_id for bots. 2023-05-03 14:08:20 +03:00
levlam
d71d6afe17 Don't use last_message_id for bots. 2023-05-03 13:29:04 +03:00
levlam
71b7487f51 Don't attach messages for bots. 2023-05-03 13:18:05 +03:00
levlam
bba924f6a9 Make remaining OrderedMessage fields private. 2023-05-03 12:59:10 +03:00
levlam
4b048c4bbf Avoid preliminary have_previous_ checks. 2023-05-03 12:54:55 +03:00
levlam
1eb98e9ce5 Improve OrderedMessages::insert. 2023-05-03 12:29:41 +03:00
levlam
4444204874 Minor condition improvements. 2023-05-03 12:22:47 +03:00
levlam
503a1e0e7e Make OrderedMessages::iterator private. 2023-05-03 11:51:09 +03:00
levlam
85aedaa8c0 Add more logic to OrderedMessages::insert. 2023-05-03 11:48:06 +03:00
levlam
b8cd0bb597 Improve OrderedMessages::erase. 2023-05-03 01:34:58 +03:00
levlam
28b742e7d3 Improve OrderedMessages::insert. 2023-05-03 00:25:21 +03:00
levlam
e39757b6ec Make OrderedMessage.message_id_ private. 2023-05-02 23:49:59 +03:00
levlam
aa7627108b Improve OrderedMessage field names. 2023-05-02 23:27:37 +03:00
levlam
b00dfaf493 Make some OrderedMessage fields private. 2023-05-02 23:18:28 +03:00
levlam
128aec1d59 Make OrderedMessages fields private. 2023-05-02 23:14:35 +03:00
levlam
5ecc3a0968 Use traverse_messages to find minimum message identifier. 2023-05-02 23:11:04 +03:00
levlam
0d1cdc3e60 Add OrderedMessages::auto_attach_message. 2023-05-02 23:00:11 +03:00
levlam
6e4ebc56d1 Move attach_message_to_previous/attach_message_to_next to OrderedMessages. 2023-05-02 22:39:50 +03:00
levlam
4fe8137244 Use ConstIterator to find the last message. 2023-05-02 22:21:37 +03:00
levlam
494a25c19a Fix find_unloadable_messages. 2023-05-02 22:06:08 +03:00
levlam
e9ee762f60 Implement find_unloadable_messages with traverse_messages. 2023-05-02 21:54:11 +03:00
levlam
d6ccdfeac6 Add generic OrderedMessages::find_messages. 2023-05-02 21:27:16 +03:00
levlam
233984f1e3 Move iterators to class OrderedMessages. 2023-05-02 19:07:02 +03:00
levlam
0a3ecfd03c Add OrderedMessages::find_message_by_date. 2023-05-02 18:47:20 +03:00
levlam
f92d108319 Add OrderedMessages::find_messages_by_date. 2023-05-02 18:40:22 +03:00
levlam
961c9802af Add OrderedMessages::find_newer_messages. 2023-05-02 18:17:06 +03:00
levlam
2e0cba4eea Add OrderedMessages::find_older_messages. 2023-05-02 18:11:37 +03:00
levlam
2ff3233115 Add class OrderedMessages. 2023-05-02 18:04:54 +03:00
levlam
5ef84c5c65 Move class OrderedMessage out of MessagesManager. 2023-05-02 17:38:55 +03:00
levlam
df626f266e Inline create_ordered_message. 2023-05-02 17:30:12 +03:00
levlam
316ba04a47 Inline treap_find_message. 2023-05-02 17:25:15 +03:00
levlam
453a53c953 Remove return value from treap_delete_message. 2023-05-02 17:18:05 +03:00
levlam
16873cad78 Ignore message order in find_messages. 2023-05-02 16:54:52 +03:00
levlam
0af40e53ac Inline delete_all_dialog_messages_from_database. 2023-05-02 16:46:37 +03:00
levlam
fe20d43694 Remove MessagesManager::set_message_id. 2023-05-02 16:18:48 +03:00
levlam
7832c5d78c Store message order separately from messages themselves. 2023-05-02 16:07:01 +03:00
levlam
36fede32c6 Reuse message iterator in MessagesManager::do_delete_message. 2023-05-02 14:59:20 +03:00
levlam
b9210f852c Simplify attach_message_to_next/attach_message_to_previous usage. 2023-05-02 14:35:42 +03:00
levlam
0191b7bdb7 Initialize message->have_previous/have_next only after message is added to treap. 2023-05-02 14:21:03 +03:00
levlam
2bf7509603 Attach message to next/previous even it is outdated. 2023-05-02 13:35:10 +03:00
levlam
aace2a6465 Explicitly pass have_previous and have_next to add_message_to_dialog. 2023-05-02 13:22:13 +03:00
levlam
8a72bb7602 Don't use have_previous/have_next in update_message. 2023-05-02 13:12:29 +03:00
levlam
e2b0c750c1 Remove MessagesIteratorBase template parameter. 2023-05-02 00:57:37 +03:00
levlam
aa6e85404a Store scheduled messages in a HashTable. 2023-05-02 00:52:23 +03:00