aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/subject.lib.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-06-01 08:03:12 +0200
committerKim Alvefur <zash@zash.se>2018-06-01 08:03:12 +0200
commitac4af3929541d0c9fe5dc5d2ae9313042c5fcc94 (patch)
tree963f701c278583a79a0d25add921c6dffcb844c9 /plugins/muc/subject.lib.lua
parent1a92eb50ec14ced5cbe73cbc18d764f489e4ba9c (diff)
downloadprosody-ac4af3929541d0c9fe5dc5d2ae9313042c5fcc94.tar.gz
prosody-ac4af3929541d0c9fe5dc5d2ae9313042c5fcc94.zip
MUC: Advertise room subject in disco#info
Diffstat (limited to 'plugins/muc/subject.lib.lua')
-rw-r--r--plugins/muc/subject.lib.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/muc/subject.lib.lua b/plugins/muc/subject.lib.lua
index 3bedc69c..e2fe9b51 100644
--- a/plugins/muc/subject.lib.lua
+++ b/plugins/muc/subject.lib.lua
@@ -73,6 +73,13 @@ local function set_subject(room, from, subject)
return true;
end
+module:hook("muc-disco#info", function (event)
+ table.insert(event.form, {
+ name = "muc#roominfo_subject";
+ });
+ event.formdata["muc#roominfo_subject"] = select(2, get_subject(event.room));
+end);
+
-- Send subject to joining user
module:hook("muc-occupant-session-new", function(event)
send_subject(event.room, event.stanza.attr.from);