diff options
Diffstat (limited to 'Swiften/Presence/PresenceOracle.h')
-rw-r--r-- | Swiften/Presence/PresenceOracle.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Swiften/Presence/PresenceOracle.h b/Swiften/Presence/PresenceOracle.h new file mode 100644 index 0000000..dc6fe5d --- /dev/null +++ b/Swiften/Presence/PresenceOracle.h @@ -0,0 +1,30 @@ +#pragma once + +#include "Swiften/Base/String.h" +#include "Swiften/Elements/Presence.h" + +#include <map> +#include <boost/signal.hpp> + +namespace Swift { +class StanzaChannel; + +class PresenceOracle { + public: + PresenceOracle(StanzaChannel* stanzaChannel); + ~PresenceOracle() {}; + + void cancelSubscription(const JID& jid); + void confirmSubscription(const JID& jid); + void requestSubscription(const JID& jid); + + boost::signal<void (boost::shared_ptr<Presence>, boost::shared_ptr<Presence>)> onPresenceChange; + boost::signal<void (const JID&, const String&)> onPresenceSubscriptionRequest; + + private: + void handleIncomingPresence(boost::shared_ptr<Presence> presence); + std::map<JID, std::map<JID, boost::shared_ptr<Presence> > > entries_; + StanzaChannel* stanzaChannel_; +}; +} + |