Incorrect PEP node's recipients 

I didn't get expected result when I publish a message to user's PEP node.
Supposed that the user A had a subscription to B's presence, but B didn't have a subscription to A's presence.
When B publish an item to his PEP node, A should get a notification, but unfortunately, A got nothing.
And if A publish an Item to his PEP node, B got a notification instead.

Here is what I got when I look through the code:
Ejabberd use mod_caps:c2s_broadcast_recipients to count broadcast Recipients, but I thought it didn't work right.
Because C2SState#state.cap_resources is the cache which store users contact's status, so the data in it are my subscriptions, not subscriptions to me.