Comparison

plugins/mod_vcard_legacy.lua @ 9286:992e986589b8

mod_vcard_legacy: Add some notes
author Kim Alvefur <zash@zash.se>
date Sun, 09 Sep 2018 17:47:47 +0200
parent 9285:78673e81243f
child 9518:a62fa766d8f3
comparison
equal deleted inserted replaced
9285:78673e81243f 9286:992e986589b8
203 elseif tag.name == "DESC" then 203 elseif tag.name == "DESC" then
204 local text = tag:get_text(); 204 local text = tag:get_text();
205 if text then 205 if text then
206 vcard4:tag("note"):text_tag("text", text):up(); 206 vcard4:tag("note"):text_tag("text", text):up();
207 end 207 end
208 -- <note> gets mapped into <NOTE> in the other direction
208 elseif tag.name == "ADR" then 209 elseif tag.name == "ADR" then
209 vcard4:tag("adr") 210 vcard4:tag("adr")
210 :text_tag("pobox", tag:get_child_text("POBOX")) 211 :text_tag("pobox", tag:get_child_text("POBOX"))
211 :text_tag("ext", tag:get_child_text("EXTADD")) 212 :text_tag("ext", tag:get_child_text("EXTADD"))
212 :text_tag("street", tag:get_child_text("STREET")) 213 :text_tag("street", tag:get_child_text("STREET"))
222 end 223 end
223 vcard4:up():up():up(); 224 vcard4:up():up():up();
224 elseif tag.name == "PHOTO" then 225 elseif tag.name == "PHOTO" then
225 local avatar_type = tag:get_child_text("TYPE"); 226 local avatar_type = tag:get_child_text("TYPE");
226 local avatar_payload = tag:get_child_text("BINVAL"); 227 local avatar_payload = tag:get_child_text("BINVAL");
228 -- Can EXTVAL be translated? No way to know the sha1 of the data?
227 229
228 if avatar_payload then 230 if avatar_payload then
229 local avatar_raw = base64_decode(avatar_payload); 231 local avatar_raw = base64_decode(avatar_payload);
230 local avatar_hash = sha1(avatar_raw, true); 232 local avatar_hash = sha1(avatar_raw, true);
231 233