Add DialogParticipant::left.
GitOrigin-RevId: a3c111f702cf6579d22a2a17d806c772795c676d
This commit is contained in:
parent
790267119d
commit
57f1ab4daf
@ -2525,7 +2525,7 @@ class GetChannelParticipantQuery : public Td::ResultHandler {
|
||||
|
||||
void on_error(uint64 id, Status status) override {
|
||||
if (status.message() == "USER_NOT_PARTICIPANT") {
|
||||
promise_.set_value({user_id_, UserId(), 0, DialogParticipantStatus::Left()});
|
||||
promise_.set_value(DialogParticipant::left(user_id_));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -13172,7 +13172,7 @@ DialogParticipant ContactsManager::get_chat_participant(ChatId chat_id, UserId u
|
||||
|
||||
auto result = get_chat_participant(chat_id, user_id);
|
||||
if (result == nullptr) {
|
||||
return {user_id, UserId(), 0, DialogParticipantStatus::Left()};
|
||||
return DialogParticipant::left(user_id);
|
||||
}
|
||||
|
||||
return *result;
|
||||
|
@ -370,6 +370,10 @@ struct DialogParticipant {
|
||||
DialogParticipant(tl_object_ptr<telegram_api::ChannelParticipant> &&participant_ptr,
|
||||
DialogParticipantStatus my_status);
|
||||
|
||||
static DialogParticipant left(UserId user_id) {
|
||||
return {user_id, UserId(), 0, DialogParticipantStatus::Left()};
|
||||
}
|
||||
|
||||
bool is_valid() const;
|
||||
|
||||
template <class StorerT>
|
||||
|
Loading…
x
Reference in New Issue
Block a user