Exemple #1
0
void DwDispositionType::SetFilename(const DwString &aStr)
{
    mFilenameStr = aStr;
    // Search for filename parameter in parameter list.  If found, set its
    // value.
    DwParameter *param = mFirstParameter;
    while(param)
    {
        if(DwStrcasecmp(param->Attribute(), "filename") == 0)
        {
            param->SetValue(mFilenameStr);
            return;
        }
        param = param->Next();
    }
    // Boundary parameter not found. Add it.
    param = DwParameter::NewParameter("", 0);
    param->SetAttribute("Filename");
    param->SetValue(aStr);
    AddParameter(param);
}
Exemple #2
0
static bool messageIsDispositionNotificationReport(KMMessage *msg)
{
    if(msg->type() == DwMime::kTypeMessage &&
            msg->subtype() == DwMime::kSubtypeDispositionNotification)
        return true;

    if(msg->type() != DwMime::kTypeMultipart ||
            msg->subtype() != DwMime::kSubtypeReport)
        return false;

    DwMediaType &ct = msg->dwContentType();
    DwParameter *param = ct.FirstParameter();
    while(param)
    {
        if(!qstricmp(param->Attribute().c_str(), "report-type")
                && !qstricmp(param->Value().c_str(), "disposition-notification"))
            return true;
        else
            param = param->Next();
    }
    return false;
}