summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften')
-rw-r--r--Swiften/Whiteboard/WhiteboardSession.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/Swiften/Whiteboard/WhiteboardSession.cpp b/Swiften/Whiteboard/WhiteboardSession.cpp
index 10b5e51..cffcf07 100644
--- a/Swiften/Whiteboard/WhiteboardSession.cpp
+++ b/Swiften/Whiteboard/WhiteboardSession.cpp
@@ -7,6 +7,7 @@
#include <Swiften/Whiteboard/WhiteboardSession.h>
#include <boost/smart_ptr/make_shared.hpp>
+#include <Swiften/Queries/IQRouter.h>
#include <Swiften/Elements/WhiteboardPayload.h>
#include <Swiften/Elements/ErrorPayload.h>
@@ -52,9 +53,11 @@ namespace Swift {
}
void WhiteboardSession::cancel() {
- boost::shared_ptr<WhiteboardPayload> payload = boost::make_shared<WhiteboardPayload>(WhiteboardPayload::SessionTerminate);
- boost::shared_ptr<GenericRequest<WhiteboardPayload> > request = boost::make_shared<GenericRequest<WhiteboardPayload> >(IQ::Set, toJID_, payload, router_);
- request->send();
+ if (router_->isAvailable()) {
+ boost::shared_ptr<WhiteboardPayload> payload = boost::make_shared<WhiteboardPayload>(WhiteboardPayload::SessionTerminate);
+ boost::shared_ptr<GenericRequest<WhiteboardPayload> > request = boost::make_shared<GenericRequest<WhiteboardPayload> >(IQ::Set, toJID_, payload, router_);
+ request->send();
+ }
onSessionTerminated(toJID_);
}