diff --git a/src/widget/form/chatform.cpp b/src/widget/form/chatform.cpp index 98e2e5008..b7442b91c 100644 --- a/src/widget/form/chatform.cpp +++ b/src/widget/form/chatform.cpp @@ -753,7 +753,7 @@ void ChatForm::onAvatarRemoved(int FriendId) void ChatForm::loadHistory(QDateTime since, bool processUndelivered) { - QDateTime now = QDateTime::currentDateTime(); + QDateTime now = historyBaselineDate.addMSecs(-1); if (since > now) return; diff --git a/src/widget/form/genericchatform.cpp b/src/widget/form/genericchatform.cpp index 39108d51d..d4174c68e 100644 --- a/src/widget/form/genericchatform.cpp +++ b/src/widget/form/genericchatform.cpp @@ -331,6 +331,7 @@ void GenericChatForm::clearChatArea(bool notinform) addSystemInfoMessage(tr("Cleared"), ChatMessage::INFO, QDateTime::currentDateTime()); earliestMessage = QDateTime(); //null + historyBaselineDate = QDateTime::currentDateTime(); emit chatAreaCleared(); } diff --git a/src/widget/form/genericchatform.h b/src/widget/form/genericchatform.h index 73463af76..e32a34cd3 100644 --- a/src/widget/form/genericchatform.h +++ b/src/widget/form/genericchatform.h @@ -91,6 +91,7 @@ protected: QPushButton *sendButton; ChatLog *chatWidget; QDateTime earliestMessage; + QDateTime historyBaselineDate = QDateTime::currentDateTime(); // used by HistoryKeeper to load messages from t to historyBaselineDate (excluded) bool audioInputFlag; bool audioOutputFlag; };