summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Elements/Message.h')
-rw-r--r--Swiften/Elements/Message.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/Swiften/Elements/Message.h b/Swiften/Elements/Message.h
index a553eb3..3b9145c 100644
--- a/Swiften/Elements/Message.h
+++ b/Swiften/Elements/Message.h
@@ -8,12 +8,14 @@
#include <boost/optional.hpp>
#include <boost/shared_ptr.hpp>
+#include <boost/smart_ptr/make_shared.hpp>
#include <string>
-#include "Swiften/Elements/Body.h"
-#include "Swiften/Elements/Subject.h"
-#include "Swiften/Elements/ErrorPayload.h"
-#include "Swiften/Elements/Stanza.h"
+#include <Swiften/Elements/Body.h>
+#include <Swiften/Elements/Subject.h>
+#include <Swiften/Elements/ErrorPayload.h>
+#include <Swiften/Elements/Stanza.h>
+#include <Swiften/Elements/Replace.h>
namespace Swift {
class Message : public Stanza {
@@ -33,7 +35,11 @@ namespace Swift {
}
void setSubject(const std::string& subject) {
- updatePayload(boost::shared_ptr<Subject>(new Subject(subject)));
+ updatePayload(boost::make_shared<Subject>(subject));
+ }
+
+ bool hasSubject() {
+ return getPayload<Subject>();
}
std::string getBody() const {
@@ -45,7 +51,7 @@ namespace Swift {
}
void setBody(const std::string& body) {
- updatePayload(boost::shared_ptr<Body>(new Body(body)));
+ updatePayload(boost::make_shared<Body>(body));
}
bool isError() {