MUC: Split out sending of the topic into method separate from sending history
authorKim Alvefur <zash@zash.se>
Sat, 18 Jan 2014 18:11:13 +0100
changeset 5983 930109558aa2
parent 5982 2d5685c6262f
child 5984 c68e2b11d691
MUC: Split out sending of the topic into method separate from sending history
plugins/muc/muc.lib.lua
--- a/plugins/muc/muc.lib.lua	Sat Jan 18 18:05:42 2014 +0100
+++ b/plugins/muc/muc.lib.lua	Sat Jan 18 18:11:13 2014 +0100
@@ -187,6 +187,8 @@
 			self:_route_stanza(msg);
 		end
 	end
+end
+function room_mt:send_subject(to)
 	if self._data['subject'] then
 		self:_route_stanza(st.message({type='groupchat', from=self._data['subject_from'] or self.jid, to=to}):tag("subject"):text(self._data['subject']));
 	end
@@ -516,6 +518,7 @@
 						pr.attr.to = from;
 						self:_route_stanza(pr);
 						self:send_history(from, stanza);
+						self:send_subject(from);
 					elseif not affiliation then -- registration required for entering members-only room
 						local reply = st.error_reply(stanza, "auth", "registration-required"):up();
 						reply.tags[1].attr.code = "407";