diff options
Diffstat (limited to 'Swiften/Whiteboard/WhiteboardSession.cpp')
-rw-r--r-- | Swiften/Whiteboard/WhiteboardSession.cpp | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/Swiften/Whiteboard/WhiteboardSession.cpp b/Swiften/Whiteboard/WhiteboardSession.cpp index 492aec5..92865e3 100644 --- a/Swiften/Whiteboard/WhiteboardSession.cpp +++ b/Swiften/Whiteboard/WhiteboardSession.cpp @@ -20,20 +20,22 @@ namespace Swift { } void WhiteboardSession::handleIncomingAction(boost::shared_ptr<WhiteboardPayload> payload) { - if (payload->getType() == WhiteboardPayload::SessionTerminate) { - onSessionTerminateReceived(toJID_); - return; - } - switch (payload->getType()) { - case WhiteboardPayload::Data: - //onElementReceived(payload->getElement()); -// onOperationReceived(payload->getOperation()); - handleIncomingOperation(payload->getOperation()); - break; - case WhiteboardPayload::SessionAccept: - onRequestAccepted(toJID_); - break; + case WhiteboardPayload::Data: + handleIncomingOperation(payload->getOperation()); + return; + case WhiteboardPayload::SessionAccept: + onRequestAccepted(toJID_); + return; + case WhiteboardPayload::SessionTerminate: + onSessionTerminateReceived(toJID_); + return; + + //handled elsewhere + case WhiteboardPayload::SessionRequest: + + case WhiteboardPayload::UnknownType: + return; } } @@ -44,10 +46,6 @@ namespace Swift { request->send(); } -/* void WhiteboardSession::sendOperation(const WhiteboardOperation::ref operation) { - handleSendOperationRequest(operation); - }*/ - void WhiteboardSession::sendPayload(boost::shared_ptr<WhiteboardPayload> payload) { boost::shared_ptr<GenericRequest<WhiteboardPayload> > request = boost::make_shared<GenericRequest<WhiteboardPayload> >(IQ::Set, toJID_, payload, router_); request->send(); |