Send updateUserChatAction from on_user_dialog_action.
GitOrigin-RevId: 6af5402efa9ac21b9054278c839d982b4fbdcb6e
This commit is contained in:
parent
86666a8418
commit
8eaea5d4af
@ -5618,6 +5618,14 @@ void MessagesManager::on_update_channel_max_unavailable_message_id(ChannelId cha
|
||||
"on_update_channel_max_unavailable_message_id");
|
||||
}
|
||||
|
||||
void MessagesManager::on_user_dialog_action(DialogId dialog_id, UserId user_id,
|
||||
tl_object_ptr<td_api::ChatAction> &&action) {
|
||||
send_closure(G()->td(), &Td::send_update,
|
||||
make_tl_object<td_api::updateUserChatAction>(
|
||||
dialog_id.get(), td_->contacts_manager_->get_user_id_object(user_id, "on_user_dialog_action"),
|
||||
std::move(action)));
|
||||
}
|
||||
|
||||
void MessagesManager::add_pending_channel_update(DialogId dialog_id, tl_object_ptr<telegram_api::Update> &&update,
|
||||
int32 new_pts, int32 pts_count, const char *source,
|
||||
bool is_postponed_udpate) {
|
||||
|
@ -959,6 +959,8 @@ class MessagesManager : public Actor {
|
||||
|
||||
void on_update_channel_max_unavailable_message_id(ChannelId channel_id, MessageId max_unavailable_message_id);
|
||||
|
||||
void on_user_dialog_action(DialogId dialog_id, UserId user_id, tl_object_ptr<td_api::ChatAction> &&action);
|
||||
|
||||
void delete_messages(DialogId dialog_id, const vector<MessageId> &message_ids, bool revoke, Promise<Unit> &&promise);
|
||||
|
||||
void delete_dialog_history(DialogId dialog_id, bool remove_from_dialog_list, Promise<Unit> &&promise);
|
||||
|
@ -1497,7 +1497,7 @@ void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateChannelWebPage>
|
||||
update->pts_count_, "on_updateChannelWebPage");
|
||||
}
|
||||
|
||||
tl_object_ptr<td_api::ChatAction> UpdatesManager::convertSendMessageAction(
|
||||
tl_object_ptr<td_api::ChatAction> UpdatesManager::convert_send_message_action(
|
||||
tl_object_ptr<telegram_api::SendMessageAction> action) {
|
||||
auto fix_progress = [](int32 progress) { return progress <= 0 || progress > 100 ? 0 : progress; };
|
||||
|
||||
@ -1554,10 +1554,8 @@ void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateUserTyping> upd
|
||||
LOG(DEBUG) << "Ignore user typing in unknown " << dialog_id;
|
||||
return;
|
||||
}
|
||||
send_closure(G()->td(), &Td::send_update,
|
||||
make_tl_object<td_api::updateUserChatAction>(
|
||||
dialog_id.get(), td_->contacts_manager_->get_user_id_object(user_id, "updateUserTyping"),
|
||||
convertSendMessageAction(std::move(update->action_))));
|
||||
td_->messages_manager_->on_user_dialog_action(dialog_id, user_id,
|
||||
convert_send_message_action(std::move(update->action_)));
|
||||
}
|
||||
|
||||
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateChatUserTyping> update, bool /*force_apply*/) {
|
||||
@ -1576,10 +1574,8 @@ void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateChatUserTyping>
|
||||
return;
|
||||
}
|
||||
}
|
||||
send_closure(G()->td(), &Td::send_update,
|
||||
make_tl_object<td_api::updateUserChatAction>(
|
||||
dialog_id.get(), td_->contacts_manager_->get_user_id_object(user_id, "updateChatUserTyping"),
|
||||
convertSendMessageAction(std::move(update->action_))));
|
||||
td_->messages_manager_->on_user_dialog_action(dialog_id, user_id,
|
||||
convert_send_message_action(std::move(update->action_)));
|
||||
}
|
||||
|
||||
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateEncryptedChatTyping> update, bool /*force_apply*/) {
|
||||
@ -1597,10 +1593,7 @@ void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateEncryptedChatTy
|
||||
return;
|
||||
}
|
||||
|
||||
send_closure(G()->td(), &Td::send_update,
|
||||
make_tl_object<td_api::updateUserChatAction>(
|
||||
dialog_id.get(), td_->contacts_manager_->get_user_id_object(user_id, "updateEncryptedChatTyping"),
|
||||
make_tl_object<td_api::chatActionTyping>()));
|
||||
td_->messages_manager_->on_user_dialog_action(dialog_id, user_id, make_tl_object<td_api::chatActionTyping>());
|
||||
}
|
||||
|
||||
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateUserStatus> update, bool /*force_apply*/) {
|
||||
|
@ -139,7 +139,7 @@ class UpdatesManager : public Actor {
|
||||
|
||||
void set_date(int32 date, bool from_update, string date_source);
|
||||
|
||||
static tl_object_ptr<td_api::ChatAction> convertSendMessageAction(
|
||||
static tl_object_ptr<td_api::ChatAction> convert_send_message_action(
|
||||
tl_object_ptr<telegram_api::SendMessageAction> action);
|
||||
|
||||
void process_get_difference_updates(vector<tl_object_ptr<telegram_api::Message>> &&new_messages,
|
||||
|
Reference in New Issue
Block a user