Software /
code /
prosody
Comparison
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 |
comparison
equal
deleted
inserted
replaced
10214:f864e685e618 | 10215:82abf88db13f |
---|---|
112 end | 112 end |
113 elseif tag.name == "org" then | 113 elseif tag.name == "org" then |
114 vcard_temp:tag("ORG") | 114 vcard_temp:tag("ORG") |
115 :text_tag("ORGNAME", tag:get_child_text("text")) | 115 :text_tag("ORGNAME", tag:get_child_text("text")) |
116 :up(); | 116 :up(); |
117 end | |
118 end | |
119 else | |
120 local ok, _, nick_item = pep_service:get_last_item("http://jabber.org/protocol/nick", stanza.attr.from); | |
121 if ok and nick_item then | |
122 local nickname = nick_item:get_child_text("nick", "http://jabber.org/protocol/nick"); | |
123 if nickname then | |
124 vcard_temp:text_tag("NICKNAME", nickname); | |
117 end | 125 end |
118 end | 126 end |
119 end | 127 end |
120 | 128 |
121 local meta_ok, avatar_meta = pep_service:get_items("urn:xmpp:avatar:metadata", stanza.attr.from); | 129 local meta_ok, avatar_meta = pep_service:get_items("urn:xmpp:avatar:metadata", stanza.attr.from); |