diff options
author | Evgeny Khramtsov <ekhramtsov@process-one.net> | 2019-08-02 13:55:48 +0300 |
---|---|---|
committer | Evgeny Khramtsov <ekhramtsov@process-one.net> | 2019-08-02 13:59:42 +0300 |
commit | 5a976719fb821801fd162cde4516085416ef71e6 (patch) | |
tree | 9811d2e4b7da2e4396259a2e1ce7e1c839c5194a /src/mod_http_upload_opt.erl | |
parent | Bump pkix version (diff) |
Introduce 'vcard' option for the modules supporting vCards
The mapping between vCard's XML elements and YAML elements
of 'vcard' option is straightforward. For example, if you
want mod_muc to return the following vCard:
```
<vCard xmlns='vcard-temp'>
<FN>Conferences</FN>
<ADR>
<WORK/>
<STREET>Elm Street</STREET>
</ADR>
</vCard>
```
you need to set the configuration as:
```
modules:
...
mod_muc:
vcard:
fn: Conferences
adr:
-
work: true
street: Elm Street
...
```
Diffstat (limited to 'src/mod_http_upload_opt.erl')
-rw-r--r-- | src/mod_http_upload_opt.erl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mod_http_upload_opt.erl b/src/mod_http_upload_opt.erl index 9c35b3c02..8590a38a1 100644 --- a/src/mod_http_upload_opt.erl +++ b/src/mod_http_upload_opt.erl @@ -20,6 +20,7 @@ -export([secret_length/1]). -export([service_url/1]). -export([thumbnail/1]). +-export([vcard/1]). -spec access(gen_mod:opts() | global | binary()) -> 'local' | acl:acl(). access(Opts) when is_map(Opts) -> @@ -123,3 +124,9 @@ thumbnail(Opts) when is_map(Opts) -> thumbnail(Host) -> gen_mod:get_module_opt(Host, mod_http_upload, thumbnail). +-spec vcard(gen_mod:opts() | global | binary()) -> 'undefined' | tuple(). +vcard(Opts) when is_map(Opts) -> + gen_mod:get_opt(vcard, Opts); +vcard(Host) -> + gen_mod:get_module_opt(Host, mod_http_upload, vcard). + |