Lots of additions again. Working on implementing commands and prettifying the output.
[quassel.git] / main / message.cpp
index 3739822..e89d1a1 100644 (file)
 #include <QDataStream>
 
 QDataStream &operator<<(QDataStream &out, const Message &msg) {
-  out << (quint8)msg.type << (quint8)msg.flags << msg.sender << msg.msg;
+  out << (quint8)msg.type << (quint8)msg.flags << msg.sender << msg.msg << (quint32)msg.timeStamp.toTime_t();
   return out;
 }
 
 QDataStream &operator>>(QDataStream &in, Message &msg) {
   quint8 t, f;
-  in >> t >> f >> msg.sender >> msg.msg;
+  quint32 ts;
+  in >> t >> f >> msg.sender >> msg.msg >> ts;
   msg.type = (Message::Type)t;
   msg.flags = (Message::Flags)f;
+  msg.timeStamp = QDateTime::fromTime_t(ts);
   return in;
 }