]> granicus.if.org Git - ejabberd/commitdiff
is_user_in_group/3 must check if user belongs to given Group from Host specified...
authorJuan Pablo Carlino <jpcarlino@process-one.net>
Fri, 1 Jul 2011 15:11:09 +0000 (12:11 -0300)
committerPablo Polvorin <pablo.polvorin@process-one.net>
Fri, 1 Jul 2011 15:51:52 +0000 (12:51 -0300)
* is_user_in_group/3 was checking if given user (passed on first parameter as
a bare jid) belonged to group of the server derived from this jid.

src/mod_shared_roster.erl

index 8faf3528d7be35727afa21f07855f640bf36c37a..286cac972040073cc8b08b61a64795a26ee8d554 100644 (file)
@@ -602,10 +602,10 @@ get_user_displayed_groups(US) ->
            end, get_user_groups(US))),
     [Group || Group <- DisplayedGroups1, is_group_enabled(Host, Group)].
 
-is_user_in_group({_U, S} = US, Group, Host) ->
+is_user_in_group(US, Group, Host) ->
     case catch mnesia:dirty_match_object(
                 #sr_user{us=US, group_host={Group, Host}}) of
-        [] -> lists:member(US, get_group_users(S, Group));
+        [] -> lists:member(US, get_group_users(Host, Group));
        _  -> true
     end.