summaryrefslogtreecommitdiff
path: root/jitsi-meet/prosody-plugins/mod_presence_identity.lua
blob: 4db397e841f483d07bf88c252442decf365e409f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
local stanza = require "util.stanza";
local update_presence_identity = module:require "util".update_presence_identity;

-- 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

          update_presence_identity(
              event.stanza,
              event.origin.jitsi_meet_context_user,
              event.origin.jitsi_meet_context_group
          );

      end
    end
end

module:hook("pre-presence/bare", on_message);
module:hook("pre-presence/full", on_message);