diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f357eb..425e17d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [1.0.4] - 2026-06-XX + +### Added + +### Changed + +### Fixed +- Include correct JMAP capabilities in `using`. + ## [1.0.3] - 2026-06-15 ### Added @@ -12,10 +21,6 @@ All notable changes to this project will be documented in this file. This projec - Mailbox roles must be unique per archive (#8). - Google takeout: Decode MIME-encoded values in `X-Gmail-Labels` (#7). -# Change Log - -All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). - ## [1.0.2] - 2026-06-11 ### Added diff --git a/src/jmap/request.rs b/src/jmap/request.rs index 11dcca0..3d5ae08 100644 --- a/src/jmap/request.rs +++ b/src/jmap/request.rs @@ -18,7 +18,8 @@ pub const URN_CORE: &str = "urn:ietf:params:jmap:core"; pub fn using_urn(method: &str) -> &'static str { let prefix = method.split('/').next().unwrap_or(method); match prefix { - "Mailbox" | "Email" | "Identity" => "urn:ietf:params:jmap:mail", + "Mailbox" | "Email" => "urn:ietf:params:jmap:mail", + "Identity" => "urn:ietf:params:jmap:submission", "SieveScript" => "urn:ietf:params:jmap:sieve", "AddressBook" | "ContactCard" => "urn:ietf:params:jmap:contacts", "Calendar" | "CalendarEvent" | "ParticipantIdentity" => "urn:ietf:params:jmap:calendars", @@ -743,6 +744,7 @@ mod tests { using_urn("CalendarEvent/set"), "urn:ietf:params:jmap:calendars" ); + assert_eq!(using_urn("Identity/get"), "urn:ietf:params:jmap:submission"); } #[test] diff --git a/src/types.rs b/src/types.rs index 66649e1..82f8df9 100644 --- a/src/types.rs +++ b/src/types.rs @@ -66,9 +66,8 @@ impl ObjectType { pub fn capability_urn(self) -> &'static str { match self { - ObjectType::Mailbox | ObjectType::Email | ObjectType::Identity => { - "urn:ietf:params:jmap:mail" - } + ObjectType::Mailbox | ObjectType::Email => "urn:ietf:params:jmap:mail", + ObjectType::Identity => "urn:ietf:params:jmap:submission", ObjectType::SieveScript => "urn:ietf:params:jmap:sieve", ObjectType::AddressBook | ObjectType::ContactCard => "urn:ietf:params:jmap:contacts", ObjectType::Calendar | ObjectType::CalendarEvent | ObjectType::ParticipantIdentity => { diff --git a/tests/seeder/seed.rs b/tests/seeder/seed.rs index 93ae04c..d93af57 100644 --- a/tests/seeder/seed.rs +++ b/tests/seeder/seed.rs @@ -16,6 +16,7 @@ use super::jmap::Jmap; const CORE: &str = "urn:ietf:params:jmap:core"; const MAIL: &str = "urn:ietf:params:jmap:mail"; +const SUBMISSION: &str = "urn:ietf:params:jmap:submission"; const SIEVE: &str = "urn:ietf:params:jmap:sieve"; const CONTACTS: &str = "urn:ietf:params:jmap:contacts"; const CALENDARS: &str = "urn:ietf:params:jmap:calendars"; @@ -239,7 +240,7 @@ fn seed_sieve(jmap: &Jmap, account_id: &str, active: bool) -> SeedResult<()> { fn seed_identity(jmap: &Jmap, account_id: &str, account_email: &str) -> SeedResult<()> { jmap.set_create( - &[CORE, MAIL], + &[CORE, SUBMISSION], "Identity/set", account_id, json!({