Fix wronly marking channel as forbidden.

Regression was introduced in 826d6011a1.

Fixes #5923.
This commit is contained in:
John Preston 2019-04-13 10:34:02 +04:00
parent 08cd46cd4c
commit 2518250ae0

View file

@ -1661,9 +1661,6 @@ void ApiWrap::requestSelfParticipant(not_null<ChannelData*> channel) {
}
const auto finalize = [=](UserId inviter, TimeId inviteDate) {
if (inviter < 0) {
channel->markForbidden();
}
channel->inviter = inviter;
channel->inviteDate = inviteDate;
if (const auto history = _session->data().historyLoaded(channel)) {
@ -1708,6 +1705,9 @@ void ApiWrap::requestSelfParticipant(not_null<ChannelData*> channel) {
});
}).fail([=](const RPCError &error) {
_selfParticipantRequests.erase(channel);
if (error.type() == qstr("CHANNEL_PRIVATE")) {
channel->markForbidden();
}
finalize(-1, 0);
}).afterDelay(kSmallDelayMs).send();
}