From: Manuel Nickschas Date: Wed, 13 Oct 2010 19:41:13 +0000 (+0200) Subject: Set current time on creation of MessageEvents if no other time is given X-Git-Tag: 0.8-beta1~90 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=7a9c84596a4bb5d6742e98d4adf2d22ccec62a42 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. --- 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 {