25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-02 16:37:52 +01:00
xmpp.chapril.org-ejabberd/src/mod_pubsub_opt.erl
Evgeny Khramtsov 5a976719fb 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
  ...
```
2019-08-02 13:59:42 +03:00

112 lines
4.0 KiB
Erlang

%% Generated automatically
%% DO NOT EDIT: run `make options` instead
-module(mod_pubsub_opt).
-export([access_createnode/1]).
-export([db_type/1]).
-export([default_node_config/1]).
-export([force_node_config/1]).
-export([host/1]).
-export([hosts/1]).
-export([ignore_pep_from_offline/1]).
-export([last_item_cache/1]).
-export([max_items_node/1]).
-export([max_subscriptions_node/1]).
-export([name/1]).
-export([nodetree/1]).
-export([pep_mapping/1]).
-export([plugins/1]).
-export([vcard/1]).
-spec access_createnode(gen_mod:opts() | global | binary()) -> 'all' | acl:acl().
access_createnode(Opts) when is_map(Opts) ->
gen_mod:get_opt(access_createnode, Opts);
access_createnode(Host) ->
gen_mod:get_module_opt(Host, mod_pubsub, access_createnode).
-spec db_type(gen_mod:opts() | global | binary()) -> atom().
db_type(Opts) when is_map(Opts) ->
gen_mod:get_opt(db_type, Opts);
db_type(Host) ->
gen_mod:get_module_opt(Host, mod_pubsub, db_type).
-spec default_node_config(gen_mod:opts() | global | binary()) -> [{atom(),atom() | integer()}].
default_node_config(Opts) when is_map(Opts) ->
gen_mod:get_opt(default_node_config, Opts);
default_node_config(Host) ->
gen_mod:get_module_opt(Host, mod_pubsub, default_node_config).
-spec force_node_config(gen_mod:opts() | global | binary()) -> [{re:mp(),[{atom(),atom() | integer()}]}].
force_node_config(Opts) when is_map(Opts) ->
gen_mod:get_opt(force_node_config, Opts);
force_node_config(Host) ->
gen_mod:get_module_opt(Host, mod_pubsub, force_node_config).
-spec host(gen_mod:opts() | global | binary()) -> binary().
host(Opts) when is_map(Opts) ->
gen_mod:get_opt(host, Opts);
host(Host) ->
gen_mod:get_module_opt(Host, mod_pubsub, host).
-spec hosts(gen_mod:opts() | global | binary()) -> [binary()].
hosts(Opts) when is_map(Opts) ->
gen_mod:get_opt(hosts, Opts);
hosts(Host) ->
gen_mod:get_module_opt(Host, mod_pubsub, hosts).
-spec ignore_pep_from_offline(gen_mod:opts() | global | binary()) -> boolean().
ignore_pep_from_offline(Opts) when is_map(Opts) ->
gen_mod:get_opt(ignore_pep_from_offline, Opts);
ignore_pep_from_offline(Host) ->
gen_mod:get_module_opt(Host, mod_pubsub, ignore_pep_from_offline).
-spec last_item_cache(gen_mod:opts() | global | binary()) -> boolean().
last_item_cache(Opts) when is_map(Opts) ->
gen_mod:get_opt(last_item_cache, Opts);
last_item_cache(Host) ->
gen_mod:get_module_opt(Host, mod_pubsub, last_item_cache).
-spec max_items_node(gen_mod:opts() | global | binary()) -> non_neg_integer().
max_items_node(Opts) when is_map(Opts) ->
gen_mod:get_opt(max_items_node, Opts);
max_items_node(Host) ->
gen_mod:get_module_opt(Host, mod_pubsub, max_items_node).
-spec max_subscriptions_node(gen_mod:opts() | global | binary()) -> 'undefined' | non_neg_integer().
max_subscriptions_node(Opts) when is_map(Opts) ->
gen_mod:get_opt(max_subscriptions_node, Opts);
max_subscriptions_node(Host) ->
gen_mod:get_module_opt(Host, mod_pubsub, max_subscriptions_node).
-spec name(gen_mod:opts() | global | binary()) -> binary().
name(Opts) when is_map(Opts) ->
gen_mod:get_opt(name, Opts);
name(Host) ->
gen_mod:get_module_opt(Host, mod_pubsub, name).
-spec nodetree(gen_mod:opts() | global | binary()) -> binary().
nodetree(Opts) when is_map(Opts) ->
gen_mod:get_opt(nodetree, Opts);
nodetree(Host) ->
gen_mod:get_module_opt(Host, mod_pubsub, nodetree).
-spec pep_mapping(gen_mod:opts() | global | binary()) -> [{binary(),binary()}].
pep_mapping(Opts) when is_map(Opts) ->
gen_mod:get_opt(pep_mapping, Opts);
pep_mapping(Host) ->
gen_mod:get_module_opt(Host, mod_pubsub, pep_mapping).
-spec plugins(gen_mod:opts() | global | binary()) -> [binary()].
plugins(Opts) when is_map(Opts) ->
gen_mod:get_opt(plugins, Opts);
plugins(Host) ->
gen_mod:get_module_opt(Host, mod_pubsub, plugins).
-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_pubsub, vcard).