diff options
author | genric <genrich.ivaska@epfl.ch> | 2016-04-05 14:13:28 +0200 |
---|---|---|
committer | genric <genrich.ivaska@epfl.ch> | 2016-04-05 14:13:28 +0200 |
commit | be7f65da053cae8c641ecfa7349fec8e46c750b9 (patch) | |
tree | 4a210b8f35e2c4410ec9e587d64fdf33fbcc4588 /src | |
parent | Merge branch 'add-error-reason' (diff) |
Fix mod_muc_admin:get_room_options
Fix mod_muc_admin:get_room_options to match the ejabberd_commands result spec.
Diffstat (limited to 'src')
-rw-r--r-- | src/mod_muc_admin.erl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mod_muc_admin.erl b/src/mod_muc_admin.erl index 7c6e84c4..037f2600 100644 --- a/src/mod_muc_admin.erl +++ b/src/mod_muc_admin.erl @@ -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). %%---------------------------- |