╭ changed ──╮ │src/web.zig│ ╰───────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────╮ │← previous│ ╰──────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │651 .remote => |remote| remote, │ │652 .local => return respondRemoveNotFound(request), │ │653 }; │ │656 - const token = getCookieValue(request, cookie_name) orelse return respondLoginRequired(request); │ │657 - var user_id: [evt.event_id_size]u8 = undefined; │ │658 - if (!remote.session_store.lookup(token, &user_id)) return respondLoginRequired(request); │ │654 var author_arena = std.heap.ArenaAllocator.init(allocator); │ │655 defer author_arena.deinit(); │ │661 - const author = (try eventAuthor(io, allocator, &author_arena, request, host)) orelse return respondLoginRequired(request); │ │656 + const request_author = (try eventAuthor(io, allocator, &author_arena, request, host)) orelse return respondLoginRequired(request);│ │657 + const user_id = request_author.user_id orelse return respondLoginRequired(request); │ │658 + const author = request_author.author; │ │659 │ │660 const request_repo = (try requestRepoSource(io, allocator, host, parts.repo_base)) orelse return respondRemoveNotFound(request); │ │661 defer request_repo.deinit(allocator); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │667 const id = std.fmt.bytesToHex(parts.thread_id, .lower); │ │668 const repos_dir = try std.fs.path.join(allocator, &.{ std.fs.path.dirname(remote.admin_repo_path) orelse ".", "repos" });│ │669 defer allocator.free(repos_dir); │ │673 - const path = try fork.forkPath(allocator, repos_dir, &id); │ │674 - defer allocator.free(path); │ │675 - try pch.publish(.{}, io, allocator, &admin_repo, &target_repo, path, .{ │ │670 + const fork_path = try fork.forkPath(allocator, repos_dir, &id); │ │671 + defer allocator.free(fork_path); │ │672 + try pch.publish(.{}, io, allocator, &admin_repo, &target_repo, fork_path, .{ │ │673 .id = id, │ │674 .user_id = user_id, │ │675 .repo_id = repo_id, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │701 │ │702 var author_arena = std.heap.ArenaAllocator.init(allocator); │ │703 defer author_arena.deinit(); │ │707 - const author = (try eventAuthor(io, allocator, &author_arena, request, host)) orelse return respondLoginRequired(request); │ │704 + const author = ((try eventAuthor(io, allocator, &author_arena, request, host)) orelse return respondLoginRequired(request)).author;│ │705 │ │706 const form_body = try readFormBody(request, allocator); │ │707 defer allocator.free(form_body); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │906 │ │907 var author_arena = std.heap.ArenaAllocator.init(allocator); │ │908 defer author_arena.deinit(); │ │912 - const author = (try eventAuthor(io, allocator, &author_arena, request, host)) orelse return respondLoginRequired(request); │ │909 + const author = ((try eventAuthor(io, allocator, &author_arena, request, host)) orelse return respondLoginRequired(request)).author; │ │910 │ │911 const name = (try attachmentName(allocator, request)) orelse return respondUploadError(request, .bad_request, "attachment needs a name");│ │912 defer allocator.free(name); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 997 ) !void { │ │ 998 const parts = commentBaseParts(base) orelse return respondRemoveNotFound(request); │ │ 999 if (parts.comment_id != null) return handleCommentEdit(io, request, allocator, base, host, parts);│ │1003 - return handleTopicEdit(io, request, allocator, base, host, parts); │ │1000 + return handleThreadEdit(io, request, allocator, base, host, parts); │ │1001 } │ │1002 │ │1003 // replace the body of the comment the url names, then redirect to its │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1012 ) !void { │ │1013 var author_arena = std.heap.ArenaAllocator.init(allocator); │ │1014 defer author_arena.deinit(); │ │1018 - const author = (try eventAuthor(io, allocator, &author_arena, request, host)) orelse return respondLoginRequired(request); │ │1015 + const author = ((try eventAuthor(io, allocator, &author_arena, request, host)) orelse return respondLoginRequired(request)).author;│ │1016 │ │1017 const form_body = try readFormBody(request, allocator); │ │1018 defer allocator.free(form_body); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1109 │ │1110 var author_arena = std.heap.ArenaAllocator.init(allocator); │ │1111 defer author_arena.deinit(); │ │1115 - const author = (try eventAuthor(io, allocator, &author_arena, request, host)) orelse return respondLoginRequired(request); │ │1112 + const request_author = (try eventAuthor(io, allocator, &author_arena, request, host)) orelse return respondLoginRequired(request);│ │1113 + const author = request_author.author; │ │1114 │ │1115 const request_repo = (try requestRepoSource(io, allocator, host, parts.repo_base)) orelse return respondRemoveNotFound(request); │ │1116 defer request_repo.deinit(allocator); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1118 │ │1119 if (parts.kind == .patch) switch (host) { │ │1120 .remote => |remote| { │ │1123 - const token = getCookieValue(request, cookie_name) orelse return respondLoginRequired(request); │ │1124 - var user_id: [evt.event_id_size]u8 = undefined; │ │1125 - if (!remote.session_store.lookup(token, &user_id)) return respondLoginRequired(request); │ │1121 + const user_id = request_author.user_id orelse return respondLoginRequired(request); │ │1122 │ │1123 var admin_repo = try rp.Repo(.xit, evt.admin_repo_opts).open(io, allocator, .{ .path = remote.admin_repo_path });│ │1124 defer admin_repo.deinit(io, allocator); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1223 │ │1224 var author_arena = std.heap.ArenaAllocator.init(allocator); │ │1225 defer author_arena.deinit(); │ │1230 - const author = (try eventAuthor(io, allocator, &author_arena, request, host)) orelse return respondLoginRequired(request); │ │1226 + const author = ((try eventAuthor(io, allocator, &author_arena, request, host)) orelse return respondLoginRequired(request)).author; │ │1227 │ │1228 (switch (parts.thread_kind) { │ │1229 .issue => updateThread(evt.Issue, io, allocator, host, parts.repo_base, &parts.thread_id, .{ .status = if (open) .open else .closed }, author),│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────╮ │1249 }); │ │1250 } │ │1251 │ │1256 -// replace the title, tags and description of an issue or discussion.│ │1257 -fn handleTopicEdit( │ │1252 +// replace the title, tags and description of a thread. │ │1253 +fn handleThreadEdit( │ │1254 io: std.Io, │ │1255 request: *std.http.Server.Request, │ │1256 allocator: std.mem.Allocator, │ ╰───────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯