╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──╮ │src/web.zig│ ╰───────────╯ ╭────────────────────────────────────────────────────────────────────────────────╮ │577 return; │ │578 } │ │579 │ │580 - var id_bytes: [evt.event_id_size]u8 = undefined; │ │581 - io.random(&id_bytes); │ │582 - const event_id_hex = std.fmt.bytesToHex(id_bytes, .lower); │ │580 const thread_id_hex = std.fmt.bytesToHex(parts.thread_id, .lower); │ │581 const parent_id_hex = std.fmt.bytesToHex(parts.parent_id, .lower); │ │585 - const event = evt.EventWithId{ │ │586 - .id = event_id_hex, │ │587 - .timestamp = @intCast(std.Io.Timestamp.now(io, .real).toSeconds()),│ │588 - .author_email = author_email, │ │589 - .event = .{ .comment = .{ │ │590 - .thread_id = thread_id_hex, │ │591 - .parent_id = parent_id_hex, │ │592 - .body = body, │ │593 - } }, │ │594 - }; │ │582 │ │583 + var event_id_hex: [evt.event_id_size * 2]u8 = undefined; │ │584 switch (host) { │ │585 .remote => |remote| { │ │586 const repo_prefix = "/repo/"; │ ╰────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │607 │ │608 var repo = try rp.Repo(.xit, .{}).open(io, allocator, .{ .path = repo_path }); │ │609 defer repo.deinit(io, allocator); │ │622 - try evt.consume(.xit, .{}, io, allocator, &repo, evt.events_ref, &.{event}); │ │610 + event_id_hex = try evt.Comment.create(.xit, .{}, io, allocator, &repo, &thread_id_hex, &parent_id_hex, body, author_email);│ │611 }, │ │612 .local => |src| { │ │613 if (parts.repo_base.len != 0) { │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │622 var any_repo = try rp.AnyRepo(repo_kind, .{}).open(io, allocator, .{ .path = src.path }); │ │623 defer any_repo.deinit(io, allocator); │ │624 switch (any_repo) { │ │637 - inline else => |*repo| try evt.consume(repo_kind, repo.self_repo_opts, io, allocator, repo, evt.events_ref, &.{event}), │ │625 + inline else => |*repo| event_id_hex = try evt.Comment.create(repo_kind, repo.self_repo_opts, io, allocator, repo, &thread_id_hex, &parent_id_hex, body, author_email),│ │626 } │ │627 }, │ │628 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯