Fixed restricted date checking

This commit is contained in:
Eric Kotato 2019-10-02 02:41:53 +03:00
parent 523feaeb4b
commit 69a2c43ad9

View file

@ -754,7 +754,8 @@ std::optional<QString> RestrictionError(
using Flag = ChatRestriction; using Flag = ChatRestriction;
if (const auto restricted = peer->amRestricted(restriction)) { if (const auto restricted = peer->amRestricted(restriction)) {
const auto all = restricted.isWithEveryone(); const auto all = restricted.isWithEveryone();
if (!all && const auto channel = peer->asChannel()) { const auto channel = peer->asChannel();
if (!all && channel) {
auto restrictedUntil = channel->restrictedUntil(); auto restrictedUntil = channel->restrictedUntil();
if (restrictedUntil > 0) { if (restrictedUntil > 0) {
auto restrictedUntilDateTime = base::unixtime::parse(channel->restrictedUntil()); auto restrictedUntilDateTime = base::unixtime::parse(channel->restrictedUntil());