From 8ebad59a3e3aa42324a5821760b0752546a1e5ac Mon Sep 17 00:00:00 2001 From: PKEv Date: Sat, 23 Apr 2016 03:37:38 +0300 Subject: [PATCH] fix(genericchatform):separate messages from different days Before this new cut-off days is only shown when the load history, now added a feature which in the current chat checks the last post date and if the date does not coincide with current - output a system message about the new date. --- src/widget/form/genericchatform.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/widget/form/genericchatform.cpp b/src/widget/form/genericchatform.cpp index c9901e6c1..4d873eb73 100644 --- a/src/widget/form/genericchatform.cpp +++ b/src/widget/form/genericchatform.cpp @@ -315,6 +315,9 @@ ChatMessage::Ptr GenericChatForm::addMessage(const ToxId& author, const QString bool authorIsActiveProfile = author.isSelf(); QString authorStr = authorIsActiveProfile ? Core::getInstance()->getUsername() : resolveToxId(author); + if (getLatestDate() != QDate::currentDate()) + addSystemInfoMessage(QDate::currentDate().toString(Settings::getInstance().getDateFormat()), ChatMessage::INFO, QDateTime()); + ChatMessage::Ptr msg; if (isAction) {