# HG changeset patch # User Kim Alvefur # Date 1566505384 -7200 # Node ID 82abf88db13f94fecdb9f672ceaa480485b700b4 # Parent f864e685e6183bd5699ec185f2616535d237f128 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. diff -r f864e685e618 -r 82abf88db13f plugins/mod_vcard_legacy.lua --- 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);