╭ changed ──────────────╮ │src/ui/Repo/Patches.zig│ ╰───────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────╮ │307 !entry.conflicted and │ │308 entry.record.event.revision != null and │ │309 entry.record.event.status.kind() == .open and│ │310 - session.data.host_kind == .server and │ │311 - session.data.user_id != null; │ │310 + session.data.host_kind == .server; │ │311 } │ │312 │ │313 pub fn create( │ ╰──────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────╮ │314 data: *const Self, │ │315 session: *ui.Session, │ │316 allocator: std.mem.Allocator,│ │317 + author: evt.CommitAuthor, │ │318 title: []const u8, │ │319 tags: []const u8, │ │320 description: []const u8, │ ╰──────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────╮ │324 if (!evt.Patch.fieldsValid(title, tags)) return error.InvalidFields; │ │325 const io = session.io orelse return error.NotFound; │ │326 const repo_source = data.repo_source orelse return error.NotFound; │ │327 - const author = (try session.eventAuthor()) orelse return error.NotFound;│ │327 var id_bytes: [evt.event_id_size]u8 = undefined; │ │328 io.random(&id_bytes); │ │329 const id = std.fmt.bytesToHex(id_bytes, .lower); │ ╰─────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │366 return id; │ │367 } │ │368 │ │370 -pub fn publishDraft(data: *const Self, session: *ui.Session, allocator: std.mem.Allocator, id: []const u8) !void { │ │369 +pub fn publishDraft(data: *const Self, session: *ui.Session, allocator: std.mem.Allocator, author: evt.CommitAuthor, id: []const u8) !void {│ │370 const io = session.io orelse return error.NotFound; │ │371 const repos_dir = session.repos_dir orelse return error.NotFound; │ │372 const admin_repo = session.admin_repo orelse return error.NotFound; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────╮ │374 const repo_id = data.repo_id orelse return error.NotFound; │ │375 const user_id = session.userId() orelse return error.NotFound; │ │376 const patch_id = evt.parseEventId(id) catch return error.NotFound; │ │378 - const author = (try session.eventAuthor()) orelse return error.NotFound;│ │377 │ │378 const id_hex = std.fmt.bytesToHex(patch_id, .lower); │ │379 const fork_path = try fork.forkPath(allocator, repos_dir, &id_hex); │ ╰─────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │390 }); │ │391 } │ │392 │ │395 -pub fn mergePatch(data: *const Self, session: *ui.Session, allocator: std.mem.Allocator, id: []const u8, revision: evt.Patch.MergeRevision) !void { │ │393 +pub fn mergePatch(data: *const Self, session: *ui.Session, allocator: std.mem.Allocator, author: evt.CommitAuthor, id: []const u8, revision: evt.Patch.MergeRevision) !void {│ │394 const io = session.io orelse return error.NotFound; │ │395 const repos_dir = session.repos_dir orelse return error.NotFound; │ │396 const admin_repo = session.admin_repo orelse return error.NotFound; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────╮ │397 const repo_source = data.repo_source orelse return error.NotFound; │ │398 if (repo_source.repo_kind != .xit) return error.NotFound; │ │399 const patch_id = evt.parseEventId(id) catch return error.NotFound; │ │402 - const author = (try session.eventAuthor()) orelse return error.NotFound; │ │400 │ │401 const id_hex = std.fmt.bytesToHex(patch_id, .lower); │ │402 var target_repo = try rp.Repo(.xit, .{}).open(io, allocator, repo_source.localInitOpts());│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────╮ │413 data: *const Self, │ │414 session: *ui.Session, │ │415 allocator: std.mem.Allocator,│ │416 + author: evt.CommitAuthor, │ │417 id: []const u8, │ │418 title: []const u8, │ │419 tags: []const u8, │ ╰──────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │427 const repo_source = data.repo_source orelse return error.NotFound; │ │428 const user_id = session.userId() orelse return error.NotFound; │ │429 const patch_id = evt.parseEventId(id) catch return error.NotFound; │ │432 - const author = (try session.eventAuthor()) orelse return error.NotFound; │ │430 if (!evt.Patch.branchValid(target_branch) or !try repo_source.hasBranch(io, allocator, target_branch)) return error.InvalidTargetBranch;│ │431 │ │432 const id_hex = std.fmt.bytesToHex(patch_id, .lower); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │445 })) return error.NotFound; │ │446 } │ │447 │ │451 -pub fn removeDraft(session: *ui.Session, allocator: std.mem.Allocator, id: *const [evt.event_id_size]u8) !void { │ │448 +pub fn removeDraft(session: *ui.Session, allocator: std.mem.Allocator, author: evt.CommitAuthor, id: *const [evt.event_id_size]u8) !void {│ │449 const io = session.io orelse return error.NotFound; │ │450 const repos_dir = session.repos_dir orelse return error.NotFound; │ │451 const admin_repo = session.admin_repo orelse return error.NotFound; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯