changeset 106:15cf43dd144c default tip

handle reply to deleted
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 03 Sep 2025 07:58:46 -0600
parents 62d6725b4db0
children
files src/chat.css src/lib/Shared.luan
diffstat 2 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/chat.css	Fri Jul 25 14:39:13 2025 -0600
+++ b/src/chat.css	Wed Sep 03 07:58:46 2025 -0600
@@ -148,7 +148,8 @@
 	padding-left: 8px;
 }
 div[reply] a,
-div[quote] [when] {
+div[quote] [when],
+div[quote] [deleted] {
 	font-size: 12px;
 }
 
--- a/src/lib/Shared.luan	Fri Jul 25 14:39:13 2025 -0600
+++ b/src/lib/Shared.luan	Wed Sep 03 07:58:46 2025 -0600
@@ -111,8 +111,8 @@
 	local user = current_user() or error()
 	local author = get_user_by_id(author_id)
 	local id = post.id
-	local reply = post.reply
-	reply = reply and get_post_by_id(reply)
+	local reply_id = post.reply
+	local reply = reply_id and get_post_by_id(reply_id)
 %>
 		<div post="<%=id%>" author="<%=author.id%>" id="p<%=id%>" fix>
 			<div who>
@@ -127,6 +127,10 @@
 				<blockquote><%= html_encode(reply.content) %></blockquote>
 				<div><a when href="#p<%=reply.id%>"><%=reply.date%></a></div>
 			</div>
+<%	elseif reply_id ~= nil then %>
+			<div quote>
+				<span deleted>Message deleted</span>
+			</div>
 <%	end %>
 			<div text><%= html_encode(post.content) %></div>
 		</div>