I've created a bug fix for it. I also renamed your method and made sure that message carbons are also sent to non-negative resources, which are not among the highest.
If you want, you can review it:
https://github.com/sco0ter/Openfire/commit/48676c7c20dd11e423741cbf2ecaf0f5d1694 e27
If you have concerns about the functionality, please let me know.