summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMateusz Piekos <mateuszpiekos@gmail.com>2012-08-10 07:07:14 (GMT)
committerMateusz Piekos <mateuszpiekos@gmail.com>2012-08-10 07:07:14 (GMT)
commit9c8722fecdc096f168c7c58ea567efeeb16326e5 (patch)
tree2ecfbfda40962550f41a39bf76b6ce6f6e2f50e1 /Swiften
parent1ba6012a02c05bd077fa5cd7bbfd83473227f608 (diff)
downloadswift-contrib-9c8722fecdc096f168c7c58ea567efeeb16326e5.zip
swift-contrib-9c8722fecdc096f168c7c58ea567efeeb16326e5.tar.bz2
Fixed bug in WhiteboardTransformerpielas/whiteboard
Diffstat (limited to 'Swiften')
-rw-r--r--Swiften/Whiteboard/WhiteboardTransformer.cpp7
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;
}