Add updateChatMember.via_chat_filter_invite_link.

This commit is contained in:
levlam 2023-04-02 23:45:27 +03:00
parent 6198a6a842
commit e50e3e0b3a
4 changed files with 14 additions and 11 deletions

View File

@ -5668,9 +5668,10 @@ updatePollAnswer poll_id:int64 user_id:int53 option_ids:vector<int32> = Update;
//@actor_user_id Identifier of the user, changing the rights
//@date Point in time (Unix timestamp) when the user rights was changed
//@invite_link If user has joined the chat using an invite link, the invite link; may be null
//@via_chat_filter_invite_link True, if the user has joined the chat using an invite link for a chat filter
//@old_chat_member Previous chat member
//@new_chat_member New chat member
updateChatMember chat_id:int53 actor_user_id:int53 date:int32 invite_link:chatInviteLink old_chat_member:chatMember new_chat_member:chatMember = Update;
updateChatMember chat_id:int53 actor_user_id:int53 date:int32 invite_link:chatInviteLink via_chat_filter_invite_link:Bool old_chat_member:chatMember new_chat_member:chatMember = Update;
//@description A user sent a join request to a chat; for bots only
//@chat_id Chat identifier

View File

@ -15879,7 +15879,7 @@ void ContactsManager::on_update_channel_default_permissions(ChannelId channel_id
}
void ContactsManager::send_update_chat_member(DialogId dialog_id, UserId agent_user_id, int32 date,
const DialogInviteLink &invite_link,
const DialogInviteLink &invite_link, bool via_dialog_filter_invite_link,
const DialogParticipant &old_dialog_participant,
const DialogParticipant &new_dialog_participant) {
CHECK(td_->auth_manager_->is_bot());
@ -15887,8 +15887,8 @@ void ContactsManager::send_update_chat_member(DialogId dialog_id, UserId agent_u
send_closure(G()->td(), &Td::send_update,
td_api::make_object<td_api::updateChatMember>(
dialog_id.get(), get_user_id_object(agent_user_id, "send_update_chat_member"), date,
invite_link.get_chat_invite_link_object(this), get_chat_member_object(old_dialog_participant),
get_chat_member_object(new_dialog_participant)));
invite_link.get_chat_invite_link_object(this), via_dialog_filter_invite_link,
get_chat_member_object(old_dialog_participant), get_chat_member_object(new_dialog_participant)));
}
void ContactsManager::on_update_bot_stopped(UserId user_id, int32 date, bool is_stopped) {
@ -15907,7 +15907,7 @@ void ContactsManager::on_update_bot_stopped(UserId user_id, int32 date, bool is_
std::swap(old_dialog_participant.status_, new_dialog_participant.status_);
}
send_update_chat_member(DialogId(user_id), user_id, date, DialogInviteLink(), old_dialog_participant,
send_update_chat_member(DialogId(user_id), user_id, date, DialogInviteLink(), false, old_dialog_participant,
new_dialog_participant);
}
@ -15957,12 +15957,12 @@ void ContactsManager::on_update_chat_participant(ChatId chat_id, UserId user_id,
<< new_dialog_participant;
}
send_update_chat_member(DialogId(chat_id), user_id, date, invite_link, old_dialog_participant,
send_update_chat_member(DialogId(chat_id), user_id, date, invite_link, false, old_dialog_participant,
new_dialog_participant);
}
void ContactsManager::on_update_channel_participant(ChannelId channel_id, UserId user_id, int32 date,
DialogInviteLink invite_link,
DialogInviteLink invite_link, bool via_dialog_filter_invite_link,
tl_object_ptr<telegram_api::ChannelParticipant> old_participant,
tl_object_ptr<telegram_api::ChannelParticipant> new_participant) {
if (!td_->auth_manager_->is_bot()) {
@ -16016,8 +16016,8 @@ void ContactsManager::on_update_channel_participant(ChannelId channel_id, UserId
<< new_dialog_participant;
}
send_update_chat_member(DialogId(channel_id), user_id, date, invite_link, old_dialog_participant,
new_dialog_participant);
send_update_chat_member(DialogId(channel_id), user_id, date, invite_link, via_dialog_filter_invite_link,
old_dialog_participant, new_dialog_participant);
}
void ContactsManager::on_update_chat_invite_requester(DialogId dialog_id, UserId user_id, string about, int32 date,

View File

@ -227,6 +227,7 @@ class ContactsManager final : public Actor {
tl_object_ptr<telegram_api::ChatParticipant> old_participant,
tl_object_ptr<telegram_api::ChatParticipant> new_participant);
void on_update_channel_participant(ChannelId channel_id, UserId user_id, int32 date, DialogInviteLink invite_link,
bool via_dialog_filter_invite_link,
tl_object_ptr<telegram_api::ChannelParticipant> old_participant,
tl_object_ptr<telegram_api::ChannelParticipant> new_participant);
void on_update_chat_invite_requester(DialogId dialog_id, UserId user_id, string about, int32 date,
@ -1597,7 +1598,8 @@ class ContactsManager final : public Actor {
std::pair<vector<size_t>, vector<Contact>> &&to_add, Promise<Unit> &&promise);
void send_update_chat_member(DialogId dialog_id, UserId agent_user_id, int32 date,
const DialogInviteLink &invite_link, const DialogParticipant &old_dialog_participant,
const DialogInviteLink &invite_link, bool via_dialog_filter_invite_link,
const DialogParticipant &old_dialog_participant,
const DialogParticipant &new_dialog_participant);
static vector<td_api::object_ptr<td_api::chatNearby>> get_chats_nearby_object(

View File

@ -2708,7 +2708,7 @@ void UpdatesManager::process_qts_update(tl_object_ptr<telegram_api::Update> &&up
auto update = move_tl_object_as<telegram_api::updateChannelParticipant>(update_ptr);
td_->contacts_manager_->on_update_channel_participant(
ChannelId(update->channel_id_), UserId(update->actor_id_), update->date_,
DialogInviteLink(std::move(update->invite_), true, "updateChannelParticipant"),
DialogInviteLink(std::move(update->invite_), true, "updateChannelParticipant"), update->via_chatlist_,
std::move(update->prev_participant_), std::move(update->new_participant_));
add_qts(qts).set_value(Unit());
break;