Software /
code /
prosody
Diff
plugins/muc/subject.lib.lua @ 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 |
parent | 6224:2a9aff163545 |
child | 6277:f2c9c36979b3 |
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