comparison mod_cloud_notify/mod_cloud_notify.lua @ 4713:ae3a129cc296

mod_cloud_notify: Record client id (or resource) and language during registration
author Matthew Wild <mwild1@gmail.com>
date Mon, 18 Oct 2021 11:44:13 +0100
parents 48d7a5c16f2b
children 8b3e91249cff
comparison
equal deleted inserted replaced
4712:48d7a5c16f2b 4713:ae3a129cc296
186 jid = push_jid; 186 jid = push_jid;
187 node = push_node; 187 node = push_node;
188 include_payload = include_payload; 188 include_payload = include_payload;
189 options = publish_options and st.preserialize(publish_options); 189 options = publish_options and st.preserialize(publish_options);
190 timestamp = os_time(); 190 timestamp = os_time();
191 client = {
192 id = origin.client_id;
193 resource = not origin.client_id and origin.jid.resource(origin.full_jid) or nil;
194 language = stanza.attr["xml:lang"];
195 };
191 }; 196 };
192 local allow_registration = module:fire_event("cloud_notify/registration", { 197 local allow_registration = module:fire_event("cloud_notify/registration", {
193 origin = origin, stanza = stanza, push_info = push_service; 198 origin = origin, stanza = stanza, push_info = push_service;
194 }); 199 });
195 if allow_registration == false then 200 if allow_registration == false then