diff --git a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp index dc22065d60..ddbcd65068 100644 --- a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp +++ b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp @@ -362,7 +362,8 @@ void Gif::clipCallback(Media::Clip::Notification notification) { } } -Sticker::Sticker(not_null context, Result *result) : FileBase(context, result) { +Sticker::Sticker(not_null context, Result *result) +: FileBase(context, result) { } void Sticker::initDimensions() { @@ -447,7 +448,9 @@ void Sticker::prepareThumb() const { const auto sticker = goodThumb ? document->thumb - : document->sticker()->img; + : document->sticker() + ? document->sticker()->img + : ImagePtr(); if (!_thumbLoaded && !sticker->isNull() && sticker->loaded()) { QSize thumbSize = getThumbSize(); _thumb = sticker->pix(thumbSize.width(), thumbSize.height()); @@ -467,7 +470,8 @@ void Sticker::prepareThumb() const { } } -Photo::Photo(not_null context, Result *result) : ItemBase(context, result) { +Photo::Photo(not_null context, Result *result) +: ItemBase(context, result) { } void Photo::initDimensions() { diff --git a/Telegram/SourceFiles/inline_bots/inline_bot_layout_item.cpp b/Telegram/SourceFiles/inline_bots/inline_bot_layout_item.cpp index 97b4ae674c..77561aee58 100644 --- a/Telegram/SourceFiles/inline_bots/inline_bot_layout_item.cpp +++ b/Telegram/SourceFiles/inline_bots/inline_bot_layout_item.cpp @@ -99,17 +99,28 @@ std::unique_ptr ItemBase::createLayout(not_null context, Res using Type = Result::Type; switch (result->_type) { - case Type::Photo: return std::make_unique(context, result); break; + case Type::Photo: + return std::make_unique(context, result); case Type::Audio: - case Type::File: return std::make_unique(context, result); break; - case Type::Video: return std::make_unique(context, result); break; - case Type::Sticker: return std::make_unique(context, result); break; - case Type::Gif: return std::make_unique(context, result); break; + case Type::File: + return std::make_unique(context, result); + case Type::Video: + return std::make_unique(context, result); + case Type::Sticker: + return std::make_unique(context, result); + case Type::Gif: + return std::make_unique(context, result); case Type::Article: case Type::Geo: - case Type::Venue: return std::make_unique(context, result, forceThumb); break; - case Type::Game: return std::make_unique(context, result); break; - case Type::Contact: return std::make_unique(context, result); break; + case Type::Venue: + return std::make_unique( + context, + result, + forceThumb); + case Type::Game: + return std::make_unique(context, result); + case Type::Contact: + return std::make_unique(context, result); } return nullptr; }