Skip to content
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 JMAP method: CalendarEventAttendance/get #1328

Open
chibenwa opened this issue Nov 22, 2024 · 1 comment
Open

Provide a JMAP method: CalendarEventAttendance/get #1328

chibenwa opened this issue Nov 22, 2024 · 1 comment
Labels

Comments

@chibenwa
Copy link
Member

chibenwa commented Nov 22, 2024

Why?

Now that #1326 is implemented (hopefully), and we have an internal API that manages event attendance status, we need a JMAP API that acts as a wrapper around that API.

How?

We would add two JMAP methods for managing local user's event attendance status:

  • CalendarEventAttendance/set
  • CalendarEventAttendance/get

We do not need to introduce a new capability and can use the exiting com:linagora:params:calendar:event capability to advertise that the server supports calling these new methods.

CalendarEvent/accept, CalendarEvent/reject, and CalendarEvent/maybe would need to be deprecated, but kept for now for backward compatibility. (it acts on blobId while we need to act on emailId to leverage flags as a way to store event attendance).

Below is the proposed API format:

We introduce the CalendarEventAttendance object:

  • id: Id. Must correspond to an id of an Email object.
  • evantAttendanceStatus: String. Represent the attendance status of the connected user to the event embedded as an attachment of the current email. Possible values:
    • Accepted
    • Declined
    • Tentative
    • Delegated
    • NeedsAction

CalendarEventAttendance/get is a standard /get method.

It would return an error when called on an email that do not have an ICS attachment with method REQUEST (invalidArguments).

CalendarEventAttendance/set is a standard /set method supporting only the update operation. Only supported values are Accept, Decline, Tentative.

It takes language as an optional argument, must be one of the configured supported language.

Examples:

  • CalendarEventAttendance/set
   "methodCalls": [
       ["CalendarEventAttendance/set",
           {
                "accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
                "update": {
                    "${messageId.serialize}": {
                      "evantAttendanceStatus": "Accepted",
                      "language": "fr"
                    }
                }
           },
    "c1"]]
    
    ["CalendarEventAttendance/set", {
      "accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
      "updated": {
        "${messageId..serialize}": {}
      }
    }, "c1"]
  • CalendarEventAttendance/get
"methodCalls": [[
    "CalendarEventAttendance/get",
    {
      "accountId": "unknownAccountId",
      "ids": ["messageId1"]
    },
    "c1"]]

    "methodResponses": [[
    "CalendarEventAttendance/get",
    {
      "accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
      "list": [
             {
                   "id": "messageId1",
                   "evantAttendanceStatus": "Accepted"
              }
        ]
    }

DoD

  • Integration Tests + Docs
@chibenwa
Copy link
Member Author

2 methods should likely be two tickets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant