2018-03-20 20:27:39 +00:00
|
|
|
local stanza = require "util.stanza";
|
2018-03-23 20:58:05 +00:00
|
|
|
local update_presence_identity = module:require "util".update_presence_identity;
|
2018-03-20 20:27:39 +00:00
|
|
|
|
|
|
|
-- For all received presence messages, if the jitsi_meet_context_(user|group)
|
|
|
|
-- values are set in the session, then insert them into the presence messages
|
|
|
|
-- for that session.
|
|
|
|
function on_message(event)
|
|
|
|
if event and event["stanza"] then
|
|
|
|
if event.origin and event.origin.jitsi_meet_context_user then
|
|
|
|
|
2018-03-23 20:58:05 +00:00
|
|
|
update_presence_identity(
|
|
|
|
event.stanza,
|
|
|
|
event.origin.jitsi_meet_context_user,
|
|
|
|
event.origin.jitsi_meet_context_group
|
|
|
|
);
|
2018-03-20 20:27:39 +00:00
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
module:hook("pre-presence/bare", on_message);
|
|
|
|
module:hook("pre-presence/full", on_message);
|