X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fmessage.h;h=ee299c636afb59d4ae0fb8e96a57747d99495c8b;hp=4d283ad66802b534bdad212ef4c9de185e2db077;hb=0bc4b2b4a25adea85d5f6c6947cfd31f9098149e;hpb=8f0946673bc3edc84b6f13e16cbe8ece912b4a3b diff --git a/src/common/message.h b/src/common/message.h index 4d283ad6..ee299c63 100644 --- a/src/common/message.h +++ b/src/common/message.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-08 by the Quassel Project * + * Copyright (C) 2005-09 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -55,6 +55,7 @@ public: Self = 0x01, Highlight = 0x02, Redirected = 0x04, + ServerMsg = 0x08, Backlog = 0x80 }; Q_DECLARE_FLAGS(Flags, Flag) @@ -65,17 +66,20 @@ public: const QString &contents = "", const QString &sender = "", Flags flags = None); inline static Message ChangeOfDay(const QDateTime &day) { return Message(day, BufferInfo(), DayChange, tr("Day changed to %1").arg(day.toString("dddd MMMM d yyyy"))); } - inline MsgId msgId() const { return _msgId; } + inline const MsgId &msgId() const { return _msgId; } inline void setMsgId(MsgId id) { _msgId = id; } - inline BufferInfo bufferInfo() const { return _bufferInfo; } - inline QString contents() const { return _contents; } - inline QString sender() const { return _sender; } + inline const BufferInfo &bufferInfo() const { return _bufferInfo; } + inline const BufferId &bufferId() const { return _bufferInfo.bufferId(); } + inline void setBufferId(BufferId id) { _bufferInfo.setBufferId(id); } + inline const QString &contents() const { return _contents; } + inline const QString &sender() const { return _sender; } inline Type type() const { return _type; } inline Flags flags() const { return _flags; } - inline QDateTime timestamp() const { return _timestamp; } + inline void setFlags(Flags flags) { _flags = flags; } + inline const QDateTime ×tamp() const { return _timestamp; } - void setFlags(Flags flags); + inline bool isValid() const { return _msgId.isValid(); } inline bool operator<(const Message &other) const { return _msgId < other._msgId; } @@ -88,8 +92,6 @@ private: Type _type; Flags _flags; - QString _formattedTimestamp, _formattedSender, _formattedText; // cache - friend QDataStream &operator>>(QDataStream &in, Message &msg); };