mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Allow restricting forwards in groups / channels.
This commit is contained in:
@@ -848,6 +848,17 @@ bool PeerData::canWrite() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PeerData::allowsForwarding() const {
|
||||
if (const auto user = asUser()) {
|
||||
return true;
|
||||
} else if (const auto channel = asChannel()) {
|
||||
return channel->allowsForwarding();
|
||||
} else if (const auto chat = asChat()) {
|
||||
return chat->allowsForwarding();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Data::RestrictionCheckResult PeerData::amRestricted(
|
||||
ChatRestriction right) const {
|
||||
using Result = Data::RestrictionCheckResult;
|
||||
|
Reference in New Issue
Block a user