Commit Graph

11889 Commits

Author SHA1 Message Date
Liru Færs
0f98d76683
Fix DialogActionManager::send_dialog_action in secret chats (#2756)
* Fix DialogActionManager::send_dialog_action in secret chats 

The code in `DialogActionManager::send_dialog_action` made the assumption that since we'd either have early returned or `DialogManager::have_input_peer` would be true, and therefore the else block of the conditional, which intended to set input_peer, should have done so successfully.

However, `DialogManager::have_input_peer` will return true for secret chats when `contacts_manager->have_input_encrypted_peer`
And `DialogManager::get_input_peer` will return a `nullptr` for secret chats by design (I believe this is because they operate using structures that are currently incompatible)

This should fix the root of a crash that happens when typing in or sending messages to secret chats on:
Telegram X 0.26.4.1678-arm64-v8a (99b10675)
TDLib: 1.8.23 (tdlib/td@4bafdc2)

* Move CHECK below SecretChat case instead per feedback
2024-01-15 01:02:56 +03:00
levlam
58c457ab5f Add NotificationManager::parse_push_notification_attach. 2024-01-14 23:05:35 +03:00
levlam
3e8d368ba5 Add NotificationManager::add_push_notification_user. 2024-01-14 22:52:52 +03:00
levlam
ffdb02374e Simplify Manager actor reset. 2024-01-13 02:08:28 +03:00
levlam
916e5de43e Simplify code for manager reset. 2024-01-13 01:28:15 +03:00
levlam
96fee82699 Use separate initialization functions for different Manager types. 2024-01-13 00:59:17 +03:00
levlam
8b97d2e8e4 Move binlog events processing to Td::process_binlog_events. 2024-01-13 00:42:49 +03:00
levlam
0aa8816c28 Don't always treat pins as mentions. 2024-01-12 18:15:19 +03:00
levlam
4bafdc2b71 Fix MessagesManager::drop_dialog_last_pinned_message_id. 2024-01-12 12:16:51 +03:00
levlam
5d7c69d0d1 Remove CallManager::Update typedef. 2024-01-11 13:36:38 +03:00
levlam
9413360255 Improve SplitSource.php. 2024-01-11 02:08:43 +03:00
levlam
d029eff807 Minor improvements. 2024-01-11 00:12:16 +03:00
levlam
21418140bd Fix removal of message reply for failed to send forwarded messages. 2024-01-10 22:01:39 +03:00
levlam
a10f03cde1 Add sanity check. 2024-01-10 21:41:13 +03:00
levlam
5e0301db45 Improve fatal error message on app downgrade. 2024-01-10 21:20:17 +03:00
levlam
17a412a04a Don't delete notifications when initializing last_new_message_id. There should be no old notifications anyway (2). 2024-01-10 21:08:43 +03:00
levlam
bc5b1f4e19 Remove unavailable messages from the list of linked messages. 2024-01-10 20:22:45 +03:00
levlam
509908edda Don't register users/channels in unknown channels. 2024-01-10 20:07:56 +03:00
levlam
7f844b637f Correctly update self speculative channel status while joining it. 2024-01-10 18:03:41 +03:00
levlam
1fa64892e1 Don't count non-member creator in administrator count. 2024-01-10 17:49:17 +03:00
levlam
44eba3d214 Combine JoinChannel queries. 2024-01-10 17:42:14 +03:00
levlam
faee94b680 Apply message auto-delete time from chat creation message. 2024-01-10 17:20:13 +03:00
levlam
4d51b2c875 Move create_new_chat/create_new_channel to ContactsManager. 2024-01-10 17:09:09 +03:00
levlam
a409af0973 Move migrate_dialog_to_megagroup to ContactsManager. 2024-01-10 15:57:19 +03:00
levlam
1bc8e90c10 Move create_new_secret_chat to ContactsManager. 2024-01-10 15:20:16 +03:00
levlam
da031b3faa Allow \r and other empty entities as a separator between MarkdownV2 blockquotes. 2024-01-10 14:36:27 +03:00
levlam
ce8a4b6d21 tg_cli: use preset message_thread_id_ in requests where it is optional. 2024-01-10 13:16:37 +03:00
levlam
c6154c43aa Don't store message interaction info for bots. 2024-01-09 10:59:24 +03:00
levlam
3817f2cb6b Minor improvements. 2024-01-08 19:26:34 +03:00
levlam
7b6ce8b822 Move reload_dialog_info to DialogManager. 2024-01-08 19:20:22 +03:00
levlam
9a90089879 Move check_dialog_username to DialogManager. 2024-01-08 19:14:41 +03:00
levlam
466c841b4e Move send_update_add_chat_members_privacy_forbidden to DialogParticipantManager. 2024-01-08 18:57:44 +03:00
levlam
127b7ad086 Add DialogParticipantManager::speculative_add_channel_user. 2024-01-08 18:50:18 +03:00
levlam
b1d72276a7 Move set_channel_participant_status and similar methods to DialogParticipantManager. 2024-01-08 18:44:13 +03:00
levlam
9660a7f2b1 Move set_dialog_participant_status and similar methods to DialogParticipantManager. 2024-01-08 18:15:21 +03:00
levlam
50b5a6e9bf Move channel participant cache to DialogParticipantManager. 2024-01-08 18:03:04 +03:00
levlam
bba173ea7d Move get_channel_participant to DialogParticipantManager. 2024-01-08 17:45:04 +03:00
levlam
f8565154a1 Move get_dialog_participant to DialogParticipantManager. 2024-01-08 17:35:24 +03:00
levlam
f1a4579e67 Move bot chat member updates to DialogParticipantManager. 2024-01-08 17:27:32 +03:00
levlam
82e59914cd Minor improvements. 2024-01-08 15:42:21 +03:00
levlam
d832d5a70f Move chat administrators to DialogParticipantManager. 2024-01-08 15:23:16 +03:00
levlam
d1251e47a6 Move chat join request processing to DialogParticipantManager. 2024-01-08 14:36:18 +03:00
levlam
b579fcd3e0 Rename DialogOnlineMemberManager to DialogParticipantManager. 2024-01-08 14:22:44 +03:00
levlam
55faa7ad0b Fix parameter name. 2024-01-08 14:15:15 +03:00
levlam
e4c816d33c Move methods for chat invite link management to DialogInviteLinkManager. 2024-01-08 14:09:58 +03:00
levlam
5a1b4b8d71 Move DialogAccessByInviteLink to DialogInviteLinkManager. 2024-01-08 13:40:28 +03:00
levlam
409778b760 Move check/join by chat invite link to DialogInviteLinkManager. 2024-01-08 13:25:31 +03:00
levlam
ebf2f95681 Add DialogInviteLinkManager. 2024-01-08 12:43:31 +03:00
levlam
90b8acff67 Add and use BotCommands::update_all_bot_commands. 2024-01-08 01:44:58 +03:00
levlam
b4ac2653cd Move delete_dialog to DialogManager. 2024-01-08 01:27:49 +03:00