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:
Uli Schlachter 2015-01-10 21:06:30 +01:00
parent dea5a23eac
commit 26ffd2c6f2
2 changed files with 3 additions and 3 deletions

View File

@ -224,7 +224,7 @@ end
-- Get notification by ID
-- @param id ID of the notification
-- @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
for s = 1, capi.screen.count() do
for p,pos in pairs(naughty.notifications[s]) do
@ -308,7 +308,7 @@ function naughty.notify(args)
-- replace notification if needed
if args.replaces_id then
local obj = getById(args.replaces_id)
local obj = naughty.getById(args.replaces_id)
if obj then
-- destroy this and ...
naughty.destroy(obj, naughty.notificationClosedReason.silent)

View File

@ -181,7 +181,7 @@ capi.dbus.connect_signal("org.freedesktop.Notifications", function (data, appnam
end
return "u", "0"
elseif data.member == "CloseNotification" then
local obj = getById(appname)
local obj = naughty.getById(appname)
if obj then
naughty.destroy(obj, naughty.notificationClosedReason.dismissedByCommand)
end