Class CaldavCopyConsent

java.lang.Object
org.exoplatform.caldav.service.CaldavCopyConsent

@Component public class CaldavCopyConsent extends Object
Whether a user has said yes to meeting copies at all, said once.

Why this is a bean and not a private method

It was a private method, on the seeding pass, and one reader was enough for that. A second reader arrived with EXO-90247: deciding whether to skip an invitee's copy because the server will deliver the invitation itself requires knowing that the organizer's own copy really is being written — an organizer who turned copies off puts no organizer-bearing object on the server, so nothing is delivered natively and the invitee's copy must be written as before. That is the same question about a different person, and asking it twice in two spellings is how the two answers drift apart.

It is deliberately a bean of its own rather than a method moved onto either reader. The seeding pass already depends on the push service; a home on either of those would make the other's dependency a cycle. This one depends on agenda's settings service and on nothing else in the add-on.

Why it is predictive and not evidential

The honest-looking alternative — ask whether a copy of the event already exists in the organizer's account — cannot be used at the moment the question is asked. The author's own copy is pushed by their browser, which races the creation fan-out (see EventCreatedListener), so at fan-out time the row is routinely absent and an evidential check would answer "no organizer copy" for exactly the meetings this decision is about. Consent is what can be read reliably before the fact.

  • Constructor Details

    • CaldavCopyConsent

      public CaldavCopyConsent()
  • Method Details

    • copiesEnabled

      public boolean copiesEnabled(long userIdentityId)
      Whether this user receives copies at all — the same per-account switch the browser flow honours, read from agenda's settings for this add-on's provider. A user who turned copies off has said no to everything the copy machinery does, the seeded pending invitations included.

      An unreadable answer is "no". No settings readable means no consent readable, and consent is the one thing a write into somebody's calendar must not assume.

      Parameters:
      userIdentityId - identity of the user
      Returns:
      true when the connected CalDAV account accepts copies