naughty: Fix builds without dbus

The new notification action code tried to emit dbus signals even if awesome was
build without notification support. Fix this by adding the necessary "if".

(This also removes an unused return value which wasn't marked as "local" and
thus triggered my "complain if something messes with the global env"-script)

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2015-01-10 16:56:03 +01:00
parent a36ddb68e1
commit d5088c5f6f
1 changed files with 12 additions and 8 deletions

View File

@ -259,17 +259,21 @@ local function getById(id)
end
local function sendActionInvoked(notificationId, action)
res = capi.dbus.emit_signal("session", "/org/freedesktop/Notifications",
"org.freedesktop.Notifications", "ActionInvoked",
"i", notificationId,
"s", action)
if capi.dbus then
capi.dbus.emit_signal("session", "/org/freedesktop/Notifications",
"org.freedesktop.Notifications", "ActionInvoked",
"i", notificationId,
"s", action)
end
end
local function sendNotificationClosed(notificationId, reason)
res = capi.dbus.emit_signal("session", "/org/freedesktop/Notifications",
"org.freedesktop.Notifications", "NotificationClosed",
"i", notificationId,
"i", reason)
if capi.dbus then
capi.dbus.emit_signal("session", "/org/freedesktop/Notifications",
"org.freedesktop.Notifications", "NotificationClosed",
"i", notificationId,
"i", reason)
end
end
--- Create notification. args is a dictionary of (optional) arguments.