Update econf:vcard() to generate correct vcard_temp record

This commit is contained in:
Paweł Chmielowski 2021-05-12 21:46:36 +02:00
parent 0f51a03d08
commit 3b716d2cb0
1 changed files with 36 additions and 31 deletions

View File

@ -553,37 +553,42 @@ hosts() ->
-spec vcard_temp() -> yconf:validator(). -spec vcard_temp() -> yconf:validator().
vcard_temp() -> vcard_temp() ->
vcard_validator( and_then(
vcard_temp, undefined, vcard_validator(
[{version, undefined, binary()}, vcard_temp, undefined,
{fn, undefined, binary()}, [{version, undefined, binary()},
{n, undefined, vcard_name()}, {fn, undefined, binary()},
{nickname, undefined, binary()}, {n, undefined, vcard_name()},
{photo, undefined, vcard_photo()}, {nickname, undefined, binary()},
{bday, undefined, binary()}, {photo, undefined, vcard_photo()},
{adr, [], list(vcard_adr())}, {bday, undefined, binary()},
{label, [], list(vcard_label())}, {adr, [], list(vcard_adr())},
{tel, [], list(vcard_tel())}, {label, [], list(vcard_label())},
{email, [], list(vcard_email())}, {tel, [], list(vcard_tel())},
{jabberid, undefined, binary()}, {email, [], list(vcard_email())},
{mailer, undefined, binary()}, {jabberid, undefined, binary()},
{tz, undefined, binary()}, {mailer, undefined, binary()},
{geo, undefined, vcard_geo()}, {tz, undefined, binary()},
{title, undefined, binary()}, {geo, undefined, vcard_geo()},
{role, undefined, binary()}, {title, undefined, binary()},
{logo, undefined, vcard_logo()}, {role, undefined, binary()},
{org, undefined, vcard_org()}, {logo, undefined, vcard_logo()},
{categories, [], list(binary())}, {org, undefined, vcard_org()},
{note, undefined, binary()}, {categories, [], list(binary())},
{prodid, undefined, binary()}, {note, undefined, binary()},
{rev, undefined, binary()}, {prodid, undefined, binary()},
{sort_string, undefined, binary()}, {rev, undefined, binary()},
{sound, undefined, vcard_sound()}, {sort_string, undefined, binary()},
{uid, undefined, binary()}, {sound, undefined, vcard_sound()},
{url, undefined, binary()}, {uid, undefined, binary()},
{class, undefined, enum([confidential, private, public])}, {url, undefined, binary()},
{key, undefined, vcard_key()}, {class, undefined, enum([confidential, private, public])},
{desc, undefined, binary()}]). {key, undefined, vcard_key()},
{desc, undefined, binary()}]),
fun(Tuple) ->
list_to_tuple(tuple_to_list(Tuple) ++ [[]])
end).
-spec vcard_name() -> yconf:validator(). -spec vcard_name() -> yconf:validator().
vcard_name() -> vcard_name() ->