Software /
code /
prosody
Diff
plugins/mod_vcard_legacy.lua @ 10215:82abf88db13f
mod_vcard_legacy: Use PEP nickname if vcard4 data is unavailable
Last remaining nice feature from mod_profile.
Allows setting eg nickname and avatar as completely public while
restricting private details in vcard4 to only contacts.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 22 Aug 2019 22:23:04 +0200 |
parent | 10118:199dae5b6f11 |
child | 10270:c2b9ff42db03 |
line wrap: on
line diff
--- a/plugins/mod_vcard_legacy.lua Wed Aug 21 23:18:08 2019 +0200 +++ b/plugins/mod_vcard_legacy.lua Thu Aug 22 22:23:04 2019 +0200 @@ -116,6 +116,14 @@ :up(); end end + else + local ok, _, nick_item = pep_service:get_last_item("http://jabber.org/protocol/nick", stanza.attr.from); + if ok and nick_item then + local nickname = nick_item:get_child_text("nick", "http://jabber.org/protocol/nick"); + if nickname then + vcard_temp:text_tag("NICKNAME", nickname); + end + end end local meta_ok, avatar_meta = pep_service:get_items("urn:xmpp:avatar:metadata", stanza.attr.from);