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
commit70a87e5d5e5fe24252d03a5263243c19745ea72d (patch)
tree31dc0364d9992f7d3797a3e803e2ca3af0810f92 /plugins/muc/subject.lib.lua
parent544685b84c9618705ba70bb0c1a2ebb5258d67b2 (diff)
downloadprosody-70a87e5d5e5fe24252d03a5263243c19745ea72d.tar.gz
prosody-70a87e5d5e5fe24252d03a5263243c19745ea72d.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