diff options
author | Mateusz Piekos <mateuszpiekos@gmail.com> | 2012-07-03 14:42:31 (GMT) |
---|---|---|
committer | Mateusz Piekos <mateuszpiekos@gmail.com> | 2012-07-03 14:42:31 (GMT) |
commit | fadd51fbed5111aba266a3b8b22be2c57ea11262 (patch) | |
tree | 2f63c78a4c30285c7a6a81c36677f4dd6e93c4af /Swiften/Whiteboard | |
parent | ad0276119802e8f2617a75f64e5f694b37c69bfe (diff) | |
download | swift-contrib-fadd51fbed5111aba266a3b8b22be2c57ea11262.zip swift-contrib-fadd51fbed5111aba266a3b8b22be2c57ea11262.tar.bz2 |
Modified statement about session request reject
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_; |