summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMateusz Piekos <mateuszpiekos@gmail.com>2012-07-13 18:15:34 (GMT)
committerMateusz Piekos <mateuszpiekos@gmail.com>2012-07-13 18:15:34 (GMT)
commit4dc0788b78da3fe5a9daed5ab4593ba6423600ec (patch)
tree261ffb814b12b3c9e5d5805a7625fa82f3022577
parenta85638b1bfe480c80e1dc5791ed4acf654a5e248 (diff)
downloadswift-contrib-4dc0788b78da3fe5a9daed5ab4593ba6423600ec.zip
swift-contrib-4dc0788b78da3fe5a9daed5ab4593ba6423600ec.tar.bz2
Added missing handling of operations not requiring transformation
-rw-r--r--Swiften/Whiteboard/WhiteboardServer.cpp6
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();
}
}