Comparison

plugins/mod_vcard_legacy.lua @ 9254:2ffbcad8ec50

mod_vcard_legacy: Add support for address field
author Kim Alvefur <zash@zash.se>
date Tue, 21 Aug 2018 16:34:46 +0200
parent 9253:dbe3ae6f9746
child 9255:2aa40526df7b
comparison
equal deleted inserted replaced
9253:dbe3ae6f9746 9254:2ffbcad8ec50
71 elseif tag:find"parameters/type/text#" == "work" then 71 elseif tag:find"parameters/type/text#" == "work" then
72 vcard_temp:tag("WORK"):up(); 72 vcard_temp:tag("WORK"):up();
73 end 73 end
74 vcard_temp:up(); 74 vcard_temp:up();
75 end 75 end
76 elseif tag.name == "adr" then
77 vcard_temp:tag("ADR")
78 :text_tag("POBOX", tag:get_child_text("pobox"))
79 :text_tag("EXTADD", tag:get_child_text("ext"))
80 :text_tag("STREET", tag:get_child_text("street"))
81 :text_tag("LOCALITY", tag:get_child_text("locality"))
82 :text_tag("REGION", tag:get_child_text("region"))
83 :text_tag("PCODE", tag:get_child_text("code"))
84 :text_tag("CTRY", tag:get_child_text("country"));
85 if tag:find"parameters/type/text#" == "home" then
86 vcard_temp:tag("HOME"):up();
87 elseif tag:find"parameters/type/text#" == "work" then
88 vcard_temp:tag("WORK"):up();
89 end
90 vcard_temp:up();
76 end 91 end
77 end 92 end
78 end 93 end
79 94
80 local meta_ok, avatar_meta = pep_service:get_items("urn:xmpp:avatar:metadata", stanza.attr.from); 95 local meta_ok, avatar_meta = pep_service:get_items("urn:xmpp:avatar:metadata", stanza.attr.from);