Fixes srg_* commands (fixes #147)
This commit is contained in:
parent
977f043a6a
commit
429f3e2ced
|
@ -473,38 +473,38 @@ commands() ->
|
||||||
" ejabberdctl srg_create group3 localhost "
|
" ejabberdctl srg_create group3 localhost "
|
||||||
"name desc \\\"group1\\\\ngroup2\\\"",
|
"name desc \\\"group1\\\\ngroup2\\\"",
|
||||||
module = ?MODULE, function = srg_create,
|
module = ?MODULE, function = srg_create,
|
||||||
args = [{group, string}, {host, string},
|
args = [{group, binary}, {host, binary},
|
||||||
{name, string}, {description, string}, {display, string}],
|
{name, binary}, {description, binary}, {display, binary}],
|
||||||
result = {res, rescode}},
|
result = {res, rescode}},
|
||||||
#ejabberd_commands{name = srg_delete, tags = [shared_roster_group],
|
#ejabberd_commands{name = srg_delete, tags = [shared_roster_group],
|
||||||
desc = "Delete a Shared Roster Group",
|
desc = "Delete a Shared Roster Group",
|
||||||
module = ?MODULE, function = srg_delete,
|
module = ?MODULE, function = srg_delete,
|
||||||
args = [{group, string}, {host, string}],
|
args = [{group, binary}, {host, binary}],
|
||||||
result = {res, rescode}},
|
result = {res, rescode}},
|
||||||
#ejabberd_commands{name = srg_list, tags = [shared_roster_group],
|
#ejabberd_commands{name = srg_list, tags = [shared_roster_group],
|
||||||
desc = "List the Shared Roster Groups in Host",
|
desc = "List the Shared Roster Groups in Host",
|
||||||
module = ?MODULE, function = srg_list,
|
module = ?MODULE, function = srg_list,
|
||||||
args = [{host, string}],
|
args = [{host, binary}],
|
||||||
result = {groups, {list, {id, string}}}},
|
result = {groups, {list, {id, string}}}},
|
||||||
#ejabberd_commands{name = srg_get_info, tags = [shared_roster_group],
|
#ejabberd_commands{name = srg_get_info, tags = [shared_roster_group],
|
||||||
desc = "Get info of a Shared Roster Group",
|
desc = "Get info of a Shared Roster Group",
|
||||||
module = ?MODULE, function = srg_get_info,
|
module = ?MODULE, function = srg_get_info,
|
||||||
args = [{group, string}, {host, string}],
|
args = [{group, binary}, {host, binary}],
|
||||||
result = {informations, {list, {information, {tuple, [{key, string}, {value, string}]}}}}},
|
result = {informations, {list, {information, {tuple, [{key, string}, {value, string}]}}}}},
|
||||||
#ejabberd_commands{name = srg_get_members, tags = [shared_roster_group],
|
#ejabberd_commands{name = srg_get_members, tags = [shared_roster_group],
|
||||||
desc = "Get members of a Shared Roster Group",
|
desc = "Get members of a Shared Roster Group",
|
||||||
module = ?MODULE, function = srg_get_members,
|
module = ?MODULE, function = srg_get_members,
|
||||||
args = [{group, string}, {host, string}],
|
args = [{group, binary}, {host, binary}],
|
||||||
result = {members, {list, {member, string}}}},
|
result = {members, {list, {member, string}}}},
|
||||||
#ejabberd_commands{name = srg_user_add, tags = [shared_roster_group],
|
#ejabberd_commands{name = srg_user_add, tags = [shared_roster_group],
|
||||||
desc = "Add the JID user@host to the Shared Roster Group",
|
desc = "Add the JID user@host to the Shared Roster Group",
|
||||||
module = ?MODULE, function = srg_user_add,
|
module = ?MODULE, function = srg_user_add,
|
||||||
args = [{user, string}, {host, string}, {group, string}, {grouphost, string}],
|
args = [{user, binary}, {host, binary}, {group, binary}, {grouphost, binary}],
|
||||||
result = {res, rescode}},
|
result = {res, rescode}},
|
||||||
#ejabberd_commands{name = srg_user_del, tags = [shared_roster_group],
|
#ejabberd_commands{name = srg_user_del, tags = [shared_roster_group],
|
||||||
desc = "Delete this JID user@host from the Shared Roster Group",
|
desc = "Delete this JID user@host from the Shared Roster Group",
|
||||||
module = ?MODULE, function = srg_user_del,
|
module = ?MODULE, function = srg_user_del,
|
||||||
args = [{user, string}, {host, string}, {group, string}, {grouphost, string}],
|
args = [{user, binary}, {host, binary}, {group, binary}, {grouphost, binary}],
|
||||||
result = {res, rescode}},
|
result = {res, rescode}},
|
||||||
|
|
||||||
#ejabberd_commands{name = send_message_chat, tags = [stanza],
|
#ejabberd_commands{name = send_message_chat, tags = [stanza],
|
||||||
|
@ -1316,7 +1316,7 @@ private_set2(Username, Host, Xml) ->
|
||||||
srg_create(Group, Host, Name, Description, Display) ->
|
srg_create(Group, Host, Name, Description, Display) ->
|
||||||
DisplayList = case Display of
|
DisplayList = case Display of
|
||||||
[] -> [];
|
[] -> [];
|
||||||
_ -> ejabberd_regexp:split(list_to_binary(Display), <<"\\\\n">>)
|
_ -> ejabberd_regexp:split(Display, <<"\\\\n">>)
|
||||||
end,
|
end,
|
||||||
Opts = [{name, Name},
|
Opts = [{name, Name},
|
||||||
{displayed_groups, DisplayList},
|
{displayed_groups, DisplayList},
|
||||||
|
@ -1338,7 +1338,7 @@ srg_get_info(Group, Host) ->
|
||||||
|
|
||||||
srg_get_members(Group, Host) ->
|
srg_get_members(Group, Host) ->
|
||||||
Members = mod_shared_roster:get_group_explicit_users(Host,Group),
|
Members = mod_shared_roster:get_group_explicit_users(Host,Group),
|
||||||
[jlib:jid_to_string(jlib:make_jid(MUser, MServer, ""))
|
[jlib:jid_to_string(jlib:make_jid(MUser, MServer, <<"">>))
|
||||||
|| {MUser, MServer} <- Members].
|
|| {MUser, MServer} <- Members].
|
||||||
|
|
||||||
srg_user_add(User, Host, Group, GroupHost) ->
|
srg_user_add(User, Host, Group, GroupHost) ->
|
||||||
|
|
Loading…
Reference in New Issue