Commit Graph

10034 Commits

Author SHA1 Message Date
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
levlam
713b1f086e Add MessagesManager::have_dialog_scheduled_messages_in_memory helper. 2023-05-01 23:15:54 +03:00
levlam
5397fe43e0 Ignore stored Message::have_previous/have_next flags. 2023-05-01 22:43:08 +03:00
levlam
77dbb2bf68 Don't use MessageSearchFilter::Pinned for bots. 2023-05-01 16:55:12 +03:00
levlam
8757f540ac Force postponed updateChatReadInbox before returning the chat. 2023-05-01 16:41:04 +03:00
levlam
0e02512f47 Ensure that bots doesn't access message index counts. 2023-05-01 16:33:32 +03:00
levlam
b40865f81c Do nothing in on_message_deleted_from_database for bots. 2023-05-01 16:03:23 +03:00
levlam
a544fc205f Call on_message_deleted_from_database for failed to add from database messages. 2023-05-01 15:58:01 +03:00
levlam
730dac8dfe Add MessagesManager::on_message_deleted_from_database. 2023-05-01 15:48:35 +03:00
levlam
3c2e08633b Delay updateChatReadInbox updates in opened chats. 2023-05-01 15:33:51 +03:00
levlam
03e4013c9d Don't resave chat when sending postponed updateChatReadInbox. 2023-05-01 15:17:08 +03:00