void WriteMail::modify(const QMailMessage& previousMessage)
{
    QString recipients = "";

    prepareComposer(previousMessage.messageType(), previousMessage.parentAccountId());
    if (composer().isEmpty())
        return;

    // Record any message properties we should retain
    mail.setId(previousMessage.id());
    mail.setParentFolderId(previousMessage.parentFolderId());
    mail.setContentScheme(previousMessage.contentScheme());
    mail.setContentIdentifier(previousMessage.contentIdentifier());
    mail.setTo(previousMessage.to());
    mail.setFrom(previousMessage.from());
    mail.setCustomFields(previousMessage.customFields());
    mail.setServerUid(previousMessage.serverUid());

    m_composerInterface->compose(QMailMessage::NoResponse, previousMessage);

    // ugh. we need to do this everywhere
    m_hasMessageChanged = false;
    m_precursorId = mail.inResponseTo();
    m_replyAction = mail.responseType();
}
Exemple #2
0
// organized after lest expensive search
bool Search::matches(const QMailMessage& in) const
{
    if ( !matchesStatus(in) )
        return false;

    if ( !matchesAccount(in) )
        return false;
    if ( !matchesFolder(in) )
        return false;

    if ( !match(fromMail, in.from().toString() ) )
        return false;

    if ( !matchesTo(in) )
        return false;

    if ( !match(subject, in.subject() ) )
        return false;

    if ( !matchesBeforeDate(in) )
        return false;
    if ( !matchesAfterDate(in) )
        return false;

    if ( !matchesBody(in) )
        return false;

    return true;
}