From a522c82882dee047db4ae1b29fecc9d1a29f15f9 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Tue, 20 Jul 2010 17:39:02 +0500 Subject: [PATCH] MUC: Store the nick (full room JID) which set the subject, and send subject to occupants from that JID. --- plugins/muc/muc.lib.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index e679f9fe..9cdf4d18 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -206,7 +206,7 @@ function room_mt:send_history(to, stanza) 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 @@ function room_mt:set_subject(current_nick, subject) -- 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(); -- 2.30.2