Skip to content

Commit 6ad2c48

Browse files
committed
Disallow chat actions in channel direct messages chats.
1 parent ee99d35 commit 6ad2c48

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

td/telegram/DialogActionManager.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,13 @@ void DialogActionManager::send_dialog_action(DialogId dialog_id, MessageId top_t
313313
if (!as_business && td_->dialog_manager_->is_forum_channel(dialog_id) && !top_thread_message_id.is_valid()) {
314314
top_thread_message_id = MessageId(ServerMessageId(1));
315315
}
316+
if (!as_business && td_->dialog_manager_->is_monoforum_channel(dialog_id)) {
317+
if (td_->auth_manager_->is_bot()) {
318+
return promise.set_error(400, "Chat actions can't be sent to channel direct messages chats");
319+
} else {
320+
return promise.set_value(Unit());
321+
}
322+
}
316323

317324
tl_object_ptr<telegram_api::InputPeer> input_peer;
318325
if (action == DialogAction::get_speaking_action()) {

0 commit comments

Comments
 (0)