From deb8440c6a8b508da127cdac2c54a7d6491cdbbf Mon Sep 17 00:00:00 2001 From: krepa098 Date: Mon, 16 Feb 2015 16:48:22 +0100 Subject: [PATCH] fix issue #1181 --- src/widget/form/chatform.cpp | 2 +- src/widget/form/genericchatform.cpp | 1 + src/widget/form/genericchatform.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) 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; };