╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ─────────────╮ │src/ui/Repo/Issues.zig│ ╰──────────────────────╯ ╭─────────────────────────────────────────────────────────╮ │2348 .title = title, │ │2349 .tags = tags, │ │2350 .description = description,│ │2351 - } }, author_email), │ │2351 + } }, author), │ │2352 } │ │2353 }, │ │2354 } │ ╰─────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────╮ │2366 const src = self.data.repo_source orelse return; │ │2367 const sel = self.detailed_index[index] orelse return; │ │2368 const entry = self.window(index).issues[sel]; │ │2369 - const author_email = (try self.session.eventAuthorEmail()) orelse return;│ │2369 + const author = (try self.session.eventAuthor()) orelse return; │ │2370 │ │2371 const status: evt.Issue.Status = switch (entry.issue.event.status) { │ │2372 .open => .closed, │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2378 │ │2379 switch (src.repo_kind) { │ │2380 inline else => |repo_kind| { │ │2381 - var any_repo = try rp.AnyRepo(repo_kind, .{}).open(io, allocator, .{ .path = src.path }); │ │2381 + var any_repo = try rp.AnyRepo(repo_kind, .{}).open(io, allocator, src.localInitOpts()); │ │2382 defer any_repo.deinit(io, allocator); │ │2383 switch (any_repo) { │ │2384 - inline else => |*repo| try evt.Issue.update(repo_kind, repo.self_repo_opts, io, allocator, repo, &id_bytes, .{ .status = status }, author_email),│ │2384 + inline else => |*repo| try evt.Issue.update(repo_kind, repo.self_repo_opts, io, allocator, repo, &id_bytes, .{ .status = status }, author), │ │2385 } │ │2386 }, │ │2387 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──╮ │src/web.zig│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────╮ │383 │ │384 // the author for an event created by this request, or null when the request │ │385 // may not create one. local mode has no accounts, so it authors anonymously.│ │386 -fn eventAuthorEmail( │ │386 +fn eventAuthor( │ │387 io: std.Io, │ │388 allocator: std.mem.Allocator, │ │389 arena: *std.heap.ArenaAllocator, │ ╰──────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────╮ │390 request: *std.http.Server.Request, │ │391 host: Host, │ │392 -) !?[]const u8 { │ │392 +) !?evt.CommitAuthor { │ │393 const remote = switch (host) { │ │394 .remote => |remote| remote, │ │395 - .local => return "user@haxy", // TODO: try the repo's git config user.email first│ │395 + .local => |src| return try ui.localAuthor(src, io, allocator, arena), │ │396 }; │ │397 const token = getCookieValue(request, cookie_name) orelse return null; │ │398 var user_id: [evt.event_id_size]u8 = undefined; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │402 defer repo.deinit(io, allocator); │ │403 const moment = try evt.currentMoment(evt.admin_repo_opts, &repo); │ │404 const user = (try evt.User.readById(evt.AdminDB, evt.admin_repo_opts.hash, moment, arena, &user_id)) orelse return null;│ │405 - return user.event.email; │ │405 + return .{ .name = user.event.name, .email = user.event.email }; │ │406 } │ │407 │ │408 // refuse a write from a request with no logged-in user. the body goes unread, │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │446 ) !void { │ │447 var author_arena = std.heap.ArenaAllocator.init(allocator); │ │448 defer author_arena.deinit(); │ │449 - const author_email = (try eventAuthorEmail(io, allocator, &author_arena, request, host)) orelse return respondLoginRequired(request);│ │449 + const author = (try eventAuthor(io, allocator, &author_arena, request, host)) orelse return respondLoginRequired(request); │ │450 │ │451 var body_buf: [256]u8 = undefined; │ │452 const reader = request.readerExpectNone(&body_buf); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────╮ │481 const event = evt.EventWithId{ │ │482 .id = event_id_hex, │ │483 .timestamp = @intCast(std.Io.Timestamp.now(io, .real).toSeconds()),│ │484 - .author_email = author_email, │ │484 + .author = author, │ │485 .event = .{ .issue = .{ │ │486 .title = title, │ │487 .description = description, │ ╰────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │530 } │ │531 switch (src.repo_kind) { │ │532 inline else => |repo_kind| { │ │533 - var any_repo = try rp.AnyRepo(repo_kind, .{}).open(io, allocator, .{ .path = src.path }); │ │533 + var any_repo = try rp.AnyRepo(repo_kind, .{}).open(io, allocator, src.localInitOpts()); │ │534 defer any_repo.deinit(io, allocator); │ │535 switch (any_repo) { │ │536 inline else => |*repo| try evt.consume(repo_kind, repo.self_repo_opts, io, allocator, repo, evt.events_ref, &[_]evt.EventWithId{event}),│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │595 │ │596 var author_arena = std.heap.ArenaAllocator.init(allocator); │ │597 defer author_arena.deinit(); │ │598 - const author_email = (try eventAuthorEmail(io, allocator, &author_arena, request, host)) orelse return respondLoginRequired(request);│ │598 + const author = (try eventAuthor(io, allocator, &author_arena, request, host)) orelse return respondLoginRequired(request); │ │599 │ │600 var body_buf: [256]u8 = undefined; │ │601 const reader = request.readerExpectNone(&body_buf); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯