Mercurial > prosody-hg
comparison plugins/muc/subject.lib.lua @ 8884:a387e00471d6
Backed out changeset cd186331ab1f (subject in disco#info)
Makes more sense if you must join the room to see the subject, since
there’s a separate public description field.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 07 Jun 2018 18:53:30 +0200 |
| parents | 26f1a49fa9c0 |
| children | d41f8ce67c8e |
comparison
equal
deleted
inserted
replaced
| 8883:3f975bbfec3b | 8884:a387e00471d6 |
|---|---|
| 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 | |
| 83 -- Send subject to joining user | 76 -- Send subject to joining user |
| 84 module:hook("muc-occupant-session-new", function(event) | 77 module:hook("muc-occupant-session-new", function(event) |
| 85 send_subject(event.room, event.stanza.attr.from); | 78 send_subject(event.room, event.stanza.attr.from); |
| 86 end, 20); | 79 end, 20); |
| 87 | 80 |
