From be7f65da053cae8c641ecfa7349fec8e46c750b9 Mon Sep 17 00:00:00 2001 From: genric Date: Tue, 5 Apr 2016 14:13:28 +0200 Subject: [PATCH] Fix mod_muc_admin:get_room_options Fix mod_muc_admin:get_room_options to match the ejabberd_commands result spec. --- src/mod_muc_admin.erl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mod_muc_admin.erl b/src/mod_muc_admin.erl index 7c6e84c45..037f26006 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). %%----------------------------