Mercurial > prosody-hg
comparison plugins/muc/subject.lib.lua @ 8849:cd186331ab1f
MUC: Advertise room subject in disco#info
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 01 Jun 2018 08:03:12 +0200 |
| parents | 402d8febfa43 |
| children | 26f1a49fa9c0 |
comparison
equal
deleted
inserted
replaced
| 8848:402d8febfa43 | 8849:cd186331ab1f |
|---|---|
| 71 local msg = create_subject_message(from, subject); | 71 local msg = create_subject_message(from, subject); |
| 72 room:broadcast_message(msg); | 72 room:broadcast_message(msg); |
| 73 return true; | 73 return true; |
| 74 end | 74 end |
| 75 | 75 |
| 76 module:hook("muc-disco#info", function (event) | |
| 77 table.insert(event.form, { | |
| 78 name = "muc#roominfo_subject"; | |
| 79 }); | |
| 80 event.formdata["muc#roominfo_subject"] = select(2, get_subject(event.room)); | |
| 81 end); | |
| 82 | |
| 76 -- Send subject to joining user | 83 -- Send subject to joining user |
| 77 module:hook("muc-occupant-session-new", function(event) | 84 module:hook("muc-occupant-session-new", function(event) |
| 78 send_subject(event.room, event.stanza.attr.from); | 85 send_subject(event.room, event.stanza.attr.from); |
| 79 end, 20); | 86 end, 20); |
| 80 | 87 |
