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() { private fun updateAttendees() {
val currentCalendar = calDAVHelper.getCalDAVCalendars("", true).firstOrNull { it.id == mEventCalendarId } val currentCalendar = calDAVHelper.getCalDAVCalendars("", true).firstOrNull { it.id == mEventCalendarId }
mAttendees.forEach { mAttendees.forEach {
it.isMe = it.email == currentCalendar?.accountName it.isMe = it.email == currentCalendar?.ownerName
} }
mAttendees.sortWith(compareBy<Attendee> mAttendees.sortWith(compareBy<Attendee>
@ -1827,8 +1827,8 @@ 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?.ownerName }?.apply {
attendees = attendees.filter { it.email != currentCalendar?.accountName }.toMutableList() as ArrayList<Attendee> attendees = attendees.filter { it.email != currentCalendar?.ownerName }.toMutableList() as ArrayList<Attendee>
status = Attendees.ATTENDEE_STATUS_ACCEPTED status = Attendees.ATTENDEE_STATUS_ACCEPTED
relationship = Attendees.RELATIONSHIP_ORGANIZER relationship = Attendees.RELATIONSHIP_ORGANIZER
attendees.add(this) attendees.add(this)