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,9 +446,18 @@ void IncidenceAttendee::expandResult(KJob *job)
Q_ASSERT(mExpandGroupJobs.contains(job));
KCalCore::Attendee::Ptr attendee = mExpandGroupJobs.take(job);
int row = dataModel()->attendees().indexOf(attendee);
const QString currentEmail = attendee->email();
const KContacts::Addressee::List groupMembers = expandJob->contacts();
bool wasACorrectEmail = false;
for (const KContacts::Addressee &member : groupMembers) {
if (member.preferredEmail() == currentEmail) {
wasACorrectEmail = true;
break;
}
}
if (!wasACorrectEmail) {
dataModel()->removeRow(row);
const KContacts::Addressee::List groupMembers = expandJob->contacts();
for (const KContacts::Addressee &member : groupMembers) {
KCalCore::Attendee::Ptr newAt(new KCalCore::Attendee(
member.realName(), member.preferredEmail(),
......@@ -458,6 +467,7 @@ void IncidenceAttendee::expandResult(KJob *job)
member.uid()));
dataModel()->insertAttendee(row, newAt);
}
}
}
void IncidenceAttendee::slotSelectAddresses()
......
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