aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/muc.lib.lua
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2014-03-28 20:25:10 -0400
committerdaurnimator <quae@daurnimator.com>2014-03-28 20:25:10 -0400
commit84060786506a2a3180dce7ae57beebe7e651d7c7 (patch)
tree2dec4b9ff4299644d7e66166c0f32e2d0c58ea31 /plugins/muc/muc.lib.lua
parentad434dae47724f59a03b6ec1eefa04290d9b9ea2 (diff)
downloadprosody-84060786506a2a3180dce7ae57beebe7e651d7c7.tar.gz
prosody-84060786506a2a3180dce7ae57beebe7e651d7c7.zip
plugins/muc/muc.lib: Subjects get sent even if empty.
Diffstat (limited to 'plugins/muc/muc.lib.lua')
-rw-r--r--plugins/muc/muc.lib.lua17
1 files changed, 6 insertions, 11 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index c1747440..7704a099 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -424,26 +424,21 @@ end
function room_mt:get_subject()
return self._data['subject'], self._data['subject_from']
end
-local function create_subject_message(subject)
- return st.message({type='groupchat'})
+local function create_subject_message(from, subject)
+ return st.message({from = from; type = "groupchat"})
:tag('subject'):text(subject):up();
end
function room_mt:send_subject(to)
- local from, subject = self:get_subject()
- if subject then
- local msg = create_subject_message(subject)
- msg.attr.from = from
- msg.attr.to = to
- self:route_stanza(msg);
- end
+ local msg = create_subject_message(self:get_subject());
+ msg.attr.to = to;
+ self:route_stanza(msg);
end
function room_mt:set_subject(current_nick, subject)
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 = create_subject_message(subject)
- msg.attr.from = current_nick
+ local msg = create_subject_message(current_nick, subject);
self:broadcast_message(msg, false);
return true;
end