From 6e150caa5eb77f40cb96b2c79e2577836a7583be Mon Sep 17 00:00:00 2001 From: Badlop Date: Fri, 3 Apr 2015 12:17:16 +0200 Subject: [PATCH] Improve srg_get_info result format (#92) --- mod_admin_extra/src/mod_admin_extra.erl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mod_admin_extra/src/mod_admin_extra.erl b/mod_admin_extra/src/mod_admin_extra.erl index 9722029..043b6f3 100644 --- a/mod_admin_extra/src/mod_admin_extra.erl +++ b/mod_admin_extra/src/mod_admin_extra.erl @@ -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),