plugins.carbons: Update to Carbons v0.8

Sat, 22 Dec 2012 17:53:40 +0100

author
Kim Alvefur <zash@zash.se>
date
Sat, 22 Dec 2012 17:53:40 +0100
changeset 318
598552fc085b
parent 317
38562b0b50f2
child 319
12b0e5cc72bf

plugins.carbons: Update to Carbons v0.8

plugins/carbons.lua file | annotate | diff | comparison | revisions
--- a/plugins/carbons.lua	Mon Dec 17 12:47:25 2012 +0100
+++ b/plugins/carbons.lua	Sat Dec 22 17:53:40 2012 +0100
@@ -1,6 +1,6 @@
 local verse = require "verse";
 
-local xmlns_carbons = "urn:xmpp:carbons:1";
+local xmlns_carbons = "urn:xmpp:carbons:2";
 local xmlns_forward = "urn:xmpp:forward:0";
 local os_time = os.time;
 local parse_datetime = require "util.datetime".parse;
@@ -47,10 +47,10 @@
 	end);
 
 	stream:hook("message", function(stanza)
-		local carbon_dir = stanza:get_child(nil, xmlns_carbons);
-		if stanza.attr.from == my_bare and carbon_dir then
-			carbon_dir = carbon_dir.name;
-			local fwd = stanza:get_child("forwarded", xmlns_forward);
+		local carbon = stanza:get_child(nil, xmlns_carbons);
+		if stanza.attr.from == my_bare and carbon then
+			local carbon_dir = carbon.name;
+			local fwd = carbon:get_child("forwarded", xmlns_forward);
 			local fwd_stanza = fwd and fwd:get_child("message", "jabber:client");
 			local delay = fwd:get_child("delay", "urn:xmpp:delay");
 			local stamp = delay and delay.attr.stamp;

mercurial