mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
Merge pull request #1052 from genric/patch-2
Fix mod_muc_admin:get_room_options
This commit is contained in:
commit
dd654fa794
@ -824,8 +824,12 @@ get_room_options(Pid) ->
|
||||
get_options(Config).
|
||||
|
||||
get_options(Config) ->
|
||||
Fields = record_info(fields, config),
|
||||
[config | Values] = tuple_to_list(Config),
|
||||
Fields = [jlib:atom_to_binary(Field) || Field <- record_info(fields, config)],
|
||||
[config | ValuesRaw] = tuple_to_list(Config),
|
||||
Values = lists:map(fun(V) when is_atom(V) -> jlib:atom_to_binary(V);
|
||||
(V) when is_integer(V) -> jlib:integer_to_binary(V);
|
||||
(V) when is_tuple(V); is_list(V) -> list_to_binary(hd(io_lib:format("~w", [V])));
|
||||
(V) -> V end, ValuesRaw),
|
||||
lists:zip(Fields, Values).
|
||||
|
||||
%%----------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user