Software /
code /
prosody
Comparison
plugins/mod_vcard_legacy.lua @ 9251:3f31e10e8256
mod_vcard_legacy: Add translation of email field
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 01 Sep 2018 23:45:58 +0200 |
parent | 9250:9a8006f9e983 |
child | 9252:292d283c7694 |
comparison
equal
deleted
inserted
replaced
9250:9a8006f9e983 | 9251:3f31e10e8256 |
---|---|
44 if typ then | 44 if typ then |
45 local text = tag:get_child_text(typ); | 45 local text = tag:get_child_text(typ); |
46 if text then | 46 if text then |
47 vcard_temp:text_tag(tag.name:upper(), text); | 47 vcard_temp:text_tag(tag.name:upper(), text); |
48 end | 48 end |
49 elseif tag.name == "email" then | |
50 local text = tag:get_child_text("text"); | |
51 if text then | |
52 vcard_temp:tag("EMAIL") | |
53 :text_tag("USERID", text) | |
54 :tag("INTERNET"):up(); | |
55 if tag:find"parameters/type/text#" == "home" then | |
56 vcard_temp:tag("HOME"):up(); | |
57 elseif tag:find"parameters/type/text#" == "work" then | |
58 vcard_temp:tag("WORK"):up(); | |
59 end | |
60 vcard_temp:up(); | |
61 end | |
49 end | 62 end |
50 end | 63 end |
51 end | 64 end |
52 | 65 |
53 origin.send(st.reply(stanza):add_child(vcard_temp)); | 66 origin.send(st.reply(stanza):add_child(vcard_temp)); |