aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/subject.lib.lua
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2014-04-18 12:20:07 -0400
committerdaurnimator <quae@daurnimator.com>2014-04-18 12:20:07 -0400
commit943088da0cc04e5b110d5d7655d12d88613c2c18 (patch)
tree31dc0364d9992f7d3797a3e803e2ca3af0810f92 /plugins/muc/subject.lib.lua
parent59c6047e77980b89431b1d59e1458976bfb6eb18 (diff)
downloadprosody-943088da0cc04e5b110d5d7655d12d88613c2c18.tar.gz
prosody-943088da0cc04e5b110d5d7655d12d88613c2c18.zip
plugins/muc/subject.lib: If subject is not set by an occupant, it should come from room jid itself
Diffstat (limited to 'plugins/muc/subject.lib.lua')
-rw-r--r--plugins/muc/subject.lib.lua5
1 files changed, 3 insertions, 2 deletions
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 <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 @@ 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