From 9ecb59816f168647340776d72b735e60efc3b978 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 2 Nov 2026 11:46:57 +0100 Subject: document: put user in commit message trailer --- src/api/changes.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/api') diff --git a/src/api/changes.rs b/src/api/changes.rs index ee6a74a..419f5ed 100644 --- a/src/api/changes.rs +++ b/src/api/changes.rs @@ -1,7 +1,7 @@ //! `GET /admin/changes[/]`: who wrote what, newest first, of the whole document //! or of what is at a path (as `/store/` names it). Every change names the node that -//! made it (its author) and, for a write through the API, the user it was made for (its -//! message), with when (its writer's clock) and the store paths it touched +//! committed it (its author) and, for a write through the API, the user who wrote it (in +//! its message, `User:`), with when (its writer's clock) and the store paths it touched //! (`document::replica::Writer`). Every node holds every change, so any node answers //! for the whole swarm, as far as it has synced. @@ -123,7 +123,11 @@ fn changes( .author .as_ref() .and_then(|author| String::from_utf8(author.as_bytes().to_vec()).ok()), - user: meta.message.as_ref().map(|message| message.to_string()), + user: meta + .message + .as_deref() + .and_then(crate::document::replica::user_of) + .map(str::to_owned), paths: paths.iter().map(|path| path.join("/")).collect(), }); } -- cgit v1.3.1