Comparison

plugins/mod_vcard_legacy.lua @ 9271:651e945ad971

mod_vcard_legacy: Handle avatar without vcard4 Since vcards are just avatar containers in many modern clients, aborting in case of no vcard4 data is not optimal. The upgrade mechanism needs further tweaks.
author Kim Alvefur <zash@zash.se>
date Fri, 07 Sep 2018 01:04:53 +0200
parent 9270:b024fae6919e
child 9272:c047be86dd51
comparison
equal deleted inserted replaced
9270:b024fae6919e 9271:651e945ad971
105 vcard_temp:tag("WORK"):up(); 105 vcard_temp:tag("WORK"):up();
106 end 106 end
107 vcard_temp:up(); 107 vcard_temp:up();
108 end 108 end
109 end 109 end
110 else
111 local legacy_vcard = st.deserialize(vcards:get(jid_split(stanza.attr.to) or origin.username));
112 origin.send(st.reply(stanza):add_child(legacy_vcard or vcard_temp));
113 return true;
114 end 110 end
115 111
116 local meta_ok, avatar_meta = pep_service:get_items("urn:xmpp:avatar:metadata", stanza.attr.from); 112 local meta_ok, avatar_meta = pep_service:get_items("urn:xmpp:avatar:metadata", stanza.attr.from);
117 local data_ok, avatar_data = pep_service:get_items("urn:xmpp:avatar:data", stanza.attr.from); 113 local data_ok, avatar_data = pep_service:get_items("urn:xmpp:avatar:data", stanza.attr.from);
118 if meta_ok and data_ok then 114 if meta_ok and data_ok then