MUC: Store the nick (full room JID) which set the subject, and send subject to occupa...
authorWaqas Hussain <waqas20@gmail.com>
Tue, 20 Jul 2010 12:39:02 +0000 (17:39 +0500)
committerWaqas Hussain <waqas20@gmail.com>
Tue, 20 Jul 2010 12:39:02 +0000 (17:39 +0500)
plugins/muc/muc.lib.lua

index e679f9fe6bb9b3b7ecbd5e527103e5402f944bd2..9cdf4d189a4b5ccbfc47a573c9b7bde94257458a 100644 (file)
@@ -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();