diff --git a/mod_default_rooms/README.md b/mod_default_rooms/README.md index e42fd36..13b8b19 100644 --- a/mod_default_rooms/README.md +++ b/mod_default_rooms/README.md @@ -20,11 +20,10 @@ following: ```yaml modules: - # [...] mod_default_rooms: rooms: - - "foo@conference.example.net" - - "bar@conference.example.org" + - foo@conference.example.net + - bar@conference.example.org ``` The configurable `mod_default_rooms` options are: diff --git a/mod_default_rooms/src/mod_default_rooms.erl b/mod_default_rooms/src/mod_default_rooms.erl index 5b4fde2..01ee187 100644 --- a/mod_default_rooms/src/mod_default_rooms.erl +++ b/mod_default_rooms/src/mod_default_rooms.erl @@ -52,11 +52,11 @@ stop(Host) -> reload(_Host, _NewOpts, _OldOpts) -> ok. --spec mod_opt_type(atom()) -> fun((term()) -> term()). +-spec mod_opt_type(atom()) -> econf:validator(). mod_opt_type(auto_join) -> - fun (B) when is_boolean(B) -> B end; + econf:bool(); mod_opt_type(rooms) -> - fun (Rs) -> [jid:decode(iolist_to_binary(R)) || R <- Rs] end. + econf:list(econf:jid(), [unique]). -spec mod_options(binary()) -> [{atom(), any()}]. mod_options(_Host) ->