diffSnapshotMap.each(new ProcV<DocDiff>() {
@Override
public void apply(String documentId, DocDiff diffState) {
BlipDataImpl document = headWavelet.getDocument(documentId);
if (document != null) {
DocumentDiffSnapshot docDiff = MessageFactoryHelper.createDocumentDiffSnapshot();
docDiff.setDocumentId(documentId);
docDiff.setAuthor(document.getAuthor().getAddress());
docDiff.addAllContributor(listOfParticipantAddresses(document.getContributors()));
// TODO(piotrkaleta): Add contributor diffs once Walkaround supports
// them
docDiff.addAllAddedContributor(Collections.<String> emptyList());
docDiff.addAllRemovedContributor(Collections.<String> emptyList());
docDiff.setLastModifiedVersion(document.getLastModifiedVersion());
docDiff.setLastModifiedTime(document.getLastModifiedTime());
docDiff.setState(OperationSerializer.createMutationOp(diffState.getState()));
DocOp diffOp = diffState.getDiff();
if (diffOp != null) {
docDiff.setDiff(OperationSerializer.createMutationOp(diffOp));
}
result.add(docDiff);
}
}
});