The handling of invitations in mail is done in more parts:
display the invitation
kdepim/plugins/messageviewer/body_formater/text_calendar.cpp
ldepimlibs/kcalutils/incidenceformater.cpp
most interessting function: formatICalInvitationHelper
existingInc = calendar()->incidence(incBase->uid())
^^ this is correct, but needs also recurenceID, to detect exceptions:
existingInc = calendar()->incidence(incBase->uid(), incBase->recurenceID())
handling the click
kdepim/plugins/messageviewer/body_formater/text_calendar.cpp
entry point: handleClick
handleInvitation
- iCal is the mail
- invitation is the the invitation parsed out of the mail (not checked if existing) and updated!
saveFile (with iCal - the mail to send)
kdepimlibs/akonadi/calendar/itiphandler.cpp
-> ITIPHandler::processiTIPMessage(const QString &receiver, const QString &iCal, const QString &action)
set d->m_incidence but it is the parsed invitation out of iCal
for "cancel" it detects existing incidence by schedulingID, but only uses this for displaying the warning about not finding an event to delete in the debug log
call d->m_scheduler->acceptTransaction in anycase
kdepimlibs/akonadi/calendar/schedular_p.cpp
-> acceptTransaction
->acceptRequest, acceptAdd,...
acceptRequest / acceptCancel
- detects existingIncidence byScheduilingID only
- test if the existingIncidence has not the the status NeedsAction for our status
- if above is true than tries to find exception
existingInstance = calendar->incidence(incidence->instanceIdentifier());
^^ this is wrong in my understanding and should be rewritten to, because the incidence method test if the recurrenceID is null if it is not set:
existingInstance = calendar->incidence(incidence->uid(), incBase->recurenceID());
acceptReply
- detects existingIncidence by calendar()->incidence(uid)
^^ also problem with exceptions