Mercurial > prosody-modules
comparison mod_oidc_userinfo_vcard4/mod_oidc_userinfo_vcard4.lua @ 5360:f05de5ac219f
mod_oidc_userinfo_vcard4: Unpack <vcard> from PubSub <item>
Forgot about the <item>, so it was previously attempting to extract all
properties from that instead of the inner <vcard>
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 23 Apr 2023 13:37:58 +0200 |
parents | f8ec43db580b |
children | cec1b0b0adef |
comparison
equal
deleted
inserted
replaced
5359:230fc6a0c086 | 5360:f05de5ac219f |
---|---|
11 local pep_service = mod_pep.get_pep_service(event.username); | 11 local pep_service = mod_pep.get_pep_service(event.username); |
12 | 12 |
13 local vcard4 = select(3, pep_service:get_last_item("urn:xmpp:vcard4", true)); | 13 local vcard4 = select(3, pep_service:get_last_item("urn:xmpp:vcard4", true)); |
14 | 14 |
15 local userinfo = event.userinfo; | 15 local userinfo = event.userinfo; |
16 vcard4 = vcard4 and vcard4:get_child("vcard", "urn:ietf:params:xml:ns:vcard-4.0"); | |
16 if vcard4 and event.claims:contains("profile") then | 17 if vcard4 and event.claims:contains("profile") then |
17 userinfo.name = vcard4:find("fn/text#"); | 18 userinfo.name = vcard4:find("fn/text#"); |
18 userinfo.family_name = vcard4:find("n/surname#"); | 19 userinfo.family_name = vcard4:find("n/surname#"); |
19 userinfo.given_name = vcard4:find("n/given#"); | 20 userinfo.given_name = vcard4:find("n/given#"); |
20 userinfo.middle_name = vcard4:find("n/additional#"); | 21 userinfo.middle_name = vcard4:find("n/additional#"); |