From 2518250ae0bf94963d3c0934f14b09d22b49526f Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 13 Apr 2019 10:34:02 +0400 Subject: [PATCH] Fix wronly marking channel as forbidden. Regression was introduced in 826d6011a1. Fixes #5923. --- Telegram/SourceFiles/apiwrap.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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(); }