25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

Improve srg_get_info result format (processone/ejabberd-contrib#92)

This commit is contained in:
Badlop 2015-04-03 12:16:11 +02:00
parent 088c5c4672
commit 94761ff31e

View File

@ -1302,7 +1302,7 @@ private_set2(Username, Host, Xml) ->
srg_create(Group, Host, Name, Description, Display) ->
DisplayList = case Display of
[] -> [];
<<>> -> [];
_ -> ejabberd_regexp:split(Display, <<"\\\\n">>)
end,
Opts = [{name, Name},
@ -1323,7 +1323,12 @@ srg_get_info(Group, Host) ->
Os when is_list(Os) -> Os;
error -> []
end,
[{jlib:atom_to_binary(Title), Value} || {Title, Value} <- Opts].
[{jlib:atom_to_binary(Title),
io_lib:format("~p", [btl(Value)])} || {Title, Value} <- Opts].
btl([]) -> [];
btl([B|L]) -> [btl(B)|btl(L)];
btl(B) -> binary_to_list(B).
srg_get_members(Group, Host) ->
Members = mod_shared_roster:get_group_explicit_users(Host,Group),