diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index adff240df..045b1f48c 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -1661,9 +1661,6 @@ void ApiWrap::requestSelfParticipant(not_null 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 channel) { }); }).fail([=](const RPCError &error) { _selfParticipantRequests.erase(channel); + if (error.type() == qstr("CHANNEL_PRIVATE")) { + channel->markForbidden(); + } finalize(-1, 0); }).afterDelay(kSmallDelayMs).send(); }