mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
Fix some binary variables
This commit is contained in:
parent
71fc696f81
commit
b2eb9bc512
@ -575,6 +575,7 @@ get_special_displayed_groups(GroupsOpts) ->
|
|||||||
%% Given a username and server, and a list of group names with options,
|
%% Given a username and server, and a list of group names with options,
|
||||||
%% for the list of groups of that server that user is member
|
%% for the list of groups of that server that user is member
|
||||||
%% get the list of groups displayed
|
%% get the list of groups displayed
|
||||||
|
%% @spec (LUser::string(), LServer::string(), GroupOpts::[{GroupName::string(), [Opts]]) -> [{GroupName::string(), Opts}]
|
||||||
get_user_displayed_groups(LUser, LServer, GroupsOpts) ->
|
get_user_displayed_groups(LUser, LServer, GroupsOpts) ->
|
||||||
Groups = case catch mnesia:dirty_read(sr_user, {LUser, LServer}) of
|
Groups = case catch mnesia:dirty_read(sr_user, {LUser, LServer}) of
|
||||||
Rs when is_list(Rs) ->
|
Rs when is_list(Rs) ->
|
||||||
@ -694,10 +695,12 @@ push_user_to_members(User, Server, Subscription) ->
|
|||||||
LServer = exmpp_stringprep:nameprep(Server),
|
LServer = exmpp_stringprep:nameprep(Server),
|
||||||
GroupsOpts = groups_with_opts(LServer),
|
GroupsOpts = groups_with_opts(LServer),
|
||||||
SpecialGroups = get_special_displayed_groups(GroupsOpts),
|
SpecialGroups = get_special_displayed_groups(GroupsOpts),
|
||||||
UserGroups = get_user_displayed_groups(LUser, LServer, GroupsOpts),
|
LUserS = binary_to_list(LUser),
|
||||||
|
LServerS = binary_to_list(LServer),
|
||||||
|
UserGroups = get_user_displayed_groups(LUserS, LServerS, GroupsOpts),
|
||||||
lists:foreach(
|
lists:foreach(
|
||||||
fun(Group) ->
|
fun(Group) ->
|
||||||
remove_user_from_group(LServer, {LUser, LServer}, Group),
|
remove_user_from_group(LServerS, {LUserS, LServerS}, Group),
|
||||||
GroupOpts = proplists:get_value(Group, GroupsOpts, []),
|
GroupOpts = proplists:get_value(Group, GroupsOpts, []),
|
||||||
GroupName = proplists:get_value(name, GroupOpts, Group),
|
GroupName = proplists:get_value(name, GroupOpts, Group),
|
||||||
lists:foreach(
|
lists:foreach(
|
||||||
@ -751,7 +754,7 @@ push_item(User, Server, From, Item) ->
|
|||||||
fun(Resource) ->
|
fun(Resource) ->
|
||||||
JID = exmpp_jid:make(User, Server, Resource),
|
JID = exmpp_jid:make(User, Server, Resource),
|
||||||
ejabberd_router:route(JID, JID, Stanza)
|
ejabberd_router:route(JID, JID, Stanza)
|
||||||
end, ejabberd_sm:get_user_resources(User, Server)).
|
end, ejabberd_sm:get_user_resources(list_to_binary(User), list_to_binary(Server))).
|
||||||
|
|
||||||
push_roster_item(User, Server, ContactU, ContactS, GroupName, Subscription) ->
|
push_roster_item(User, Server, ContactU, ContactS, GroupName, Subscription) ->
|
||||||
Item = #roster{usj = {User, Server, {ContactU, ContactS, ""}},
|
Item = #roster{usj = {User, Server, {ContactU, ContactS, ""}},
|
||||||
|
Loading…
Reference in New Issue
Block a user