@@ -584,30 +584,37 @@ do_check_packet(#jid{luser = LUser, lserver = LServer}, List, Packet, Dir) ->
584
584
roster_get_jid_info , LServer ,
585
585
{none , none , []},
586
586
[LUser , LServer , LJID ]),
587
- check_packet_aux (List , PType2 , LJID , Subscription , Groups )
587
+ {Action , _Order } = check_packet_aux (allow , last , List , PType2 , LJID ,
588
+ Subscription , Groups ),
589
+ Action
588
590
end .
589
591
590
- -spec check_packet_aux ([listitem ()],
592
+ -spec check_packet_aux (allow | deny , last | integer (), [listitem ()],
591
593
message | iq | presence_in | presence_out | other ,
592
594
ljid (), none | both | from | to , [binary ()]) ->
593
595
allow | deny .
594
596
% % Ptype = mesage | iq | presence_in | presence_out | other
595
- check_packet_aux ([], _PType , _JID , _Subscription ,
597
+ check_packet_aux (Lastaction , Lastorder , [], _PType , _JID , _Subscription ,
596
598
_Groups ) ->
597
- allow ;
598
- check_packet_aux ([Item | List ], PType , JID ,
599
+ { Lastaction , Lastorder } ;
600
+ check_packet_aux (Lastaction , Lastorder , [Item | List ], PType , JID ,
599
601
Subscription , Groups ) ->
600
- # listitem {type = Type , value = Value , action = Action } =
602
+ # listitem {type = Type , value = Value , action = Action , order = Order } =
601
603
Item ,
602
- case is_ptype_match ( Item , PType ) of
603
- true ->
604
- case is_type_match ( Type , Value , JID , Subscription , Groups ) of
605
- true -> Action ;
606
- false ->
607
- check_packet_aux ( List , PType , JID , Subscription , Groups )
604
+ Usethis = case Lastorder of
605
+ last -> true ;
606
+ _ when Lastorder > Order ->
607
+ case is_ptype_match ( Item , PType ) of
608
+ true -> is_type_match ( Type , Value , JID , Subscription , Groups );
609
+ false -> false
608
610
end ;
609
- false ->
610
- check_packet_aux (List , PType , JID , Subscription , Groups )
611
+ _ -> false
612
+ end ,
613
+ case Usethis of
614
+ true -> check_packet_aux (Action , Order ,
615
+ List , PType , JID , Subscription , Groups );
616
+ false -> check_packet_aux (Lastaction , Lastorder ,
617
+ List , PType , JID , Subscription , Groups )
611
618
end .
612
619
613
620
-spec is_ptype_match (listitem (),
0 commit comments