Forbid to archive Telegram Notifications.
This commit is contained in:
parent
430a3c2cec
commit
08101ba666
|
@ -53,6 +53,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool showInfo();
|
bool showInfo();
|
||||||
|
bool showToggleArchived();
|
||||||
void addPinToggle();
|
void addPinToggle();
|
||||||
void addInfo();
|
void addInfo();
|
||||||
//void addSearch();
|
//void addSearch();
|
||||||
|
@ -194,6 +195,17 @@ bool Filler::showInfo() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Filler::showToggleArchived() {
|
||||||
|
if (_source != PeerMenuSource::ChatsList) {
|
||||||
|
return false;
|
||||||
|
} else if (!_peer->isNotificationsUser()) {
|
||||||
|
return true;
|
||||||
|
} else if (const auto history = _peer->owner().historyLoaded(_peer)) {
|
||||||
|
return (history->folder() != nullptr);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void Filler::addPinToggle() {
|
void Filler::addPinToggle() {
|
||||||
auto peer = _peer;
|
auto peer = _peer;
|
||||||
auto isPinned = false;
|
auto isPinned = false;
|
||||||
|
@ -504,7 +516,7 @@ void Filler::fill() {
|
||||||
} else if (const auto channel = _peer->asChannel()) {
|
} else if (const auto channel = _peer->asChannel()) {
|
||||||
addChannelActions(channel);
|
addChannelActions(channel);
|
||||||
}
|
}
|
||||||
if (_source == PeerMenuSource::ChatsList) {
|
if (showToggleArchived()) {
|
||||||
addToggleArchive();
|
addToggleArchive();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue