Commit d75e3a68 authored by Sergio Martins's avatar Sergio Martins
Browse files

Strip out RECURRENCE-ID before sending single occurrence as ical.

RECURRENCE-ID incidences only make sense when the master incidence
is present (the one that contains the whole recurring series).

Leaving this bug open still, as we can make korganizer tolerate
and show these orphan incidences that don't have the corresponding
master incidence available.

CCBUG: 325117
parent bf312507
......@@ -241,16 +241,19 @@ void ITIPHandler::publishInformation( const KCalCore::Incidence::Ptr &incidence,
delete publishdlg;
}
void ITIPHandler::sendAsICalendar( const KCalCore::Incidence::Ptr &incidence,
void ITIPHandler::sendAsICalendar( const KCalCore::Incidence::Ptr &originalIncidence,
QWidget *parentWidget )
{
Q_UNUSED( parentWidget );
Q_ASSERT( incidence );
if ( !incidence ) {
Q_ASSERT( originalIncidence );
if ( !originalIncidence ) {
kError() << "Invalid incidence";
return;
}
// Clone so we can change organizer and recurid
KCalCore::Incidence::Ptr incidence = KCalCore::Incidence::Ptr( originalIncidence->clone() );
KPIMIdentities::IdentityManager identityManager;
QPointer<Akonadi::PublishDialog> publishdlg = new Akonadi::PublishDialog;
......@@ -262,6 +265,11 @@ void ITIPHandler::sendAsICalendar( const KCalCore::Incidence::Ptr &incidence,
Akonadi::CalendarUtils::email() ) ) );
}
if ( incidence->hasRecurrenceId() ) {
// For an individual occurrence, recur id doesn't make sense, since we're not sending the whole recurrence series.
incidence->setRecurrenceId(KDateTime());
}
KCalCore::ICalFormat format;
const QString from = Akonadi::CalendarUtils::email();
const bool bccMe = Akonadi::CalendarSettings::self()->bcc();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment