Changeset

3393:5b8de0731c4d

MUC: Store the nick (full room JID) which set the subject, and send subject to occupants from that JID.
author Waqas Hussain <waqas20@gmail.com>
date Tue, 20 Jul 2010 17:39:02 +0500
parents 3392:6e31b49c4ab8
children 3394:9bf5f2b3314b
files plugins/muc/muc.lib.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/muc/muc.lib.lua	Tue Jul 20 12:37:28 2010 +0100
+++ b/plugins/muc/muc.lib.lua	Tue Jul 20 17:39:02 2010 +0500
@@ -206,7 +206,7 @@
 		end
 	end
 	if self._data['subject'] then
-		self:_route_stanza(st.message({type='groupchat', from=self.jid, to=to}):tag("subject"):text(self._data['subject']));
+		self:_route_stanza(st.message({type='groupchat', from=self._data['subject_from'] or self.jid, to=to}):tag("subject"):text(self._data['subject']));
 	end
 end
 
@@ -233,6 +233,7 @@
 	-- TODO check nick's authority
 	if subject == "" then subject = nil; end
 	self._data['subject'] = subject;
+	self._data['subject_from'] = current_nick;
 	if self.save then self:save(); end
 	local msg = st.message({type='groupchat', from=current_nick})
 		:tag('subject'):text(subject):up();