Skip to content

Commit e86fec4

Browse files
committed
Fix messages clear on history delete.
1 parent a4c4ea1 commit e86fec4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Telegram/SourceFiles/history/history.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3999,9 +3999,11 @@ void History::clear(ClearType type, bool markEmpty) {
39993999
_lastMessage = std::nullopt;
40004000
}
40014001
}
4002-
const auto tillId = (_lastMessage && *_lastMessage)
4002+
const auto tillId = (_lastMessage
4003+
&& (*_lastMessage)
4004+
&& (*_lastMessage)->isRegular())
40034005
? (*_lastMessage)->id
4004-
: std::numeric_limits<MsgId>::max();
4006+
: MsgId(std::numeric_limits<int64>::max());
40054007
clearUpTill(tillId);
40064008
if (blocks.empty() && _lastMessage && *_lastMessage) {
40074009
addItemToBlock(*_lastMessage);

0 commit comments

Comments
 (0)