From 4dc0788b78da3fe5a9daed5ab4593ba6423600ec Mon Sep 17 00:00:00 2001 From: Mateusz Piekos Date: Fri, 13 Jul 2012 20:15:34 +0200 Subject: Added missing handling of operations not requiring transformation diff --git a/Swiften/Whiteboard/WhiteboardServer.cpp b/Swiften/Whiteboard/WhiteboardServer.cpp index a12e4e8..36dea87 100644 --- a/Swiften/Whiteboard/WhiteboardServer.cpp +++ b/Swiften/Whiteboard/WhiteboardServer.cpp @@ -14,9 +14,12 @@ namespace Swift { WhiteboardOperation::ref WhiteboardServer::handleClientOperationReceived(WhiteboardInsertOperation::ref newOperation) { std::list::reverse_iterator it; + if (operations_.size() == 0 || newOperation->getParentID() == operations_.back()->getID()) { + operations_.push_back(newOperation); + return newOperation; + } for (it = operations_.rbegin(); it != operations_.rend(); ++it) { WhiteboardOperation::ref operation = *it; - while (newOperation->getParentID() == operation->getParentID()) { WhiteboardInsertOperation::ref insertOperation = boost::dynamic_pointer_cast(operation); if (insertOperation) { @@ -36,5 +39,6 @@ namespace Swift { } } } + return WhiteboardOperation::ref(); } } -- cgit v0.10.2-6-g49f6