diff options
Diffstat (limited to 'Swiften/Elements')
-rw-r--r-- | Swiften/Elements/Presence.h | 12 | ||||
-rw-r--r-- | Swiften/Elements/RosterPayload.h | 8 |
2 files changed, 15 insertions, 5 deletions
diff --git a/Swiften/Elements/Presence.h b/Swiften/Elements/Presence.h index 7297339..45638b9 100644 --- a/Swiften/Elements/Presence.h +++ b/Swiften/Elements/Presence.h @@ -22,6 +22,18 @@ namespace Swift { setStatus(status); } + static ref create() { + return ref(new Presence()); + } + + static ref create(const String& status) { + return ref(new Presence(status)); + } + + static ref create(Presence::ref presence) { + return ref(new Presence(*presence)); + } + Type getType() const { return type_; } void setType(Type type) { type_ = type; } diff --git a/Swiften/Elements/RosterPayload.h b/Swiften/Elements/RosterPayload.h index 58c5726..0c987c4 100644 --- a/Swiften/Elements/RosterPayload.h +++ b/Swiften/Elements/RosterPayload.h @@ -4,17 +4,17 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -#ifndef SWIFTEN_RosterPayload_H -#define SWIFTEN_RosterPayload_H +#pragma once #include <vector> #include <boost/optional.hpp> #include "Swiften/Elements/RosterItemPayload.h" #include "Swiften/Elements/Payload.h" +#include "Swiften/Base/Shared.h" namespace Swift { - class RosterPayload : public Payload { + class RosterPayload : public Payload, public Shared<RosterPayload> { public: typedef std::vector<RosterItemPayload> RosterItemPayloads; @@ -35,5 +35,3 @@ namespace Swift { RosterItemPayloads items_; }; } - -#endif |