diff options
Diffstat (limited to 'Swiften')
-rw-r--r-- | Swiften/Whiteboard/WhiteboardServer.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
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<WhiteboardOperation::ref>::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<WhiteboardInsertOperation>(operation); if (insertOperation) { @@ -36,5 +39,6 @@ namespace Swift { } } } + return WhiteboardOperation::ref(); } } |