comparison mod_webpresence/mod_webpresence.lua @ 2348:1903add39b7c

mod_webpresence: Check that top resources are set (fixes #665)
author Kim Alvefur <zash@zash.se>
date Mon, 07 Nov 2016 17:27:18 +0100
parents 9a1b3f0d0939
children
comparison
equal deleted inserted replaced
2347:a47520a2c59d 2348:1903add39b7c
27 user, host = host, event.request.headers.host; 27 user, host = host, event.request.headers.host;
28 if host then host = host:gsub(":%d+$", ""); end 28 if host then host = host:gsub(":%d+$", ""); end
29 end 29 end
30 if user and host then 30 if user and host then
31 local user_sessions = hosts[host] and hosts[host].sessions[user]; 31 local user_sessions = hosts[host] and hosts[host].sessions[user];
32 if user_sessions then 32 if user_sessions and user_sessions.top_resources then
33 status = user_sessions.top_resources[1]; 33 status = user_sessions.top_resources[1];
34 if status and status.presence then 34 if status and status.presence then
35 message = status.presence:child_with_name("status"); 35 message = status.presence:child_with_name("status");
36 status = status.presence:child_with_name("show"); 36 status = status.presence:child_with_name("show");
37 if not status then 37 if not status then