mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
Fix presence-based delivery
This commit is contained in:
parent
fa55ac5c8f
commit
80fc34fb0c
@ -3170,17 +3170,15 @@ sub_option_can_deliver(_, _, _) -> true.
|
|||||||
presence_can_deliver(_, false) ->
|
presence_can_deliver(_, false) ->
|
||||||
true;
|
true;
|
||||||
presence_can_deliver({User, Server, Resource}, true) ->
|
presence_can_deliver({User, Server, Resource}, true) ->
|
||||||
case mnesia:dirty_match_object({session, '_', '_', {User, Server}, '_', '_'}) of
|
case ejabberd_sm:get_user_present_resources(User, Server) of
|
||||||
[] ->
|
[] ->
|
||||||
false;
|
false;
|
||||||
Ss ->
|
Ss ->
|
||||||
lists:foldl(fun
|
lists:foldl(fun
|
||||||
(_, true) ->
|
(_, true) ->
|
||||||
true;
|
true;
|
||||||
({session, _, _, _, undefined, _}, _Acc) ->
|
({_, R}, _Acc) ->
|
||||||
false;
|
case Resource of
|
||||||
({session, {_, _, R}, _, _, _Priority, _}, _Acc) ->
|
|
||||||
case Resource of
|
|
||||||
<<>> -> true;
|
<<>> -> true;
|
||||||
R -> true;
|
R -> true;
|
||||||
_ -> false
|
_ -> false
|
||||||
|
Loading…
Reference in New Issue
Block a user