summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Elements/Message.h')
-rw-r--r--Swiften/Elements/Message.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/Swiften/Elements/Message.h b/Swiften/Elements/Message.h
index b1fea56..f42aec6 100644
--- a/Swiften/Elements/Message.h
+++ b/Swiften/Elements/Message.h
@@ -10,6 +10,7 @@
#include "Swiften/Base/String.h"
#include "Swiften/Elements/Body.h"
+#include "Swiften/Elements/Subject.h"
#include "Swiften/Elements/ErrorPayload.h"
#include "Swiften/Elements/Stanza.h"
@@ -22,6 +23,18 @@ namespace Swift
Message() : type_(Chat) { }
+ String getSubject() const {
+ boost::shared_ptr<Subject> subject(getPayload<Subject>());
+ if (subject) {
+ return subject->getText();
+ }
+ return "";
+ }
+
+ void setSubject(const String& subject) {
+ updatePayload(boost::shared_ptr<Subject>(new Subject(subject)));
+ }
+
String getBody() const {
boost::shared_ptr<Body> body(getPayload<Body>());
if (body) {
@@ -43,7 +56,6 @@ namespace Swift
void setType(Type type) { type_ = type; }
private:
- String body_;
Type type_;
};
}