2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Support creating polls from bot keyboards.

This commit is contained in:
John Preston
2020-01-15 16:30:29 +03:00
parent c3aa2abe11
commit d0597407d8
10 changed files with 104 additions and 29 deletions

View File

@@ -751,6 +751,17 @@ int PeerData::slowmodeSecondsLeft() const {
return 0;
}
bool PeerData::canSendPolls() const {
if (const auto user = asUser()) {
return user->isBot();
} else if (const auto chat = asChat()) {
return chat->canSendPolls();
} else if (const auto channel = asChannel()) {
return channel->canSendPolls();
}
return false;
}
namespace Data {
std::vector<ChatRestrictions> ListOfRestrictions() {