comparison mod_cloud_notify/mod_cloud_notify.lua @ 4698:4157773ed4d3

mod_cloud_notify: notify on groupchat messages sent to bare JID
author arcseconds <arcseconds@zoho.com>
date Sat, 25 Sep 2021 11:43:31 +0000
parents ea820de69265
children 48d7a5c16f2b
comparison
equal deleted inserted replaced
4697:15c335dc196e 4698:4157773ed4d3
401 local node, user_push_services = get_push_settings(event.stanza, event.origin); 401 local node, user_push_services = get_push_settings(event.stanza, event.origin);
402 module:log("debug", "Invoking cloud handle_notify_request() for offline stanza"); 402 module:log("debug", "Invoking cloud handle_notify_request() for offline stanza");
403 handle_notify_request(event.stanza, node, user_push_services, true); 403 handle_notify_request(event.stanza, node, user_push_services, true);
404 end, 1); 404 end, 1);
405 405
406 -- publish on bare groupchat
407 -- this picks up MUC messages when there are no devices connected
408 module:hook("message/bare/groupchat", function(event)
409 module:log("debug", "Invoking cloud handle_notify_request() for bare groupchat stanza");
410 local node, user_push_services = get_push_settings(event.stanza, event.origin);
411 handle_notify_request(event.stanza, node, user_push_services, true);
412 end, 1);
413
414
406 local function process_stanza_queue(queue, session, queue_type) 415 local function process_stanza_queue(queue, session, queue_type)
407 if not session.push_identifier then return; end 416 if not session.push_identifier then return; end
408 local user_push_services = {[session.push_identifier] = session.push_settings}; 417 local user_push_services = {[session.push_identifier] = session.push_settings};
409 local notified = { unimportant = false; important = false } 418 local notified = { unimportant = false; important = false }
410 for i=1, #queue do 419 for i=1, #queue do