"Fossies" - the Fresh Open Source Software Archive

Member "jitsi-meet-5086/resources/prosody-plugins/mod_presence_identity.lua" (22 Jun 2021, 728 Bytes) of package /linux/misc/jitsi-meet-5086.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 stanza = require "util.stanza";
    2 local update_presence_identity = module:require "util".update_presence_identity;
    3 
    4 -- For all received presence messages, if the jitsi_meet_context_(user|group)
    5 -- values are set in the session, then insert them into the presence messages
    6 -- for that session.
    7 function on_message(event)
    8     if event and event["stanza"] then
    9       if event.origin and event.origin.jitsi_meet_context_user then
   10 
   11           update_presence_identity(
   12               event.stanza,
   13               event.origin.jitsi_meet_context_user,
   14               event.origin.jitsi_meet_context_group
   15           );
   16 
   17       end
   18     end
   19 end
   20 
   21 module:hook("pre-presence/bare", on_message);
   22 module:hook("pre-presence/full", on_message);