2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-02 23:45:44 +00:00

Support business bot state in chat.

This commit is contained in:
John Preston
2024-03-18 15:02:12 +04:00
parent 3d97ea6f96
commit cf1d0677d1
20 changed files with 588 additions and 52 deletions

View File

@@ -608,6 +608,23 @@ void PeerData::checkFolder(FolderId folderId) {
}
}
void PeerData::clearBusinessBot() {
if (const auto details = _barDetails.get()) {
if (details->requestChatDate) {
details->businessBot = nullptr;
details->businessBotManageUrl = QString();
} else {
_barDetails = nullptr;
}
}
if (const auto settings = barSettings()) {
setBarSettings(*settings
& ~PeerBarSetting::BusinessBotPaused
& ~PeerBarSetting::BusinessBotCanReply
& ~PeerBarSetting::HasBusinessBot);
}
}
void PeerData::setTranslationDisabled(bool disabled) {
const auto flag = disabled
? TranslationFlag::Disabled