Skip to content

Commit

Permalink
Merge pull request #1052 from genric/patch-2
Browse files Browse the repository at this point in the history
Fix mod_muc_admin:get_room_options
  • Loading branch information
badlop committed Apr 6, 2016
2 parents 1b9b5f8 + be7f65d commit dd654fa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/mod_muc_admin.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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).

%%----------------------------
Expand Down

0 comments on commit dd654fa

Please sign in to comment.