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

Inline bot results display improved for geo, venue and contact types.

This commit is contained in:
John Preston
2016-04-02 18:06:36 +04:00
parent cf9a78a164
commit bf37c73d66
5 changed files with 75 additions and 7 deletions

View File

@@ -2027,8 +2027,20 @@ int32 StickerPanInner::validateExistingInlineRows(const InlineResults &results)
if (_inlineRows.isEmpty()) {
_inlineWithThumb = false;
auto hasThumbDisplay = [](InlineResult *inlineResult) -> bool {
if (!inlineResult->thumb->isNull()) {
return true;
}
if (inlineResult->type == InlineResult::Type::Contact) {
return true;
}
if (inlineResult->sendData->hasLocationCoords()) {
return true;
}
return false;
};
for (int32 i = until; i < count; ++i) {
if (!results.at(i)->thumb->isNull()) {
if (hasThumbDisplay(results.at(i))) {
_inlineWithThumb = true;
break;
}