protected Element addMessageHit(ZimbraSoapContext zc, Element response, MessageHit mh, EmailElementCache eecache, boolean inline, SearchParams params)
protected Element addMessageHit(ZimbraSoapContext zsc, Element response, MessageHit mh, EmailElementCache eecache, boolean inline, SearchParams params)
    protected Element addMessageHit(ZimbraSoapContext zc, Element response, MessageHit mh, EmailElementCache eecache, boolean inline, SearchParams params)    throws ServiceException {        Message msg = mh.getMessage();        // for bug  7568, mark-as-read must happen before the response is encoded.        if (inline && msg.isUnread() && params.getMarkRead()) {            // Mark the message as READ                      try {                ArrayList<Integer> ids = new ArrayList<Integer>(1);                ids.add(msg.getId());                ItemActionOperation.TAG(zc, null,  zc.getOperationContext(), msg.getMailbox(), Requester.SOAP, ids, MailItem.TYPE_MESSAGE, false, null, Flag.ID_FLAG_UNREAD);            } catch (ServiceException e) {                mLog.warn("problem marking message as read (ignored): " + msg.getId(), e);            }        }                Element m;        if (inline) {            m = ToXML.encodeMessageAsMP(response, zc, msg, null, params.getWantHtml(), true);            if (!msg.getFragment().equals(""))                m.addAttribute(MailService.E_FRAG, msg.getFragment(), Element.DISP_CONTENT);        } else            m = ToXML.encodeMessageSummary(response, zc, msg, params.getWantRecipients());        if (mh.getScore() != 0)            m.addAttribute(MailService.A_SCORE, mh.getScore());        m.addAttribute(MailService.A_CONTENTMATCHED, true);        List<MessagePartHit> parts = mh.getMatchedMimePartNames();        if (parts != null) {            for (MessagePartHit mph : parts) {                String partNameStr = mph.getPartName();                if (partNameStr.length() > 0) {                    Element mp = m.addElement(MailService.E_HIT_MIMEPART);                    mp.addAttribute(MailService.A_PART, partNameStr);                }            }        }                return m;    }