diff options
| author | Mateusz Piekos <mateuszpiekos@gmail.com> | 2012-07-02 11:23:59 (GMT) |
|---|---|---|
| committer | Mateusz Piekos <mateuszpiekos@gmail.com> | 2012-07-02 11:23:59 (GMT) |
| commit | abd00de4a4bb395fd2b66c53c150471e7d8ed8b6 (patch) | |
| tree | 48bd48eb820e66198715146c5d9b57ee6bee8a0a /Swiften/Whiteboard/OutgoingWhiteboardSession.cpp | |
| parent | 975435c14b61b241a8e5890c21c60a5be48c2116 (diff) | |
| download | swift-contrib-abd00de4a4bb395fd2b66c53c150471e7d8ed8b6.zip swift-contrib-abd00de4a4bb395fd2b66c53c150471e7d8ed8b6.tar.bz2 | |
Added handling of responses from request IQ
Fixed bug with hanging session requests after one of client crash
Diffstat (limited to 'Swiften/Whiteboard/OutgoingWhiteboardSession.cpp')
| -rw-r--r-- | Swiften/Whiteboard/OutgoingWhiteboardSession.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp b/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp index 585a689..2de4ec4 100644 --- a/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp +++ b/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp @@ -6,6 +6,7 @@ #include <Swiften/Whiteboard/OutgoingWhiteboardSession.h> +#include <boost/smart_ptr/make_shared.hpp> #include <boost/bind.hpp> #include <Swiften/Elements/WhiteboardPayload.h> @@ -19,10 +20,17 @@ namespace Swift { void OutgoingWhiteboardSession::startSession() { boost::shared_ptr<WhiteboardPayload> payload = boost::make_shared<WhiteboardPayload>(WhiteboardPayload::SessionRequest); boost::shared_ptr<GenericRequest<WhiteboardPayload> > request = boost::make_shared<GenericRequest<WhiteboardPayload> >(IQ::Set, toJID_, payload, router_); + request->onResponse.connect(boost::bind(&OutgoingWhiteboardSession::handleRequestResponse, this, _1, _2)); request->send(); } std::string OutgoingWhiteboardSession::getClientID() const { return "a"; } + + void OutgoingWhiteboardSession::handleRequestResponse(boost::shared_ptr<WhiteboardPayload> payload, ErrorPayload::ref error) { + if (error) { + onSessionCancelled(toJID_); + } + } } |
Swift