@Override
    public void invoke(final ChatSocket socket) throws InvalidCommandException {
        // The user with address zero is reserved
        if (dest.equals(new LongInteger())) {
            throw new InvalidCommandException("Cannot send to user with address zero");
        }
        // Bump the seq number
        sentMessageId = socket.getNextSeq();

        // Assure the local instance has a public key for the destination user
        if (socket.getSecurityManager().userHasPublicKey(dest)) {
            try {
                message = socket.getSecurityManager().encrypt(dest, message);
            } catch (Exception e1) {
                throw new InvalidCommandException("Unable to encrypt message.");
            }
        } else {
            throw new InvalidCommandException("Unable to send to " + dest + ".  No known public key.");
        }

        synchronized (socket) {
            try {
                // Create the message
                final ChatMessage msg = new ChatMessage(socket.getNextMessageId(), dest, message);
                if (dest.equals(socket.getUUID())) {
                    // If the user is sending to themself, don't involve the
                    // network
                    socket.pushToClient(socket.wrapPayload(msg));
                } else {
                    // Send the message
                    socket.sendPacket(socket.wrapPayload(msg));

                    // If the message is persistent, we must wait for a PURGE or
                    // otherwise store the message for later delivery.
                    if (persist) {
                        new Thread(new Runnable() {

                            @Override
                            public void run() {
                                try {
                                    checkPersistence(socket, msg);
                                } catch (IOException e) {
                                    Logging.getLogger().warning("Unable to maintain persistence");
                                }
                            }
                        }).start();
                    }
                }
            } catch (IOException e) {
                Logging.getLogger().warning("Unable to send user message");
            }
        }
    }