ruled.notification: Handle legacy presets.

This is deprecated, but some modules like `lain` use them, so it
must still minimally work for backward compatibility.
This commit is contained in:
Emmanuel Lepage Vallee 2021-09-16 16:37:20 -07:00
parent e752943b98
commit 9336b62f80
1 changed files with 9 additions and 0 deletions

View File

@ -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