summaryrefslogtreecommitdiffstats
blob: 32e9815a674d657e626c4f78a173f88dba7cb3d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * Copyright (c) 2012 Mateusz Piękos
 * Licensed under the simplified BSD license.
 * See Documentation/Licenses/BSD-simplified.txt for more information.
 */

#include <Swiften/Whiteboard/WhiteboardTransformer.h>
#include <boost/smart_ptr/make_shared.hpp>

namespace Swift {
	std::pair<WhiteboardInsertOperation::ref, WhiteboardInsertOperation::ref> WhiteboardTransformer::transform(WhiteboardInsertOperation::ref clientOp, WhiteboardInsertOperation::ref serverOp) {
		std::pair<WhiteboardInsertOperation::ref, WhiteboardInsertOperation::ref> result;
		result.first = boost::make_shared<WhiteboardInsertOperation>(*serverOp.get());
		result.first->setParentID(clientOp->getID());
		result.first->setPos(result.first->getPos()+1);
		result.second = boost::make_shared<WhiteboardInsertOperation>(*clientOp.get());
		result.second->setParentID(serverOp->getID());
		return result;
	}
}