mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Allow editing messages in channels indefinitely.
This commit is contained in:
@@ -406,7 +406,8 @@ bool PeerData::canPinMessages() const {
|
||||
if (const auto user = asUser()) {
|
||||
return user->fullFlags() & MTPDuserFull::Flag::f_can_pin_message;
|
||||
} else if (const auto chat = asChat()) {
|
||||
return chat->amIn() && !chat->amRestricted(ChatRestriction::f_pin_messages);
|
||||
return chat->amIn()
|
||||
&& !chat->amRestricted(ChatRestriction::f_pin_messages);
|
||||
} else if (const auto channel = asChannel()) {
|
||||
return channel->isMegagroup()
|
||||
? !channel->amRestricted(ChatRestriction::f_pin_messages)
|
||||
@@ -416,6 +417,19 @@ bool PeerData::canPinMessages() const {
|
||||
Unexpected("Peer type in PeerData::canPinMessages.");
|
||||
}
|
||||
|
||||
bool PeerData::canEditMessagesIndefinitely() const {
|
||||
if (const auto user = asUser()) {
|
||||
return user->isSelf();
|
||||
} else if (const auto chat = asChat()) {
|
||||
return false;
|
||||
} else if (const auto channel = asChannel()) {
|
||||
return channel->isMegagroup()
|
||||
? channel->canPinMessages()
|
||||
: channel->canEditMessages();
|
||||
}
|
||||
Unexpected("Peer type in PeerData::canEditMessagesIndefinitely.");
|
||||
}
|
||||
|
||||
void PeerData::setPinnedMessageId(MsgId messageId) {
|
||||
const auto min = [&] {
|
||||
if (const auto channel = asChannel()) {
|
||||
|
Reference in New Issue
Block a user