Check chat activness.
This commit is contained in:
parent
da7c518686
commit
ec7c72e942
|
@ -199,6 +199,9 @@ Status RequestedDialogType::check_shared_dialog(Td *td, DialogId dialog_id) cons
|
||||||
return Status::Error(400, "Wrong has_username value");
|
return Status::Error(400, "Wrong has_username value");
|
||||||
}
|
}
|
||||||
auto chat_id = dialog_id.get_chat_id();
|
auto chat_id = dialog_id.get_chat_id();
|
||||||
|
if (!td->contacts_manager_->get_chat_is_active(chat_id)) {
|
||||||
|
return Status::Error(400, "Chat is deactivated");
|
||||||
|
}
|
||||||
auto status = td->contacts_manager_->get_chat_status(chat_id);
|
auto status = td->contacts_manager_->get_chat_status(chat_id);
|
||||||
if (is_created_ && !status.is_creator()) {
|
if (is_created_ && !status.is_creator()) {
|
||||||
return Status::Error(400, "The chat must be created by the current user");
|
return Status::Error(400, "The chat must be created by the current user");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user