diff options
Diffstat (limited to 'Swiften/Whiteboard')
-rw-r--r-- | Swiften/Whiteboard/OutgoingWhiteboardSession.cpp | 2 | ||||
-rw-r--r-- | Swiften/Whiteboard/WhiteboardSession.h | 1 | ||||
-rw-r--r-- | Swiften/Whiteboard/WhiteboardSessionManager.cpp | 6 | ||||
-rw-r--r-- | Swiften/Whiteboard/WhiteboardSessionManager.h | 2 |
4 files changed, 10 insertions, 1 deletions
diff --git a/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp b/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp index 2de4ec4..f0b6d22 100644 --- a/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp +++ b/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp @@ -30,7 +30,7 @@ namespace Swift { void OutgoingWhiteboardSession::handleRequestResponse(boost::shared_ptr<WhiteboardPayload> payload, ErrorPayload::ref error) { if (error) { - onSessionCancelled(toJID_); + onRequestRejected(toJID_); } } } diff --git a/Swiften/Whiteboard/WhiteboardSession.h b/Swiften/Whiteboard/WhiteboardSession.h index d3e435a..0d10af3 100644 --- a/Swiften/Whiteboard/WhiteboardSession.h +++ b/Swiften/Whiteboard/WhiteboardSession.h @@ -36,6 +36,7 @@ namespace Swift { boost::signal< void(const JID& contact)> onSessionTerminateReceived; boost::signal< void(const JID& contact)> onRequestAccepted; boost::signal< void(const JID& contact)> onSessionCancelled; + boost::signal< void(const JID& contact)> onRequestRejected; protected: JID toJID_; diff --git a/Swiften/Whiteboard/WhiteboardSessionManager.cpp b/Swiften/Whiteboard/WhiteboardSessionManager.cpp index 2e519e0..253febe 100644 --- a/Swiften/Whiteboard/WhiteboardSessionManager.cpp +++ b/Swiften/Whiteboard/WhiteboardSessionManager.cpp @@ -40,6 +40,7 @@ namespace Swift { session->onSessionTerminateReceived.connect(boost::bind(&WhiteboardSessionManager::handleSessionTerminate, this, _1)); session->onSessionCancelled.connect(boost::bind(&WhiteboardSessionManager::handleSessionCancel, this, _1)); session->onRequestAccepted.connect(boost::bind(&WhiteboardSessionManager::handleSessionAccept, this, _1)); + session->onRequestRejected.connect(boost::bind(&WhiteboardSessionManager::handleRequestReject, this, _1)); return session; } @@ -80,4 +81,9 @@ namespace Swift { void WhiteboardSessionManager::handleSessionAccept(const JID& contact) { onRequestAccepted(contact); } + + void WhiteboardSessionManager::handleRequestReject(const JID& contact) { + sessions_.erase(contact.toBare()); + onRequestRejected(contact); + } } diff --git a/Swiften/Whiteboard/WhiteboardSessionManager.h b/Swiften/Whiteboard/WhiteboardSessionManager.h index 10f27d5..9711e5b 100644 --- a/Swiften/Whiteboard/WhiteboardSessionManager.h +++ b/Swiften/Whiteboard/WhiteboardSessionManager.h @@ -32,6 +32,7 @@ namespace Swift { boost::signal< void (const JID&, bool senderIsSelf)> onSessionRequest; boost::signal< void (const JID&)> onSessionTerminate; boost::signal< void (const JID&)> onRequestAccepted; + boost::signal< void (const JID&)> onRequestRejected; private: JID getFullJID(const JID& bareJID); @@ -40,6 +41,7 @@ namespace Swift { void handleSessionTerminate(const JID& contact); void handleSessionCancel(const JID& contact); void handleSessionAccept(const JID& contact); + void handleRequestReject(const JID& contact); private: std::map<JID, boost::shared_ptr<WhiteboardSession> > sessions_; |