From 70a87e5d5e5fe24252d03a5263243c19745ea72d Mon Sep 17 00:00:00 2001 From: daurnimator Date: Fri, 18 Apr 2014 12:20:07 -0400 Subject: plugins/muc/subject.lib: If subject is not set by an occupant, it should come from room jid itself --- plugins/muc/subject.lib.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins/muc/subject.lib.lua') diff --git a/plugins/muc/subject.lib.lua b/plugins/muc/subject.lib.lua index a42a18c5..44fc915c 100644 --- a/plugins/muc/subject.lib.lua +++ b/plugins/muc/subject.lib.lua @@ -43,7 +43,8 @@ module:hook("muc-config-submitted", function(event) end); local function get_subject(room) - return room._data.subject_from, room._data.subject; + -- a 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 @@ end -- 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 -- cgit v1.2.3