/***************************************************************************
- * Copyright (C) 2005-09 by the Quassel Project *
+ * Copyright (C) 2005-2016 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include "message.h"
#include <QDataStream>
-Message::Message(const BufferInfo &bufferInfo, Type type, const QString &contents, const QString &sender, Flags flags)
+Message::Message(const BufferInfo &bufferInfo, Type type, const QString &contents, const QString &sender, const QString &senderPrefixes, Flags flags)
: _timestamp(QDateTime::currentDateTime().toUTC()),
_bufferInfo(bufferInfo),
_contents(contents),
_sender(sender),
+ _senderPrefixes(senderPrefixes),
_type(type),
_flags(flags)
{
}
-Message::Message(const QDateTime &ts, const BufferInfo &bufferInfo, Type type, const QString &contents, const QString &sender, Flags flags)
+Message::Message(const QDateTime &ts, const BufferInfo &bufferInfo, Type type, const QString &contents, const QString &sender, const QString &senderPrefixes, Flags flags)
: _timestamp(ts),
_bufferInfo(bufferInfo),
_contents(contents),
_sender(sender),
+ _senderPrefixes(senderPrefixes),
_type(type),
_flags(flags)
{
QDataStream &operator<<(QDataStream &out, const Message &msg)
{
+ // We do not serialize the sender prefixes until we have a new protocol or client-features implemented
out << msg.msgId() << (quint32)msg.timestamp().toTime_t() << (quint32)msg.type() << (quint8)msg.flags()
<< msg.bufferInfo() << msg.sender().toUtf8() << msg.contents().toUtf8();
return out;
msg._bufferInfo = buf;
msg._timestamp = QDateTime::fromTime_t(ts);
msg._sender = QString::fromUtf8(s);
+ // We do not serialize the sender prefixes until we have a new protocol or client-features implemented
+ msg._senderPrefixes = QString("");
msg._contents = QString::fromUtf8(m);
return in;
}