aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_vcard_legacy.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-08-21 16:34:46 +0200
committerKim Alvefur <zash@zash.se>2018-08-21 16:34:46 +0200
commitab3ebce08469f6d6421f88072622d5356ffa7087 (patch)
tree9d26dff3a5f0e967d279ef4560cb15c001a1f26d /plugins/mod_vcard_legacy.lua
parent046c7917f2cccdde7dcccb660ad5f36562053ad5 (diff)
downloadprosody-ab3ebce08469f6d6421f88072622d5356ffa7087.tar.gz
prosody-ab3ebce08469f6d6421f88072622d5356ffa7087.zip
mod_vcard_legacy: Add support for address field
Diffstat (limited to 'plugins/mod_vcard_legacy.lua')
-rw-r--r--plugins/mod_vcard_legacy.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/plugins/mod_vcard_legacy.lua b/plugins/mod_vcard_legacy.lua
index 51d722b9..c1704501 100644
--- a/plugins/mod_vcard_legacy.lua
+++ b/plugins/mod_vcard_legacy.lua
@@ -73,6 +73,21 @@ module:hook("iq-get/bare/vcard-temp:vCard", function (event)
end
vcard_temp:up();
end
+ elseif tag.name == "adr" then
+ vcard_temp:tag("ADR")
+ :text_tag("POBOX", tag:get_child_text("pobox"))
+ :text_tag("EXTADD", tag:get_child_text("ext"))
+ :text_tag("STREET", tag:get_child_text("street"))
+ :text_tag("LOCALITY", tag:get_child_text("locality"))
+ :text_tag("REGION", tag:get_child_text("region"))
+ :text_tag("PCODE", tag:get_child_text("code"))
+ :text_tag("CTRY", tag:get_child_text("country"));
+ if tag:find"parameters/type/text#" == "home" then
+ vcard_temp:tag("HOME"):up();
+ elseif tag:find"parameters/type/text#" == "work" then
+ vcard_temp:tag("WORK"):up();
+ end
+ vcard_temp:up();
end
end
end