summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCătălin Badea <catalin.badea392@gmail.com>2012-08-21 19:06:05 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-08-30 20:54:18 (GMT)
commit7d0cd94de71d9e55e573e28206470439ecde3db5 (patch)
treec361caa96dac71d53a74ba76aa3dc1d349a0c59e /Swiften/History/HistoryMessage.h
parent6856199274e9c5e581220fccf520b8f011519d17 (diff)
downloadswift-contrib-7d0cd94de71d9e55e573e28206470439ecde3db5.zip
swift-contrib-7d0cd94de71d9e55e573e28206470439ecde3db5.tar.bz2
History dialog
Add history dialog as an experimental feature. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details.
Diffstat (limited to 'Swiften/History/HistoryMessage.h')
-rw-r--r--Swiften/History/HistoryMessage.h44
1 files changed, 36 insertions, 8 deletions
diff --git a/Swiften/History/HistoryMessage.h b/Swiften/History/HistoryMessage.h
index 461f5de..b3d977f 100644
--- a/Swiften/History/HistoryMessage.h
+++ b/Swiften/History/HistoryMessage.h
@@ -12,33 +12,61 @@
namespace Swift {
class HistoryMessage {
public:
- HistoryMessage(const std::string& message, const JID& from, const JID& to, const boost::posix_time::ptime time) : message_(message), from_(from), to_(to), time_(time) {
+ enum Type {
+ Chat = 0,
+ Groupchat = 1,
+ PrivateMessage = 2
+ };
+
+ HistoryMessage(
+ const std::string& message,
+ const JID& fromJID,
+ const JID& toJID,
+ Type type,
+ const boost::posix_time::ptime& time,
+ int utcOffset = 0) :
+ message_(message),
+ fromJID_(fromJID),
+ toJID_(toJID),
+ type_(type),
+ time_(time),
+ utcOffset_(utcOffset) {
}
const std::string& getMessage() const {
return message_;
}
- const JID& getFrom() const {
- return from_;
+ const JID& getFromJID() const {
+ return fromJID_;
+ }
+
+ const JID& getToJID() const {
+ return toJID_;
}
- const JID& getTo() const {
- return to_;
+ Type getType() const {
+ return type_;
}
boost::posix_time::ptime getTime() const {
return time_;
}
+ int getOffset() const {
+ return utcOffset_;
+ }
+
bool operator==(const HistoryMessage& o) const {
- return message_ == o.message_ && from_ == o.from_ && to_ == o.to_ && time_ == o.time_;
+ return message_ == o.message_ && fromJID_ == o.fromJID_ && toJID_ == o.toJID_ && type_ == o.type_ && time_ == o.time_;
}
private:
std::string message_;
- JID from_;
- JID to_;
+ JID fromJID_;
+ JID toJID_;
+ Type type_;
boost::posix_time::ptime time_;
+ int utcOffset_;
};
}