plugins.groupchat: Use stanza:get_child_text()

Tue, 08 Nov 2011 10:10:50 +0100

author
Kim Alvefur <zash@zash.se>
date
Tue, 08 Nov 2011 10:10:50 +0100
changeset 231
9712693ae40a
parent 230
44a6da432e7e
child 232
5b49de3aa0f3

plugins.groupchat: Use stanza:get_child_text()

plugins/groupchat.lua file | annotate | diff | comparison | revisions
--- a/plugins/groupchat.lua	Sun Nov 06 21:09:07 2011 +0100
+++ b/plugins/groupchat.lua	Tue Nov 08 10:10:50 2011 +0100
@@ -20,14 +20,14 @@
 		if room and room.opts.source and stanza.attr.to ~= room.opts.source then return end
 		if room then
 			local nick = select(3, jid.split(stanza.attr.from));
-			local body = stanza:get_child("body");
+			local body = stanza:get_child_text("body");
 			local delay = stanza:get_child("delay", xmlns_delay);
 			local event = {
 				room_jid = room_jid;
 				room = room;
 				sender = room.occupants[nick];
 				nick = nick;
-				body = (body and body:get_text()) or nil;
+				body = body;
 				stanza = stanza;
 				delay = (delay and delay.attr.stamp);
 			};

mercurial