Updated attendee status on accept

This commit is contained in:
M66B 2023-10-26 18:13:18 +02:00
parent 5e25f0b7f5
commit c44dc96934
1 changed files with 15 additions and 1 deletions

View File

@ -436,8 +436,22 @@ public class CalendarHelper {
values.put(CalendarContract.Events.STATUS, CalendarContract.Events.STATUS_CANCELED);
int rows = resolver.update(updateUri, values, null, null);
int arows = 0;
String email = attendees.get(0).getEmail();
if (!TextUtils.isEmpty(email)) {
ContentValues avalues = new ContentValues();
avalues.put(CalendarContract.Attendees.ATTENDEE_STATUS, CalendarContract.Attendees.ATTENDEE_STATUS_ACCEPTED);
arows = resolver.update(
CalendarContract.Attendees.CONTENT_URI,
avalues,
CalendarContract.Attendees.EVENT_ID + " =? AND " + CalendarContract.Attendees.ATTENDEE_EMAIL + " =?",
new String[]{Long.toString(eventId), email});
}
EntityLog.log(context, EntityLog.Type.General, message,
"Updated event id=" + eventId + " uid=" + uid + " rows=" + rows);
"Updated event id=" + eventId + " uid=" + uid + " email=" + email +
" rows=" + rows + "/" + arows);
}
}
}