diff options
author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2018-01-08 11:29:17 +0300 |
---|---|---|
committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2018-01-08 11:29:17 +0300 |
commit | 9d943614668b0e88e4b28958cef165bdee165e9a (patch) | |
tree | a2a741b593b418ce850637f2e5a57cec4e578721 /src/mod_muc.erl | |
parent | Update copyright dates in header files (diff) |
Process 'name' option for all route-registering modules
The option allows to set arbitrary text for disco#info identity name.
Previously, option 'name' was supported by mod_proxy65 and mod_http_upload
only. Now, all the following modules support this option as well:
- mod_disco
- mod_irc
- mod_muc
- mod_multicast
- mod_pubsub
- mod_vcard
Example:
```
modules:
...
mod_disco:
name: "Cool XMPP Server"
...
```
Diffstat (limited to 'src/mod_muc.erl')
-rw-r--r-- | src/mod_muc.erl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mod_muc.erl b/src/mod_muc.erl index 7ec18ca9c..d3ad90cb4 100644 --- a/src/mod_muc.erl +++ b/src/mod_muc.erl @@ -75,6 +75,7 @@ -include("logger.hrl"). -include("xmpp.hrl"). -include("mod_muc.hrl"). +-include("translate.hrl"). -record(state, {hosts = [] :: [binary()], @@ -526,9 +527,10 @@ process_disco_info(#iq{type = get, to = To, lang = Lang, Features = [?NS_DISCO_INFO, ?NS_DISCO_ITEMS, ?NS_REGISTER, ?NS_MUC, ?NS_VCARD, ?NS_MUCSUB, ?NS_MUC_UNIQUE | RSMFeatures ++ MAMFeatures], + Name = gen_mod:get_module_opt(ServerHost, ?MODULE, name, ?T("Chatrooms")), Identity = #identity{category = <<"conference">>, type = <<"text">>, - name = translate:translate(Lang, <<"Chatrooms">>)}, + name = translate:translate(Lang, Name)}, xmpp:make_iq_result( IQ, #disco_info{features = Features, identities = [Identity], @@ -880,6 +882,7 @@ mod_opt_type(ram_db_type) -> fun(T) -> ejabberd_config:v_db(?MODULE, T) end; mod_opt_type(history_size) -> fun (I) when is_integer(I), I >= 0 -> I end; mod_opt_type(host) -> fun iolist_to_binary/1; +mod_opt_type(name) -> fun iolist_to_binary/1; mod_opt_type(hosts) -> fun (L) -> lists:map(fun iolist_to_binary/1, L) end; mod_opt_type(max_room_desc) -> @@ -975,7 +978,7 @@ mod_opt_type({default_room_options, presence_broadcast}) -> end; mod_opt_type(_) -> [access, access_admin, access_create, access_persistent, - db_type, ram_db_type, history_size, host, hosts, + db_type, ram_db_type, history_size, host, hosts, name, max_room_desc, max_room_id, max_room_name, max_rooms_discoitems, max_user_conferences, max_users, max_users_admin_threshold, max_users_presence, |