From 1a5b5ea02909e6c176ebd85d395e47fe15fcdba0 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 7 Nov 2026 22:35:21 +0100 Subject: remake: replays keep their writers A remake's replay writes each value as the user who wrote it, splitting where several users wrote under a path, so replays are judged as the original writes. Auth plan M6 (remakes, 2.4). --- src/document/replica.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/document') diff --git a/src/document/replica.rs b/src/document/replica.rs index ead42f6..a409969 100644 --- a/src/document/replica.rs +++ b/src/document/replica.rs @@ -385,7 +385,7 @@ pub(crate) const USER_TRAILER: &str = "User"; impl Writer<'_> { /// The change's message: its trailers (`trailers`), if it has any. - fn message(&self) -> Option { + pub(crate) fn message(&self) -> Option { self.user.map(|user| format!("{USER_TRAILER}: {user}")) } } @@ -481,7 +481,7 @@ fn run( /// Makes `node` the author of `doc`'s changes from now on. Setting an author gives the /// document a new actor; this node keeps its own (`with_actor`), which it tracks /// (`RemakeState::own_actors`, the document file), as only it writes with it. -fn authored(doc: &mut Document, node: &str) { +pub(crate) fn authored(doc: &mut Document, node: &str) { if doc .get_author() .is_some_and(|author| author.as_bytes() == node.as_bytes()) -- cgit v1.3.1