diff options
Diffstat (limited to 'Swiften')
-rw-r--r-- | Swiften/Client/StanzaChannel.h | 1 | ||||
-rw-r--r-- | Swiften/Queries/IQChannel.h | 2 | ||||
-rw-r--r-- | Swiften/Queries/IQRouter.cpp | 4 | ||||
-rw-r--r-- | Swiften/Queries/IQRouter.h | 2 | ||||
-rw-r--r-- | Swiften/Roster/AppearOffline.h | 26 |
5 files changed, 35 insertions, 0 deletions
diff --git a/Swiften/Client/StanzaChannel.h b/Swiften/Client/StanzaChannel.h index 13e7ed4..37c58c7 100644 --- a/Swiften/Client/StanzaChannel.h +++ b/Swiften/Client/StanzaChannel.h @@ -13,6 +13,7 @@ namespace Swift { public: virtual void sendMessage(boost::shared_ptr<Message>) = 0; virtual void sendPresence(boost::shared_ptr<Presence>) = 0; + virtual bool isAvailable() = 0; boost::signal<void (boost::shared_ptr<Message>)> onMessageReceived; boost::signal<void (boost::shared_ptr<Presence>) > onPresenceReceived; diff --git a/Swiften/Queries/IQChannel.h b/Swiften/Queries/IQChannel.h index 0dbb1be..1692afe 100644 --- a/Swiften/Queries/IQChannel.h +++ b/Swiften/Queries/IQChannel.h @@ -14,6 +14,8 @@ namespace Swift { virtual void sendIQ(boost::shared_ptr<IQ>) = 0; virtual String getNewIQID() = 0; + + virtual bool isAvailable() = 0; boost::signal<void (boost::shared_ptr<IQ>)> onIQReceived; }; diff --git a/Swiften/Queries/IQRouter.cpp b/Swiften/Queries/IQRouter.cpp index b20d344..ffed5f7 100644 --- a/Swiften/Queries/IQRouter.cpp +++ b/Swiften/Queries/IQRouter.cpp @@ -19,6 +19,10 @@ IQRouter::IQRouter(IQChannel* channel) : channel_(channel), queueRemoves_(false) IQRouter::~IQRouter() { } +bool IQRouter::isAvailable() { + return channel_->isAvailable(); +} + void IQRouter::handleIQ(boost::shared_ptr<IQ> iq) { queueRemoves_ = true; diff --git a/Swiften/Queries/IQRouter.h b/Swiften/Queries/IQRouter.h index 6de2ff9..717a845 100644 --- a/Swiften/Queries/IQRouter.h +++ b/Swiften/Queries/IQRouter.h @@ -23,6 +23,8 @@ namespace Swift { void sendIQ(boost::shared_ptr<IQ> iq); String getNewIQID(); + + bool isAvailable(); private: void handleIQ(boost::shared_ptr<IQ> iq); diff --git a/Swiften/Roster/AppearOffline.h b/Swiften/Roster/AppearOffline.h new file mode 100644 index 0000000..673e018 --- /dev/null +++ b/Swiften/Roster/AppearOffline.h @@ -0,0 +1,26 @@ +#pragma once + +#include "Swiften/Roster/RosterItemOperation.h" +#include "Swiften/Roster/ContactRosterItem.h" + +namespace Swift { + +class RosterItem; + +class AppearOffline : public RosterItemOperation { + public: + AppearOffline() { + } + + virtual void operator() (RosterItem* item) const { + ContactRosterItem* contact = dynamic_cast<ContactRosterItem*>(item); + if (contact) { + contact->setStatusShow(StatusShow::None); + } + } + +}; + +} + + |