Include correct JMAP capabilities in using

This commit is contained in:
Maurus Decimus
2026-06-19 11:05:04 +02:00
parent 08c1c5ac84
commit 4102b5f4ae
4 changed files with 16 additions and 9 deletions
+3 -1
View File
@@ -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]
+2 -3
View File
@@ -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 => {