I noticed, delivers messages to resources with negative priority if this resource is becoming available as first resource. I think it is major bug.
When negative priority resorce is already available, the message is stored as the resource is offline. And that’s OK.
But when no resources is available, and negative resource connects, messages stored in offline are delivered to it. Why? Those messages should remain on server and be delivered to first available resource with non-negative priority.
Also I noticed that this bug affects jabberd2.