Changeset

3626:c84bbf36c878

mod_cloud_notify: fix local variable usage
author tmolitor <thilo@eightysoft.de>
date Mon, 01 Jul 2019 18:49:24 +0200
parents 3625:a578b4977bb0
children 3627:9639c493f4b9
files mod_cloud_notify/mod_cloud_notify.lua
diffstat 1 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mod_cloud_notify/mod_cloud_notify.lua	Sat Jun 29 19:26:08 2019 +0200
+++ b/mod_cloud_notify/mod_cloud_notify.lua	Mon Jul 01 18:49:24 2019 +0200
@@ -582,11 +582,8 @@
 module:hook("archive-message-added", archive_message_added);
 
 local function send_ping(event)
-	local push_services = event.push_services;
-	if not push_services then
-		local user = event.user;
-		push_services = push_store:get(user);
-	end
+	local user = event.user;
+	local push_services = event.push_services || push_store:get(user);
 	handle_notify_request(nil, user, push_services, true);
 end
 -- can be used by other modules to ping one or more (or all) push endpoints