summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMateusz Piekos <mateuszpiekos@gmail.com>2012-06-12 10:52:03 (GMT)
committerMateusz Piekos <mateuszpiekos@gmail.com>2012-06-12 10:52:03 (GMT)
commitedd726abb1d0f7532218efbb8067a75a313e9e98 (patch)
tree7eec4f7912a59bb9a383a61c2c96616d5b5847b6 /Swiften/Whiteboard/WhiteboardSessionManager.h
parent6e9fb4e4a3aeee8c40617a4dda6e5e0892ceebad (diff)
downloadswift-contrib-edd726abb1d0f7532218efbb8067a75a313e9e98.zip
swift-contrib-edd726abb1d0f7532218efbb8067a75a313e9e98.tar.bz2
Improved whiteboard session handling
Diffstat (limited to 'Swiften/Whiteboard/WhiteboardSessionManager.h')
-rw-r--r--Swiften/Whiteboard/WhiteboardSessionManager.h21
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;