/***************************************************************************
- * 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 *
Server = 0x0400,
Info = 0x0800,
Error = 0x1000,
- DayChange = 0x2000
+ DayChange = 0x2000,
+ Topic = 0x4000
};
// DO NOT CHANGE without knowing what you do, some of these flags are stored in the database
Self = 0x01,
Highlight = 0x02,
Redirected = 0x04,
+ ServerMsg = 0x08,
Backlog = 0x80
};
Q_DECLARE_FLAGS(Flags, Flag)
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; }
Type _type;
Flags _flags;
- QString _formattedTimestamp, _formattedSender, _formattedText; // cache
-
friend QDataStream &operator>>(QDataStream &in, Message &msg);
};