"Fossies" - the Fresh Open Source Software Archive

Member "jitsi-meet-7319/resources/prosody-plugins/mod_jitsi_session.lua" (6 Jun 2023, 1181 Bytes) of package /linux/misc/jitsi-meet-7319.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. See also the last Fossies "Diffs" side-by-side code changes report for "mod_jitsi_session.lua": jitsi-meet_8319_vs_jitsi-meet_8615.

    1 -- Jitsi session information
    2 -- Copyright (C) 2021-present 8x8, Inc.
    3 module:set_global();
    4 
    5 local formdecode = require "util.http".formdecode;
    6 
    7 -- Extract the following parameters from the URL and set them in the session:
    8 -- * previd: for session resumption
    9 function init_session(event)
   10     local session, request = event.session, event.request;
   11     local query = request.url.query;
   12 
   13     if query ~= nil then
   14         local params = formdecode(query);
   15 
   16         -- previd is used together with https://modules.prosody.im/mod_smacks.html
   17         -- the param is used to find resumed session and re-use anonymous(random) user id
   18         session.previd = query and params.previd or nil;
   19 
   20         -- customusername can be used with combination with "pre-jitsi-authentication" event to pre-set a known jid to a session
   21         session.customusername = query and params.customusername or nil;
   22 
   23         -- The room name and optional prefix from the web query
   24         session.jitsi_web_query_room = params.room;
   25         session.jitsi_web_query_prefix = params.prefix or "";
   26     end
   27 end
   28 
   29 module:hook_global("bosh-session", init_session);
   30 module:hook_global("websocket-session", init_session);