private static void updateState(RosterItem item, Presence.Type action, boolean isSending) {
        Change change = getStateChange(item.getSubStatus(), action, isSending);
        if (change.getNewAsk() != null && change.getNewAsk() != item.getAskStatus()) {
            item.setAskStatus(change.getNewAsk());
        }
        if (change.getNewSub() != null && change.getNewSub() != item.getSubStatus()) {
            item.setSubStatus(change.getNewSub());
        }
        if (change.getNewRecv() != null && change.getNewRecv() != item.getRecvStatus()) {
            item.setRecvStatus(change.getNewRecv());
        }
    }
Determine and call the update method based on the item's subscription state.
<p/>

@param item      The item to be updated
@param action    The new state change request
@param isSending True if the roster owner of the item is sending the new state change request
xmppserver/src/main/java/org/jivesoftware/openfire/handler/PresenceSubscribeHandler.java