diff src/lib/Notify.luan @ 104:46418395c860 default tip

add mute chat
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 14 Jul 2025 00:49:11 -0600
parents 246a792adedf
children
line wrap: on
line diff
--- a/src/lib/Notify.luan	Sun Jul 13 14:38:52 2025 -0600
+++ b/src/lib/Notify.luan	Mon Jul 14 00:49:11 2025 -0600
@@ -38,11 +38,15 @@
 	local users = {}
 	local fns = {}
 
-	function fns.add(user_ids)
+	function fns.add(user_ids,mute_ids)
 		local now = time_now()
 		for _, user_id in ipairs(user_ids) do
 			local user = get_user_by_id(user_id)
-			if users[user_id] == nil and user.notify_email ~= nil and (user.multi_notify or not user.was_notified) then
+			if users[user_id] == nil \
+				and user.notify_email ~= nil \
+				and not mute_ids[user_id] \
+				and (user.multi_notify or not user.was_notified) \
+			then
 				users[user_id] = now
 				-- logger.info("add "..user_id)
 			end
@@ -88,7 +92,7 @@
 
 function Notify.add(chat)
 	Thread.run(function()
-		glob.add(chat.user_ids)
+		glob.add(chat.user_ids,chat.mute_ids)
 	end)
 end