Allow write access to linked supergroups.

GitOrigin-RevId: 05008f9e07dc1d0759235431d999d59f50d7e820
This commit is contained in:
levlam 2020-09-09 03:40:17 +03:00
parent 4d47247fc1
commit 220ad5352b

View File

@ -4161,6 +4161,14 @@ bool ContactsManager::have_input_peer_channel(const Channel *c, ChannelId channe
if (dialog_access_by_invite_link_.count(DialogId(channel_id))) {
return true;
}
} else {
if (!from_linked && c->is_megagroup) {
auto linked_channel_id = get_linked_channel_id(channel_id);
if (linked_channel_id.is_valid()) {
return !c->username.empty() || c->has_location ||
have_input_peer_channel(get_channel(linked_channel_id), linked_channel_id, AccessRights::Read, true);
}
}
}
if (!c->status.is_member()) {
return false;