[M8-03] Calendar invites: show an `.ics` invite (`METHOD:REQUEST`) and reply accept, tentative or decline, without building a calendar app

Open
#263 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
15/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Active
Tech stack
android, ios, rust
Domain
mobile-dev

Research direction

The body has no files, places or acceptance criteria yet, so there is no named entry point. Read CONTRIBUTING.md and the existing mail rendering code to find where message parts are displayed, then ask a maintainer which module should own the invite parsing. Done would be an .ics with METHOD:REQUEST showing accept, tentative and decline replies, which the maintainer has not yet confirmed.

Written by the indexing model from the issue text.

Description

area:core m8 post-1.0

Roadmap ID: M8-03 (M8 — After 1.0)

🤖 This looks suitable for an AI agent. Now that the sections below are filled in, a maintainer can review them and add the agent-ready label.

Goal

Calendar invites: show an .ics invite (METHOD:REQUEST) and reply accept, tentative or decline, without building a calendar app

Files and places

  • Parsing. core/crates/mailcrane-mime/src/calendar.rs (new): a small, bounded iCalendar (RFC 5545) reader for one VEVENT inside VCALENDAR with METHOD:REQUEST (and CANCEL, shown read-only).
    • Fields: UID, SEQUENCE, SUMMARY, DTSTART/DTEND or DURATION, TZID with an embedded VTIMEZONE or the platform's time zone database, LOCATION, ORGANIZER, ATTENDEE with PARTSTAT, and RRULE shown as text only.
    • Handle line unfolding, escaping and parameter quoting. Limit input size, line length, property count and nesting. It returns errors and never panics.
    • Use an MPL-compatible crate only if it is small and maintained. Otherwise write the subset, with a note in the PR on why.
  • Finding the invite. In mailcrane-mime/src/model.rs, a text/calendar; method=REQUEST part (inline or attached .ics) gives the message an invite field.
  • Replying. core/crates/mailcrane-core/src/calendar/ (new):
    • Build an RFC 5546 iMIP METHOD:REPLY with the same UID/SEQUENCE, only the user's ATTENDEE line, and PARTSTAT set to ACCEPTED, TENTATIVE or DECLINED.
    • Wrap it in multipart/alternative (a short text part plus text/calendar; method=REPLY) through mailcrane-mime/src/build.rs.
    • Send it to the ORGANIZER through the outbox (undo send applies).
    • The user's attendee address is matched against the account's addresses, case-insensitively. If none matches, the reply is refused with a clear message, not sent.
  • FFI. mailcrane-ffi/src/messages.rs exposes the invite. A new function sends the reply.
  • Android.
    • An invite card at the top of ui/message/MessageScreen.kt: title, local date and time (with the original time zone if it differs), location, organiser, and Accept / Maybe / Decline.
    • After replying, the card shows the answer sent.
    • "Add to calendar" hands the .ics to the system calendar with ACTION_VIEW/ACTION_INSERT. No calendar permission and no calendar inside the app.
  • docs/changelog.d/263.feature.md.

Out of scope: creating events, a calendar view, CalDAV, updating events after a counter-proposal.

Acceptance criteria

  • Invites from Google Calendar, Outlook/Exchange and Thunderbird show correct title, time (across time zones and DST) and organiser. The test fixtures are anonymised .ics files under core/crates/mailcrane-mime/tests/fixtures/calendar/.
  • Accept, Maybe and Decline send a valid iMIP REPLY that the organiser's client accepts. Check the structure in a test against RFC 5546 examples.
  • A CANCEL shows "This event was cancelled" with no reply buttons.
  • Hostile .ics input (huge, deeply nested, bad dates, endless folding) returns errors and never panics: proptest plus a fuzz target.
  • No reply is sent when the user isn't an attendee, and failing to send leaves the card in its earlier state.
  • Nothing from the invite (title, location, attendees) is logged.
  • One PR from branch 263-calendar-invites, with a Conventional Commit title, Closes #263 and a changelog fragment.

How to test

cd core && cargo test -p mailcrane-mime calendar && cargo test -p mailcrane-core calendar
cd android && ./gradlew ktlintFormat assembleDebug testDebugUnitTest lintDebug

On the emulator: deliver a fixture invite to the testkit mailbox, open it, press Accept, and check the sent REPLY in the outbox or Sent folder.


Want this? Comment /claim. See CONTRIBUTING.md.

Dominant language
Rust
Stars
2
Forks
0
Avg merge
34m
Merged PRs (30d)
238

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from level-98/mailcrane

All issues in level-98/mailcrane

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.