naughty.dbus: Fix the CloseNotification method
It was broken when naughty was split up. Thanks to trollixx for reporting this on IRC. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
dea5a23eac
commit
26ffd2c6f2
|
@ -224,7 +224,7 @@ end
|
||||||
-- Get notification by ID
|
-- Get notification by ID
|
||||||
-- @param id ID of the notification
|
-- @param id ID of the notification
|
||||||
-- @return notification object if it was found, nil otherwise
|
-- @return notification object if it was found, nil otherwise
|
||||||
local function getById(id)
|
function naughty.getById(id)
|
||||||
-- iterate the notifications to get the notfications with the correct ID
|
-- iterate the notifications to get the notfications with the correct ID
|
||||||
for s = 1, capi.screen.count() do
|
for s = 1, capi.screen.count() do
|
||||||
for p,pos in pairs(naughty.notifications[s]) do
|
for p,pos in pairs(naughty.notifications[s]) do
|
||||||
|
@ -308,7 +308,7 @@ function naughty.notify(args)
|
||||||
|
|
||||||
-- replace notification if needed
|
-- replace notification if needed
|
||||||
if args.replaces_id then
|
if args.replaces_id then
|
||||||
local obj = getById(args.replaces_id)
|
local obj = naughty.getById(args.replaces_id)
|
||||||
if obj then
|
if obj then
|
||||||
-- destroy this and ...
|
-- destroy this and ...
|
||||||
naughty.destroy(obj, naughty.notificationClosedReason.silent)
|
naughty.destroy(obj, naughty.notificationClosedReason.silent)
|
||||||
|
|
|
@ -181,7 +181,7 @@ capi.dbus.connect_signal("org.freedesktop.Notifications", function (data, appnam
|
||||||
end
|
end
|
||||||
return "u", "0"
|
return "u", "0"
|
||||||
elseif data.member == "CloseNotification" then
|
elseif data.member == "CloseNotification" then
|
||||||
local obj = getById(appname)
|
local obj = naughty.getById(appname)
|
||||||
if obj then
|
if obj then
|
||||||
naughty.destroy(obj, naughty.notificationClosedReason.dismissedByCommand)
|
naughty.destroy(obj, naughty.notificationClosedReason.dismissedByCommand)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue