2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Move to std::optional.

This commit is contained in:
John Preston
2018-09-21 19:28:46 +03:00
parent 850efbde95
commit 2e5a0e056c
115 changed files with 632 additions and 672 deletions

View File

@@ -294,7 +294,7 @@ void History::setHasPendingResizedItems() {
void History::itemRemoved(not_null<HistoryItem*> item) {
item->removeMainView();
if (lastMessage() == item) {
_lastMessage = base::none;
_lastMessage = std::nullopt;
if (loadedAtBottom()) {
if (const auto last = lastAvailableMessage()) {
setLastMessage(last);
@@ -423,7 +423,7 @@ void History::setSentDraftText(const QString &text) {
void History::clearSentDraftText(const QString &text) {
if (_lastSentDraftText && *_lastSentDraftText == text) {
_lastSentDraftText = base::none;
_lastSentDraftText = std::nullopt;
}
accumulate_max(_lastSentDraftTime, unixtime());
}