public void broadcastPresenceToResources( JID originatingResource, Presence presence) {
        // RFC 6121 4.4.2 says we always send to the originating resource.
        // Also RFC 6121 4.2.2 for updates.
        presence.setTo(originatingResource);
        routingTable.routePacket(originatingResource, presence);
        if (!SessionManager.isOtherResourcePresenceEnabled()) {
            return;
        }
        // Get list of sessions of the same user
        JID searchJID = new JID(originatingResource.getNode(), originatingResource.getDomain(), null);
        List<JID> addresses = routingTable.getRoutes(searchJID, null);
        for (JID address : addresses) {
            if (!originatingResource.equals(address)) {
                // Send the presence of the session whose presence has changed to
                // this user's other session(s)
                presence.setTo(address);
                routingTable.routePacket(address, presence);
            }
        }
    }
Broadcasts presence updates from the originating user's resource to any of the user's
existing available resources (including the resource from where the update originates).

@param originatingResource the full JID of the session that sent the presence update.
@param presence the presence.
xmppserver/src/main/java/org/jivesoftware/openfire/SessionManager.java