mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 22:46:10 +00:00
Allowing only switch button in inline bot results. 9040124 closed beta.
This commit is contained in:
@@ -23,7 +23,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||
static const int32 AppVersion = 9040;
|
||||
static const wchar_t *AppVersionStr = L"0.9.40";
|
||||
static const bool DevVersion = false;
|
||||
#define BETA_VERSION (9040123ULL) // just comment this line to build public version
|
||||
#define BETA_VERSION (9040124ULL) // just comment this line to build public version
|
||||
|
||||
static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)";
|
||||
static const wchar_t *AppName = L"Telegram Desktop";
|
||||
@@ -295,7 +295,7 @@ static const char *ApiHash = "344583e45741c457fe1862106095a5eb";
|
||||
#else
|
||||
static const char *BetaPrivateKey = "";
|
||||
#undef BETA_VERSION
|
||||
#define BETA_VERSION 0
|
||||
#define BETA_VERSION (0)
|
||||
#endif
|
||||
|
||||
inline const char *cApiDeviceModel() {
|
||||
|
@@ -1931,7 +1931,18 @@ void StickerPanInner::refreshSwitchPmButton(const InlineCacheEntry *entry) {
|
||||
int StickerPanInner::refreshInlineRows(UserData *bot, const InlineCacheEntry *entry, bool resultsDeleted) {
|
||||
_inlineBot = bot;
|
||||
refreshSwitchPmButton(entry);
|
||||
if (!entry || (entry->results.isEmpty() && (!_inlineBot || _inlineBot->username != cInlineGifBotUsername()))) {
|
||||
auto clearResults = [this, entry]() {
|
||||
if (!entry) {
|
||||
return true;
|
||||
}
|
||||
if (entry->results.isEmpty() && entry->switchPmText.isEmpty()) {
|
||||
if (!_inlineBot || _inlineBot->username != cInlineGifBotUsername()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
if (clearResults()) {
|
||||
if (resultsDeleted) {
|
||||
clearInlineRows(true);
|
||||
}
|
||||
@@ -3780,7 +3791,7 @@ bool EmojiPan::refreshInlineRows(int32 *added) {
|
||||
auto i = _inlineCache.constFind(_inlineQuery);
|
||||
const internal::InlineCacheEntry *entry = nullptr;
|
||||
if (i != _inlineCache.cend()) {
|
||||
if (!i.value()->results.isEmpty()) {
|
||||
if (!i.value()->results.isEmpty() || !i.value()->switchPmText.isEmpty()) {
|
||||
entry = i.value();
|
||||
}
|
||||
_inlineNextOffset = i.value()->nextOffset;
|
||||
|
Reference in New Issue
Block a user