diff options
author | Kevin Smith <git@kismith.co.uk> | 2009-09-15 10:06:15 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2009-09-15 10:06:15 (GMT) |
commit | 13c1ef651158d8bdbd459ebea461c23c89699abd (patch) | |
tree | b453d0f28ebd14560829cbe8283ed12cb488af34 /Swiften | |
parent | c557a9771c99012624e104e5bc71aeb93f38a8bf (diff) | |
download | swift-13c1ef651158d8bdbd459ebea461c23c89699abd.zip swift-13c1ef651158d8bdbd459ebea461c23c89699abd.tar.bz2 |
Completely untested. Rewiring the MainController for Client to be reconnectable (won't compile).
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); + } + } + +}; + +} + + |