diff options
Diffstat (limited to 'Swiften/History/HistoryMessage.h')
-rw-r--r-- | Swiften/History/HistoryMessage.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/Swiften/History/HistoryMessage.h b/Swiften/History/HistoryMessage.h index 021d6b9..d35474f 100644 --- a/Swiften/History/HistoryMessage.h +++ b/Swiften/History/HistoryMessage.h @@ -12,16 +12,22 @@ namespace Swift { class HistoryMessage { public: + enum Type { + Chat = 0, + Groupchat = 1, + PrivateMessage = 2 + }; + HistoryMessage( const std::string& message, const JID& fromJID, const JID& toJID, - bool isGroupChat, + Type type, const boost::posix_time::ptime& time) : message_(message), fromJID_(fromJID), toJID_(toJID), - isGroupChat_(isGroupChat), + type_(type), time_(time) { } @@ -37,8 +43,8 @@ namespace Swift { return toJID_; } - bool isGroupChat() const { - return isGroupChat_; + Type getType() const { + return type_; } boost::posix_time::ptime getTime() const { @@ -46,14 +52,14 @@ namespace Swift { } bool operator==(const HistoryMessage& o) const { - return message_ == o.message_ && fromJID_ == o.fromJID_ && toJID_ == o.toJID_ && isGroupChat_ == o.isGroupChat_ && time_ == o.time_; + return message_ == o.message_ && fromJID_ == o.fromJID_ && toJID_ == o.toJID_ && type_ == o.type_ && time_ == o.time_; } private: std::string message_; JID fromJID_; JID toJID_; - bool isGroupChat_; // TODO: <- maybe use Message::Type ? + Type type_; boost::posix_time::ptime time_; }; } |