Software /
code /
prosody
Changeset
6228:4968d18e2c1e
plugins/muc/subject.lib: If subject is not set by an occupant, it should come from room jid itself
author | daurnimator <quae@daurnimator.com> |
---|---|
date | Fri, 18 Apr 2014 12:20:07 -0400 |
parents | 6227:bb75c011b15e |
children | 6229:8aa59b73f801 |
files | plugins/muc/subject.lib.lua |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/muc/subject.lib.lua Fri Apr 18 12:19:33 2014 -0400 +++ b/plugins/muc/subject.lib.lua Fri Apr 18 12:20:07 2014 -0400 @@ -43,7 +43,8 @@ end); local function get_subject(room) - return room._data.subject_from, room._data.subject; + -- a <message/> stanza from the room JID (or from the occupant JID of the entity that set the subject) + return room._data.subject_from or room.jid, room._data.subject; end local function send_subject(room, to) @@ -66,7 +67,7 @@ -- Send subject to joining user module:hook("muc-occupant-joined", function(event) - event.room:send_subject(event.stanza.attr.from); + send_subject(event.room, event.stanza.attr.from); end, 20); -- Role check for subject changes