"Fossies" - the Fresh Open Source Software Archive

Member "jitsi-meet-5079/resources/prosody-plugins/mod_poltergeist_component.lua" (17 Jun 2021, 592 Bytes) of package /linux/misc/jitsi-meet-5079.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Lua source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 local st = require "util.stanza";
    2 
    3 -- A component which we use to receive all stanzas for the created poltergeists
    4 -- replays with error if an iq is sent
    5 function no_action()
    6     return true;
    7 end
    8 
    9 function error_reply(event)
   10     module:send(st.error_reply(event.stanza, "cancel", "service-unavailable"));
   11     return true;
   12 end
   13 
   14 module:hook("presence/host", no_action);
   15 module:hook("message/host", no_action);
   16 module:hook("presence/full", no_action);
   17 module:hook("message/full", no_action);
   18 
   19 module:hook("iq/host", error_reply);
   20 module:hook("iq/full", error_reply);
   21 module:hook("iq/bare", error_reply);