CreateAppointmentRecorder recorder = (CreateAppointmentRecorder) mbox.getRedoRecorder(); recorder.setAppointmentPartStat(partStat);
    private String processPartStat(Invite invite,                                   MimeMessage mmInv,                                   boolean forCreate)    throws ServiceException {        Account account = getMailbox().getAccount();        Locale lc;        Account organizer = invite.getOrganizerAccount();        if (organizer != null)            lc = organizer.getLocale();        else            lc = account.getLocale();        String partStat = IcalXmlStrMap.PARTSTAT_NEEDS_ACTION;        if (invite.thisAcctIsOrganizer(account)) {            partStat = IcalXmlStrMap.PARTSTAT_ACCEPTED;        } else if (account instanceof CalendarResource) {            CalendarResource resource = (CalendarResource) account;            if (resource.autoAcceptDecline()) {                partStat = IcalXmlStrMap.PARTSTAT_ACCEPTED;                Mailbox mbox = getMailbox();                OperationContext octxt = mbox.getOperationContext();                if (isRecurring() && resource.autoDeclineRecurring()) {                    partStat = IcalXmlStrMap.PARTSTAT_DECLINED;                    String reason =                        CalendarL10n.getMessage(MsgKey.resourceDeclineReasonRecurring, lc);                    CalendarMailSender.sendReply(                            octxt, mbox, false,                            CalendarMailSender.VERB_DECLINE,                            reason + "\r\n",                            this, invite, mmInv);                } else if (resource.autoDeclineIfBusy()) {                    List<Availability> avail = checkAvailability();                    if (!Availability.isAvailable(avail)) {                        partStat = IcalXmlStrMap.PARTSTAT_DECLINED;                        String msg =                            CalendarL10n.getMessage(MsgKey.resourceDeclineReasonConflict, lc) +                            "\r\n\r\n" +                            Availability.getBusyTimesString(avail, invite.getStartTime().getTimeZone(), lc);                        CalendarMailSender.sendReply(                                octxt, mbox, false,                                CalendarMailSender.VERB_DECLINE,                                msg,                                this, invite, mmInv);                    }                }                if (IcalXmlStrMap.PARTSTAT_ACCEPTED.equals(partStat)) {                    CalendarMailSender.sendReply(                            octxt, mbox, false,                            CalendarMailSender.VERB_ACCEPT,                            null,                            this, invite, mmInv);                }            }        }        // TODO: Skip the update below if no real change is being made.        // The saveMetadata call goes to the database and thus is        // expensive.        invite.updateMyPartStat(account, partStat);        if (forCreate) {            Invite defaultInvite = getDefaultInvite();            assert(defaultInvite != null);            if (!defaultInvite.equals(invite))                defaultInvite.updateMyPartStat(account, partStat);            saveMetadata();        }        return partStat;    }