diff options
author | Mateusz Piekos <mateuszpiekos@gmail.com> | 2012-07-13 18:18:37 (GMT) |
---|---|---|
committer | Mateusz Piekos <mateuszpiekos@gmail.com> | 2012-07-13 18:18:37 (GMT) |
commit | 0ba890e7e8c7e09c1257a7c3b1018f396e6896d1 (patch) | |
tree | 13dc4658023e89d48d4e7ae1854f70e827bf9cf6 /Swiften/Whiteboard/OutgoingWhiteboardSession.cpp | |
parent | 4dc0788b78da3fe5a9daed5ab4593ba6423600ec (diff) | |
download | swift-contrib-0ba890e7e8c7e09c1257a7c3b1018f396e6896d1.zip swift-contrib-0ba890e7e8c7e09c1257a7c3b1018f396e6896d1.tar.bz2 |
Integrated WhiteboardClient and WhiteboardServer into rest of the code
Diffstat (limited to 'Swiften/Whiteboard/OutgoingWhiteboardSession.cpp')
-rw-r--r-- | Swiften/Whiteboard/OutgoingWhiteboardSession.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp b/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp index f0b6d22..da4d3cf 100644 --- a/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp +++ b/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp @@ -33,4 +33,33 @@ namespace Swift { onRequestRejected(toJID_); } } + + void OutgoingWhiteboardSession::handleIncomingOperation(WhiteboardOperation::ref operation) { +// std::cout << "incoming pos: " << operation->getPos() << std::endl; + WhiteboardClient::Result pairResult = client.handleServerOperationReceived(operation); + if (pairResult.client) { + onOperationReceived(pairResult.client); + //std::cout << "in1: " << operation->getID() << " " << operation->getPos() << " " << operation->getParentID() << std::endl; + //std::cout << "in2: " << pairResult.client->getID() << " " << pairResult.client->getPos() << " " << pairResult.client->getParentID() << std::endl; + } + + if (pairResult.server) { + //std::cout << "outts: " << pairResult.server->getID() << " " << pairResult.server->getPos() << std::endl; + WhiteboardPayload::ref payload = boost::make_shared<WhiteboardPayload>(); + payload->setOperation(pairResult.server); + sendPayload(payload); + } + } + + void OutgoingWhiteboardSession::handleSendOperationRequest(WhiteboardOperation::ref operation) { + //std::cout << "out1: " << operation->getID() << " " << operation->getPos() << " " << operation->getParentID() << std::endl; + WhiteboardOperation::ref result = client.handleLocalOperationReceived(operation); + + if (result) { + //std::cout << "out2: " << result->getID() << " " << result->getPos()<< " " << result->getParentID()<< std::endl; + WhiteboardPayload::ref payload = boost::make_shared<WhiteboardPayload>(); + payload->setOperation(result); + sendPayload(payload); + } + } } |