Only allow attendee status modification by owner

ACCOUNT_NAME is different from OWNER_ACCOUNT.
This commit is contained in:
Naveen 2023-09-27 23:22:42 +05:30
parent 0241e3beea
commit c779aabfae
No known key found for this signature in database
GPG Key ID: 0E155DAD31671DA3
1 changed files with 3 additions and 3 deletions

View File

@ -1637,7 +1637,7 @@ class EventActivity : SimpleActivity() {
private fun updateAttendees() {
val currentCalendar = calDAVHelper.getCalDAVCalendars("", true).firstOrNull { it.id == mEventCalendarId }
mAttendees.forEach {
it.isMe = it.email == currentCalendar?.accountName
it.isMe = it.email == currentCalendar?.ownerName
}
mAttendees.sortWith(compareBy<Attendee>
@ -1827,8 +1827,8 @@ class EventActivity : SimpleActivity() {
if (mEvent.id == null && isSavingEvent && attendees.isNotEmpty()) {
val currentCalendar = calDAVHelper.getCalDAVCalendars("", true).firstOrNull { it.id == mEventCalendarId }
mAvailableContacts.firstOrNull { it.email == currentCalendar?.accountName }?.apply {
attendees = attendees.filter { it.email != currentCalendar?.accountName }.toMutableList() as ArrayList<Attendee>
mAvailableContacts.firstOrNull { it.email == currentCalendar?.ownerName }?.apply {
attendees = attendees.filter { it.email != currentCalendar?.ownerName }.toMutableList() as ArrayList<Attendee>
status = Attendees.ATTENDEE_STATUS_ACCEPTED
relationship = Attendees.RELATIONSHIP_ORGANIZER
attendees.add(this)