private void broadcastUnavailableForDirectedPresences(Presence update) {
        JID from = update.getFrom();
        if (from == null) {
            return;
        }
        if (localServer.isLocal(from)) {
            // Remove the registry of directed presences of this user
            Collection<DirectedPresence> directedPresences;
            
            Lock lock = directedPresencesCache.getLock(from.toString());
            lock.lock();
            try {
                directedPresences = directedPresencesCache.remove(from.toString());
            } finally {
                lock.unlock();
            }
            
            if (directedPresences != null) {
                // Iterate over all the entities that the user sent a directed presence
                for (DirectedPresence directedPresence : directedPresences) {
                    for (String receiver : directedPresence.getReceivers()) {
                        Presence presence = update.createCopy();
                        presence.setTo(receiver);
                        localServer.getPresenceRouter().route(presence);
                    }
                }
                localDirectedPresences.remove(from.toString());
            }
        }
    }
Sends an unavailable presence to the entities that sent a directed (available) presence
to other entities.

@param update the unavailable presence sent by the user.
xmppserver/src/main/java/org/jivesoftware/openfire/handler/PresenceUpdateHandler.java