Mercurial > prosody-modules
comparison mod_vjud/vcard.lib.lua @ 788:aeb0999f12fa
mod_vjud/vcard.lib: Iterate on tags instead of items (thanks mva)
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 09 Aug 2012 20:16:09 +0200 |
| parents | 81de1e446bfe |
| children | d15a9eaa63ea |
comparison
equal
deleted
inserted
replaced
| 787:cec49ee88c23 | 788:aeb0999f12fa |
|---|---|
| 236 if prop_def.value then --single item | 236 if prop_def.value then --single item |
| 237 prop[1] = item:get_child_text(prop_def.value) or ""; | 237 prop[1] = item:get_child_text(prop_def.value) or ""; |
| 238 elseif prop_def.values then --array | 238 elseif prop_def.values then --array |
| 239 local value_names = prop_def.values; | 239 local value_names = prop_def.values; |
| 240 if value_names.behaviour == "repeat-last" then | 240 if value_names.behaviour == "repeat-last" then |
| 241 for i=1,#item do | 241 for i=1,#item.tags do |
| 242 t_insert(prop, item[i]:get_text() or ""); | 242 t_insert(prop, item.tags[i]:get_text() or ""); |
| 243 end | 243 end |
| 244 else | 244 else |
| 245 for i=1,#value_names do | 245 for i=1,#value_names do |
| 246 t_insert(prop, item:get_child_text(value_names[i]) or ""); | 246 t_insert(prop, item:get_child_text(value_names[i]) or ""); |
| 247 end | 247 end |
