diff src/lib/Shared.luan @ 53:9298b04607ae

add unread
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 03 Mar 2025 19:39:30 -0700
parents 38c209714df9
children 8270106644db
line wrap: on
line diff
--- a/src/lib/Shared.luan	Mon Mar 03 12:29:06 2025 -0700
+++ b/src/lib/Shared.luan	Mon Mar 03 19:39:30 2025 -0700
@@ -147,10 +147,13 @@
 	for _, chat in ipairs(chats) do
 		local user_id = chat.other_user_id(user.id)
 		local other_user = get_user_by_id(user_id) or error()
+		local unread = chat.unread(user)
 %>
-		<div chat="<%=chat.id%>" onclick='selectChat(this,<%=json_string(other_user.email)%>)'><%
-			%><%= other_user.name_html() %><span online="<%= other_user.id %>"></span><%
-		%></div>
+		<div chat="<%=chat.id%>" onclick='selectChat(this,<%=json_string(other_user.email)%>)'>
+			<%= other_user.name_html() %>
+			<span online="<%= other_user.id %>"></span>
+			<span unread="<%=unread%>"><%=unread%></span>
+		</div>
 <%
 	end
 end