diff --git a/Telegram/SourceFiles/history/history.cpp b/Telegram/SourceFiles/history/history.cpp index 04ad57bc2b..03ce20f477 100644 --- a/Telegram/SourceFiles/history/history.cpp +++ b/Telegram/SourceFiles/history/history.cpp @@ -2761,6 +2761,14 @@ bool History::loadedAtTop() const { return _loadedAtTop; } +bool History::hasGuestChatBotMessages() const { + return _flags & Flag::HasGuestChatBotMessages; +} + +void History::setHasGuestChatBotMessages() { + _flags |= Flag::HasGuestChatBotMessages; +} + bool History::isReadyFor(MsgId msgId) { if (msgId < 0 && -msgId < ServerMaxMsgId && peer->migrateFrom()) { // Old group history. diff --git a/Telegram/SourceFiles/history/history.h b/Telegram/SourceFiles/history/history.h index f85d8daa21..9c561e79d1 100644 --- a/Telegram/SourceFiles/history/history.h +++ b/Telegram/SourceFiles/history/history.h @@ -242,6 +242,8 @@ public: [[nodiscard]] bool loadedAtBottom() const; // last message is in the list void setNotLoadedAtBottom(); [[nodiscard]] bool loadedAtTop() const; // nothing was added after loading history back + [[nodiscard]] bool hasGuestChatBotMessages() const; + void setHasGuestChatBotMessages(); [[nodiscard]] bool isReadyFor(MsgId msgId); // has messages for showing history at msgId void getReadyFor(MsgId msgId); @@ -499,6 +501,7 @@ private: HasPinnedMessages = (1 << 6), ResolveChatListMessage = (1 << 7), MonoAndForumUnreadInvalidatePending = (1 << 8), + HasGuestChatBotMessages = (1 << 9), }; using Flags = base::flags; friend inline constexpr auto is_flag_type(Flag) { diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index b9fa7d6222..858ef7487c 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -912,7 +912,8 @@ bool HistoryInner::canHaveFromUserpics() const { && !_peer->isSelf() && !_peer->isRepliesChat() && !_peer->isVerifyCodes() - && !_isChatWide) { + && !_isChatWide + && !_history->hasGuestChatBotMessages()) { return false; } else if (const auto channel = _peer->asBroadcast()) { return channel->signatureProfiles(); diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index fd01503198..115b52201f 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -813,6 +813,9 @@ HistoryItem::HistoryItem( if (_effectId) { _history->owner().reactions().preloadEffectImageFor(_effectId); } + if (isGuestChatBotMessage()) { + _history->setHasGuestChatBotMessages(); + } } HistoryItem::HistoryItem( diff --git a/Telegram/SourceFiles/history/view/history_view_message.cpp b/Telegram/SourceFiles/history/view/history_view_message.cpp index c6415941c6..705befeac1 100644 --- a/Telegram/SourceFiles/history/view/history_view_message.cpp +++ b/Telegram/SourceFiles/history/view/history_view_message.cpp @@ -2538,6 +2538,10 @@ void Message::clickHandlerPressedChanged( && (handler == via->link) && !displayForwardedFrom()) { startLinkRipple(); + } else if (const auto guestChat = data()->Get() + ; guestChat + && (handler == guestChat->link)) { + startLinkRipple(); } else if (const auto forwarded = data()->Get() ; forwarded && displayForwardedFrom()