X-Git-Url: https://gitweb.ps.run/chirp/blobdiff_plain/12f0f2f8e72e933531b0ac6865265461d97e2312..4dcd5892e7db988893845b389abc4fd1a48d3fec:/src/main.zig diff --git a/src/main.zig b/src/main.zig index 74070d6..6455207 100644 --- a/src/main.zig +++ b/src/main.zig @@ -31,7 +31,6 @@ const User = struct { display_name: DisplayName, password_hash: PasswordHash, posts: PostList, - replies: PostList, following: UserList, followers: UserList, @@ -223,7 +222,6 @@ const Chirp = struct { .display_name = display_name, .password_hash = try hash_password(password), .posts = try PostList.init(txn), - .replies = try PostList.init(txn), .following = try UserList.init(txn), .followers = try UserList.init(txn), .post_lists = try PostListList.init(txn), @@ -328,11 +326,7 @@ const Chirp = struct { txn.abort(); const post_id = try append_post(env, user_id, user.posts, null, null, text); - - txn = try env.txn(); - var replies_view = try user.replies.open(txn); - try replies_view.append(post_id); - try txn.commit(); + _ = post_id; } fn comment(env: lmdb.Env, user_id: UserId, parent_post_id: PostId, text: []const u8) !void { @@ -347,7 +341,7 @@ const Chirp = struct { const post_id = try append_post(env, user_id, parent_post.comments, parent_post_id, null, text); txn = try env.txn(); - var replies_view = try user.replies.open(txn); + var replies_view = try user.posts.open(txn); try replies_view.append(post_id); try txn.commit(); } @@ -359,11 +353,7 @@ const Chirp = struct { txn.abort(); const post_id = try append_post(env, user_id, user.posts, null, quote_post_id, text); - - txn = try env.txn(); - var replies_view = try user.replies.open(txn); - try replies_view.append(post_id); - try txn.commit(); + _ = post_id; } fn vote(env: lmdb.Env, post_id: PostId, user_id: UserId, kind: Vote.Kind) !void { @@ -521,17 +511,13 @@ fn write_header(res: *http.Response, logged_in: ?Login) !void { \\ \\ \\ - \\ + \\
\\
\\ \\ \\ - \\
+ \\

, .{}); - try html_form(res, "/quit", .{ - \\type="submit" value="Quit" - }); - try res.write("

", .{}); } } fn write_start(res: *http.Response) !void { @@ -540,6 +526,7 @@ fn write_start(res: *http.Response) !void { \\ \\ \\ + \\ \\