Support chatInvitePublicJoinRequests.

This commit is contained in:
levlam 2022-05-25 17:17:14 +03:00
parent 59e926350e
commit e1cf18f1cc
2 changed files with 6 additions and 5 deletions

View File

@ -50,10 +50,6 @@ static td_api::object_ptr<td_api::ChatEventAction> get_chat_event_action_object(
case telegram_api::channelAdminLogEventActionParticipantJoinByRequest::ID: {
auto action = move_tl_object_as<telegram_api::channelAdminLogEventActionParticipantJoinByRequest>(action_ptr);
DialogInviteLink invite_link(std::move(action->invite_), "channelAdminLogEventActionParticipantJoinByRequest");
if (!invite_link.is_valid()) {
LOG(ERROR) << "Wrong invite link: " << invite_link;
return nullptr;
}
UserId approver_user_id(action->approved_by_);
if (!approver_user_id.is_valid()) {
return nullptr;

View File

@ -19,7 +19,12 @@ DialogInviteLink::DialogInviteLink(tl_object_ptr<telegram_api::ExportedChatInvit
return;
}
if (exported_invite_ptr->get_id() != telegram_api::chatInviteExported::ID) {
LOG(ERROR) << "Receive from " << source << ' ' << to_string(exported_invite_ptr);
CHECK(exported_invite_ptr->get_id() == telegram_api::chatInvitePublicJoinRequests::ID)
Slice slice(source);
if (slice != "channelAdminLogEventActionParticipantJoinByRequest" && slice != "updateChatParticipant" &&
slice != "updateChannelParticipant" && slice != "updateBotChatInviteRequester") {
LOG(ERROR) << "Receive from " << source << ' ' << to_string(exported_invite_ptr);
}
return;
}