avoid adding myself to the events twice

This commit is contained in:
tibbi 2019-03-20 20:27:53 +01:00
parent 2a9c368329
commit 92ec9e29f6

View File

@ -1344,6 +1344,7 @@ class EventActivity : SimpleActivity() {
if (mEvent.id == null && isSavingEvent && attendees.isNotEmpty()) { if (mEvent.id == null && isSavingEvent && attendees.isNotEmpty()) {
val currentCalendar = calDAVHelper.getCalDAVCalendars("", true).firstOrNull { it.id == mEventCalendarId } val currentCalendar = calDAVHelper.getCalDAVCalendars("", true).firstOrNull { it.id == mEventCalendarId }
mAvailableContacts.firstOrNull { it.email == currentCalendar?.accountName }?.apply { mAvailableContacts.firstOrNull { it.email == currentCalendar?.accountName }?.apply {
attendees = attendees.filter { it.email != currentCalendar?.accountName }.toMutableList() as ArrayList<Attendee>
status = CalendarContract.Attendees.ATTENDEE_STATUS_ACCEPTED status = CalendarContract.Attendees.ATTENDEE_STATUS_ACCEPTED
relationship = CalendarContract.Attendees.RELATIONSHIP_ORGANIZER relationship = CalendarContract.Attendees.RELATIONSHIP_ORGANIZER
attendees.add(this) attendees.add(this)