addMessage(octxt, (ParsedMessage) obj, folderId, false, Flag.FLAG_UNREAD, null);
addMessage(octxt, (ParsedMessage) obj, folderId, true, Flag.FLAG_UNREAD, null);
    public synchronized void importFeed(OperationContext octxt, int folderId, String url, boolean subscription) throws ServiceException {        if (url == null || url.equals(""))            return;        // get the remote data, skipping anything we've already seen (if applicable)        Folder.SyncData fsd = subscription ? getFolderById(octxt, folderId).getSyncData() : null;        FeedManager.SubscriptionData sdata = FeedManager.retrieveRemoteDatasource(getAccount(), url, fsd);        if (sdata.items.isEmpty())            return;        // clear out the folder if we're replacing the previous content        if (subscription && sdata.items.get(0) instanceof Invite)            emptyFolder(octxt, folderId, false);        // add the newly-fetched items to the folder        for (Object obj : sdata.items)            try {                if (obj instanceof Invite)                    addInvite(octxt, (Invite) obj, folderId, true, null);                else if (obj instanceof ParsedMessage)                    addMessage(octxt, (ParsedMessage) obj, folderId, false, Flag.FLAG_UNREAD, null);            } catch (IOException e) {                throw ServiceException.FAILURE("IOException", e);            }        // update the subscription to avoid downloading items twice        if (subscription && sdata.lastDate > 0)            try {                setSubscriptionData(octxt, folderId, sdata.lastDate, sdata.lastGuid);            } catch (Exception e) {                ZimbraLog.mailbox.warn("could not update feed metadata", e);            }    }