Merge pull request #10 from tdlight-team/issue#9

Allow check_message for non-member channels
This commit is contained in:
andrew-ld 2020-11-24 09:42:00 +01:00 committed by GitHub
commit 9b14e5c1b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3652,7 +3652,8 @@ bool Client::have_message_access(int64 chat_id) const {
case ChatInfo::Type::Supergroup: { case ChatInfo::Type::Supergroup: {
auto supergroup_info = get_supergroup_info(chat_info->supergroup_id); auto supergroup_info = get_supergroup_info(chat_info->supergroup_id);
CHECK(supergroup_info != nullptr); CHECK(supergroup_info != nullptr);
return is_chat_member(supergroup_info->status); return !supergroup_info->is_supergroup || is_chat_member(supergroup_info->status);
// return is_chat_member(supergroup_info->status);
} }
case ChatInfo::Type::Unknown: case ChatInfo::Type::Unknown:
default: default: