diff options
Diffstat (limited to 'Swiften/Whiteboard')
-rw-r--r-- | Swiften/Whiteboard/WhiteboardTransformer.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Swiften/Whiteboard/WhiteboardTransformer.cpp b/Swiften/Whiteboard/WhiteboardTransformer.cpp index 88ab7d5..8b9c927 100644 --- a/Swiften/Whiteboard/WhiteboardTransformer.cpp +++ b/Swiften/Whiteboard/WhiteboardTransformer.cpp @@ -42,9 +42,13 @@ namespace Swift { std::pair<WhiteboardInsertOperation::ref, WhiteboardInsertOperation::ref> result; result.first = boost::make_shared<WhiteboardInsertOperation>(*serverOp); result.first->setParentID(clientOp->getID()); - result.first->setPos(result.first->getPos()+1); result.second = boost::make_shared<WhiteboardInsertOperation>(*clientOp); result.second->setParentID(serverOp->getID()); + if (clientOp->getPos() <= serverOp->getPos()) { + result.first->setPos(result.first->getPos()+1); + } else { + result.second->setPos(result.second->getPos()+1); + } return result; } @@ -126,7 +130,6 @@ namespace Swift { result.first->setPos(-1); result.second->setPos(-1); } -//TODO: situation with deletion of the same item return result; } |