summaryrefslogtreecommitdiff
path: root/jitsi-meet/prosody-plugins/mod_presence_identity.lua
diff options
context:
space:
mode:
authorAntoine Ouvrard <antoine.ouvrard@nereide.fr>2020-11-23 10:28:32 +0100
committerAntoine Ouvrard <antoine.ouvrard@nereide.fr>2020-11-23 10:28:32 +0100
commitd3277d65639ef43230b71305922b5ccf33d86083 (patch)
tree87455d87a534c1bcb33a34290b840b68e573df96 /jitsi-meet/prosody-plugins/mod_presence_identity.lua
initial commit
Diffstat (limited to 'jitsi-meet/prosody-plugins/mod_presence_identity.lua')
-rw-r--r--jitsi-meet/prosody-plugins/mod_presence_identity.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/jitsi-meet/prosody-plugins/mod_presence_identity.lua b/jitsi-meet/prosody-plugins/mod_presence_identity.lua
new file mode 100644
index 0000000..4db397e
--- /dev/null
+++ b/jitsi-meet/prosody-plugins/mod_presence_identity.lua
@@ -0,0 +1,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);