diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-03-13 13:54:08 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-04-18 19:11:40 (GMT) |
commit | 039636edc1b151431cba21a28986ff2be66b5349 (patch) | |
tree | 0bb5b964806885c9cb1b933d7a5a27480757b630 /Swiften/Elements/Presence.h | |
parent | e494f9a206cbb44903f3a032f858b0ef35a039d1 (diff) | |
download | swift-contrib-039636edc1b151431cba21a28986ff2be66b5349.zip swift-contrib-039636edc1b151431cba21a28986ff2be66b5349.tar.bz2 |
Cleaned up includes.swift-2.0alpha
Diffstat (limited to 'Swiften/Elements/Presence.h')
-rw-r--r-- | Swiften/Elements/Presence.h | 37 |
1 files changed, 9 insertions, 28 deletions
diff --git a/Swiften/Elements/Presence.h b/Swiften/Elements/Presence.h index 7f957ba..5ae482b 100644 --- a/Swiften/Elements/Presence.h +++ b/Swiften/Elements/Presence.h @@ -6,11 +6,8 @@ #pragma once - -#include "Swiften/Elements/Stanza.h" -#include "Swiften/Elements/Status.h" -#include "Swiften/Elements/StatusShow.h" -#include "Swiften/Elements/Priority.h" +#include <Swiften/Elements/Stanza.h> +#include <Swiften/Elements/StatusShow.h> namespace Swift { class Presence : public Stanza { @@ -19,10 +16,9 @@ namespace Swift { enum Type { Available, Error, Probe, Subscribe, Subscribed, Unavailable, Unsubscribe, Unsubscribed }; - Presence() : type_(Available) /*, showType_(Online)*/ {} - Presence(const std::string& status) : type_(Available) { - setStatus(status); - } + Presence(); + Presence(const std::string& status); + virtual ~Presence(); static ref create() { return ref(new Presence()); @@ -51,26 +47,11 @@ namespace Swift { updatePayload(boost::shared_ptr<StatusShow>(new StatusShow(show))); } - std::string getStatus() const { - boost::shared_ptr<Status> status(getPayload<Status>()); - if (status) { - return status->getText(); - } - return ""; - } + std::string getStatus() const; + void setStatus(const std::string& status); - void setStatus(const std::string& status) { - updatePayload(boost::shared_ptr<Status>(new Status(status))); - } - - int getPriority() const { - boost::shared_ptr<Priority> priority(getPayload<Priority>()); - return (priority ? priority->getPriority() : 0); - } - - void setPriority(int priority) { - updatePayload(boost::shared_ptr<Priority>(new Priority(priority))); - } + int getPriority() const; + void setPriority(int priority); boost::shared_ptr<Presence> clone() const { return boost::shared_ptr<Presence>(new Presence(*this)); |