From 9336b62f80cbba466f6e1fa482042c5aa2cb0bba Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Thu, 16 Sep 2021 16:37:20 -0700 Subject: [PATCH] ruled.notification: Handle legacy presets. This is deprecated, but some modules like `lain` use them, so it must still minimally work for backward compatibility. --- lib/ruled/notification.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/ruled/notification.lua b/lib/ruled/notification.lua index f76cbc4f..de6b306e 100644 --- a/lib/ruled/notification.lua +++ b/lib/ruled/notification.lua @@ -160,6 +160,15 @@ end -- @staticfct ruled.notification.apply function module.apply(n) local callbacks, props = {}, {} + + if n.preset then + for k, v in pairs(n.preset) do + if not n._private[v] then + props[k] = v + end + end + end + for _, v in ipairs(nrules._matching_source) do v.callback(nrules, n, props, callbacks) end