From 7a9c84596a4bb5d6742e98d4adf2d22ccec62a42 Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Wed, 13 Oct 2010 21:41:13 +0200 Subject: [PATCH 1/1] Set current time on creation of MessageEvents if no other time is given While we can probable leave the timestamp uninitialized for other event types, we certainly always need a valid time for messages. --- src/common/messageevent.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/messageevent.cpp b/src/common/messageevent.cpp index 70857d82..d872da7e 100644 --- a/src/common/messageevent.cpp +++ b/src/common/messageevent.cpp @@ -41,7 +41,10 @@ MessageEvent::MessageEvent(Message::Type msgType, Network *net, const QString &m _bufferType = bufferTypeByTarget(_target); - setTimestamp(timestamp); + if(timestamp.isValid()) + setTimestamp(timestamp); + else + setTimestamp(QDateTime::currentDateTime()); } BufferInfo::Type MessageEvent::bufferTypeByTarget(const QString &target) const { -- 2.20.1