diff mod_vjud/vcard.lib.lua @ 734:81de1e446bfe

mod_vjud: Don't break on undefined properties.
author Kim Alvefur <zash@zash.se>
date Sun, 01 Jul 2012 13:51:26 +0200
parents 317e142fe6f1
children aeb0999f12fa
line wrap: on
line diff
--- a/mod_vjud/vcard.lib.lua	Sun Jul 01 13:15:40 2012 +0200
+++ b/mod_vjud/vcard.lib.lua	Sun Jul 01 13:51:26 2012 +0200
@@ -227,7 +227,6 @@
 local function from_xep54_item(item)
 	local prop_name = item.name;
 	local prop_def = vCard_dtd[prop_name];
-	if not prop_def then return nil end
 
 	local prop = { name = prop_name };
 
@@ -299,7 +298,7 @@
 	local tags = vCard.tags;
 	local t = {};
 	for i=1,#tags do
-		t[i] = from_xep54_item(tags[i]);
+		t_insert(t, from_xep54_item(tags[i]));
 	end
 	return t
 end
@@ -312,9 +311,7 @@
 		local t = {};
 		local vCards = vCard.tags;
 		for i=1,#vCards do
-			local ti = from_xep54_vCard(vCards[i]);
-			t[i] = ti;
-			--t[ti.name] = ti;
+			t[i] = from_xep54_vCard(vCards[i]);
 		end
 		return t
 	elseif vCard.name == "vCard" then -- A single vCard