diff options
Diffstat (limited to 'Swiften/Whiteboard/WhiteboardSessionManager.h')
-rw-r--r-- | Swiften/Whiteboard/WhiteboardSessionManager.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/Swiften/Whiteboard/WhiteboardSessionManager.h b/Swiften/Whiteboard/WhiteboardSessionManager.h index 3cd3aab..d2a59e0 100644 --- a/Swiften/Whiteboard/WhiteboardSessionManager.h +++ b/Swiften/Whiteboard/WhiteboardSessionManager.h @@ -11,34 +11,35 @@ #include <Swiften/Queries/IQRouter.h> #include <Swiften/JID/JID.h> #include <Swiften/Base/boost_bsignals.h> +#include <Swiften/Whiteboard/WhiteboardSession.h> +#include <Swiften/Whiteboard/IncomingWhiteboardSession.h> +#include <Swiften/Whiteboard/OutgoingWhiteboardSession.h> namespace Swift { class IQRouter; - class WhiteboardSession; class WhiteboardResponder; class PresenceOracle; class WhiteboardSessionManager { + friend class WhiteboardResponder; public: WhiteboardSessionManager(IQRouter* router, PresenceOracle* presenceOracle); ~WhiteboardSessionManager(); - - WhiteboardSession* getSession(const JID& to); - WhiteboardSession* acceptSession(const JID& to); - void requestSession(const JID& to); - void cancelSession(const JID& to); - void handleRequestAccepted(const JID& contact, WhiteboardSession* session); + WhiteboardSession::ref getSession(const JID& to); + WhiteboardSession::ref requestSession(const JID& to); public: boost::signal< void (const JID&)> onRequestReceived; - boost::signal< void (const JID&, WhiteboardSession*)> onRequestAccepted; private: JID getFullJID(const JID& bareJID); - WhiteboardSession* createSession(const JID& to); + OutgoingWhiteboardSession::ref createOutgoingSession(const JID& to); + void handleIncomingSession(IncomingWhiteboardSession::ref session); + void handleSessionTerminate(const JID& contact); + void handleSessionCancelled(const JID& contact); private: - std::map<JID, WhiteboardSession*> sessions_; + std::map<JID, boost::shared_ptr<WhiteboardSession> > sessions_; IQRouter* router_; PresenceOracle* presenceOracle_; WhiteboardResponder* responder; |