Close #70: cant open ics file in ical on macos mojave

Fixed syntax errors in the ICS file.
Verified by http://ical-validator.herokuapp.com/validate/
Thanks for the service.
This commit is contained in:
Christian Hohnstaedt 2020-04-01 12:07:33 +02:00
parent 98e5e0e246
commit 096e57ec8c
3 changed files with 28 additions and 12 deletions

View File

@ -415,13 +415,13 @@ QStringList pki_base::icsVEVENT(const a1time &expires,
"BEGIN:VEVENT" <<
QString("DTSTAMP:%1").arg(a1time().toString("yyyyMMdd'T'HHmmss'Z'")) <<
QString("UID:EXP-%1@xca.ovh").arg(uniqueid) <<
"STATUS:NEEDS-ACTION" <<
"STATUS:CONFIRMED" <<
QString("DTSTART:%1").arg(expires.toString("yyyyMMdd")) <<
"DURATION:P1D" <<
QString("SUMMARY:%1").arg(icsValue(summary)) <<
QString("DESCRIPTION:%1").arg(desc) <<
"BEGIN:VALARM" <<
"ACTION:EMAIL" <<
"ACTION:DISPLAY" <<
QString("SUMMARY:%1").arg(icsValue(summary)) <<
QString("DESCRIPTION:%1").arg(desc) <<
QString("TRIGGER:-P%1").arg(alarm) <<

View File

@ -432,12 +432,22 @@ QVariant pki_crl::getIcon(const dbheader *hd) const
QStringList pki_crl::icsVEVENT() const
{
pki_x509 *ca = getIssuer();
if (ca) {
return pki_base::icsVEVENT(getNextUpdate(),
tr("CRL Renewal of CA '%1' due").arg(ca->getIntName()),
tr("The latest CRL issued by the CA '%1' will expire on %2.\n"
"It is stored in the XCA database '%3'")
.arg(ca->getIntName())
.arg(getNextUpdate().toPretty())
.arg(currentDB)
);
}
return pki_base::icsVEVENT(getNextUpdate(),
tr("Renew CRL: %1").arg(getIntName()),
tr("The XCA CRL '%1', issued by the CA '%2' on %3 will expire on %4.\n"
tr("The XCA CRL '%1', issued on %3 will expire on %4.\n"
"It is stored in the XCA database '%5'")
.arg(getIntName())
.arg(getIssuerName())
.arg(getLastUpdate().toPretty())
.arg(getNextUpdate().toPretty())
.arg(currentDB)

View File

@ -954,6 +954,8 @@ QStringList pki_x509::icsVEVENT() const
QStringList pki_x509::icsVEVENT_ca() const
{
QStringList ics;
pki_crl *crl = NULL;
ics << icsVEVENT();
foreach(pki_base *p, childItems) {
pki_x509 *pki = static_cast<pki_x509 *>(p);
@ -961,14 +963,18 @@ QStringList pki_x509::icsVEVENT_ca() const
ics << pki->icsVEVENT();
}
ics << pki_base::icsVEVENT(crlExpire,
tr("CRL Renewal of CA '%1' due").arg(getIntName()),
tr("The latest CRL issued by the CA '%1' will expire on %2.\n"
"It is stored in the XCA database '%3'")
.arg(getIntName())
.arg(crlExpire.toPretty())
.arg(currentDB)
);
QList<pki_crl*> list = db_base::sqlSELECTpki<pki_crl>(
"SELECT item FROM crls WHERE issuer = ?",
QList<QVariant>() << QVariant(sqlItemId));
/* Get latest CRL */
foreach(pki_crl *pki, list) {
if (!crl || crl->getNextUpdate() < pki->getNextUpdate())
crl = pki;
}
if (crl)
ics << crl->icsVEVENT();
return ics;
}