-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a CalDAV based implementation for EventAttendanceRepository #1498
base: master
Are you sure you want to change the base?
Provide a CalDAV based implementation for EventAttendanceRepository #1498
Conversation
if (partStat.equals(PartStat.ACCEPTED)) { | ||
return Optional.of(Accepted); | ||
} else if (partStat.equals(PartStat.DECLINED)) { | ||
return Optional.of(Declined); | ||
} else if (partStat.equals(PartStat.NEEDS_ACTION)) { | ||
return Optional.of(NeedsAction); | ||
} else if (partStat.equals(PartStat.TENTATIVE)) { | ||
return Optional.of(Tentative); | ||
} else { | ||
LOGGER.trace("Unable to map PartStat '{}' to AttendanceStatus.", partStat); | ||
return Optional.empty(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switch?
AttendanceStatus.fromCalendarAttendeeParticipationStatus(p).orElseThrow()) | ||
)).getOrElse(() -> CalendarEventAttendanceResults$.MODULE$.notFound(blobId)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AttendanceStatus.fromCalendarAttendeeParticipationStatus(p).orElseThrow())))
.getOrElse(() -> CalendarEventAttendanceResults$.MODULE$.notFound(blobId));
if (events.isEmpty()) { | ||
LOGGER.debug(""" | ||
No VEvents found in calendar object. | ||
Returning empty attendance results. | ||
"""); | ||
return CalendarEventAttendanceResults.empty(); | ||
} else { | ||
LOGGER.debug(""" | ||
Expected exactly one VEvent, but found {} entries. Using the first VEvent. | ||
This may indicate unhandled recurrent events or a malformed calendar object. | ||
VEvents: {} | ||
""", events.size(), events); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One line logs please
return Flux.fromIterable(JavaConverters.seqAsJavaList(calendarEventBlobIds.value())) | ||
.flatMap(blobId -> getEventUid(blobId.value(), systemMailboxSession) | ||
.flatMap(eventUid -> | ||
toDavUser(username) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please manage to resolve the dav user only once and not fot each event Uid
public Publisher<CalendarEventReplyResults> setAttendanceStatus(Username username, | ||
AttendanceStatus attendanceStatus, | ||
BlobIds eventBlobIds, | ||
Optional<LanguageLocation> maybePreferredLanguage) { | ||
return null; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
...l-third-party/openpaas/src/main/java/com/linagora/tmail/CalDavEventAttendanceRepository.java
Show resolved
Hide resolved
.reduce(CalendarEventAttendanceResults$.MODULE$.empty(), CalendarEventAttendanceResults$.MODULE$::merge); | ||
} | ||
|
||
private CalendarEventAttendanceResults getAttendanceStatusFromCalendarObject(BlobId blobId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is long. Prease do use method extraction
return extractMessageId(blobId) | ||
.flatMap(messageId -> | ||
Mono.fromDirect( | ||
messageIdManager.getMessagesReactive(List.of(messageId), FetchGroup.MINIMAL, mailboxSession))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FetchGroup.HEADERS
Closes #1329