MUC: Store the nick (full room JID) which set the subject, and send subject to occupants from that JID.

Tue, 20 Jul 2010 17:39:02 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Tue, 20 Jul 2010 17:39:02 +0500
changeset 3393
5b8de0731c4d
parent 3392
6e31b49c4ab8
child 3394
9bf5f2b3314b

MUC: Store the nick (full room JID) which set the subject, and send subject to occupants from that JID.

plugins/muc/muc.lib.lua file | annotate | diff | comparison | revisions
--- 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();

mercurial