Commit b615d0ec authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Don't expand address if this address is from a contactgroup.

We must expand just contact group

(cherry picked from commit 3ba08666)
parent 64b85dad
...@@ -446,17 +446,27 @@ void IncidenceAttendee::expandResult(KJob *job) ...@@ -446,17 +446,27 @@ void IncidenceAttendee::expandResult(KJob *job)
Q_ASSERT(mExpandGroupJobs.contains(job)); Q_ASSERT(mExpandGroupJobs.contains(job));
KCalCore::Attendee::Ptr attendee = mExpandGroupJobs.take(job); KCalCore::Attendee::Ptr attendee = mExpandGroupJobs.take(job);
int row = dataModel()->attendees().indexOf(attendee); int row = dataModel()->attendees().indexOf(attendee);
const QString currentEmail = attendee->email();
dataModel()->removeRow(row);
const KContacts::Addressee::List groupMembers = expandJob->contacts(); const KContacts::Addressee::List groupMembers = expandJob->contacts();
bool wasACorrectEmail = false;
for (const KContacts::Addressee &member : groupMembers) { for (const KContacts::Addressee &member : groupMembers) {
KCalCore::Attendee::Ptr newAt(new KCalCore::Attendee( if (member.preferredEmail() == currentEmail) {
member.realName(), member.preferredEmail(), wasACorrectEmail = true;
attendee->RSVP(), break;
attendee->status(), }
attendee->role(), }
member.uid()));
dataModel()->insertAttendee(row, newAt); if (!wasACorrectEmail) {
dataModel()->removeRow(row);
for (const KContacts::Addressee &member : groupMembers) {
KCalCore::Attendee::Ptr newAt(new KCalCore::Attendee(
member.realName(), member.preferredEmail(),
attendee->RSVP(),
attendee->status(),
attendee->role(),
member.uid()));
dataModel()->insertAttendee(row, newAt);
}
} }
} }
......
Markdown is supported
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