╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ───────────────╮ │src/ui/widget/thread.zig│ ╰────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2674 switch (any_repo) { │ │2675 inline else => |*repo| if (editing) { │ │2676 const comment_id = evt.parseEventId(self.data.comment_id) catch return; │ │2677 - try evt.Comment.update(self.session.data.host_kind, repo_kind, repo.self_repo_opts, io, allocator, repo, &thread_id, &comment_id, body, author); │ │2677 + try evt.Comment.update(self.session.eventHost(), repo_kind, repo.self_repo_opts, io, allocator, repo, &thread_id, &comment_id, body, author); │ │2678 event_id_hex = std.fmt.bytesToHex(comment_id, .lower); │ │2679 } else { │ │2680 - event_id_hex = try evt.Comment.create(self.session.data.host_kind, repo_kind, repo.self_repo_opts, io, allocator, repo, &thread_id, &parent_id, body, author);│ │2680 + event_id_hex = try evt.Comment.create(self.session.eventHost(), repo_kind, repo.self_repo_opts, io, allocator, repo, &thread_id, &parent_id, body, author); │ │2681 }, │ │2682 } │ │2683 }, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2766 var any_repo = try rp.AnyRepo(repo_kind, .{}).open(io, allocator, src.localInitOpts()); │ │2767 defer any_repo.deinit(io, allocator); │ │2768 switch (any_repo) { │ │2769 - inline else => |*repo| try evt.consume(self.session.data.host_kind, .repo, repo_kind, repo.self_repo_opts, io, allocator, repo, evt.events_ref, &.{event}),│ │2769 + inline else => |*repo| try evt.consume(self.session.eventHost(), .repo, repo_kind, repo.self_repo_opts, io, allocator, repo, evt.events_ref, &.{event}), │ │2770 } │ │2771 }, │ │2772 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2832 defer any_repo.deinit(io, allocator); │ │2833 switch (any_repo) { │ │2834 inline else => |*repo| if (supports_drafts) { │ │2835 - Event.update(self.session.data.host_kind, repo_kind, repo.self_repo_opts, io, allocator, repo, &id_bytes, .{ .fields = .{│ │2835 + Event.update(self.session.eventHost(), repo_kind, repo.self_repo_opts, io, allocator, repo, &id_bytes, .{ .fields = .{ │ │2836 .title = title, │ │2837 .labels = labels, │ │2838 .description = description, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2843 return; │ │2844 }; │ │2845 } else if (has_status) │ │2846 - try Event.update(self.session.data.host_kind, repo_kind, repo.self_repo_opts, io, allocator, repo, &id_bytes, .{ .fields = .{│ │2846 + try Event.update(self.session.eventHost(), repo_kind, repo.self_repo_opts, io, allocator, repo, &id_bytes, .{ .fields = .{ │ │2847 .title = title, │ │2848 .labels = labels, │ │2849 .description = description, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2850 } }, author) │ │2851 else │ │2852 - try Event.update(self.session.data.host_kind, repo_kind, repo.self_repo_opts, io, allocator, repo, &id_bytes, title, labels, description, author),│ │2852 + try Event.update(self.session.eventHost(), repo_kind, repo.self_repo_opts, io, allocator, repo, &id_bytes, title, labels, description, author), │ │2853 } │ │2854 }, │ │2855 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2945 var any_repo = try rp.AnyRepo(repo_kind, .{}).open(io, allocator, src.localInitOpts()); │ │2946 defer any_repo.deinit(io, allocator); │ │2947 switch (any_repo) { │ │2948 - inline else => |*repo| try evt.remove(self.session.data.host_kind, .repo, repo_kind, repo.self_repo_opts, io, allocator, repo, &id, event_kind, author),│ │2948 + inline else => |*repo| try evt.remove(self.session.eventHost(), .repo, repo_kind, repo.self_repo_opts, io, allocator, repo, &id, event_kind, author), │ │2949 } │ │2950 }, │ │2951 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──╮ │src/web.zig│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────╮ │47 git_ssh_port: ?u16, │ │48 git_ssh_prefix: []const u8, │ │49 }, │ │50 + │ │51 + // where this host's event writes go │ │52 + pub fn event(self: Host) evt.Host { │ │53 + return switch (self) { │ │54 + .local => .local, │ │55 + .server => |server| .{ .server = .{ .users_dir = server.users_dir } },│ │56 + }; │ │57 + } │ │58 }; │ │59 │ │60 // an on-disk repo resolved from a request url. server paths are owned. │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │148 return switch (@field(PostRoute, field.name)) { │ │149 .login => handleLogin(io, request, allocator, base, server.admin_repo_path, server.session_store), │ │150 .logout => handleLogout(request, base, server.session_store), │ │143 - .ansi => handleAnsi(io, request, allocator, base, server.admin_repo_path, server.session_store), │ │151 + .ansi => handleAnsi(io, request, allocator, base, server.admin_repo_path, server.users_dir, server.session_store),│ │152 .new => handleNew(io, request, allocator, base, host), │ │153 .edit => handleEdit(io, request, allocator, base, host), │ │154 .remove => handleRemove(io, request, allocator, base, host), │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────╮ │476 allocator: std.mem.Allocator, │ │477 base: []const u8, │ │478 admin_repo_path: []const u8, │ │479 + users_dir: []const u8, │ │480 session_store: SessionStore, │ │481 ) !void { │ │482 // the toggle re-emits the user's own event, so it takes a logged-in user│ ╰──────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮ │489 var repo = try Repo.open(io, allocator, .{ .path = admin_repo_path }); │ │490 defer repo.deinit(io, allocator); │ │491 │ │483 - try evt.User.toggleAnsi(evt.admin_repo_opts, io, allocator, &repo, &user_id); │ │492 + try evt.User.toggleAnsi(evt.admin_repo_opts, io, allocator, &repo, users_dir, &user_id);│ │493 } │ │494 │ │495 // return to the settings tab the toggle came from so the change is visible. │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯