melib/jmap: re-add Submission to USING

Submission capability is necessary for Identity retrievals.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
This commit is contained in:
Manos Pitsidianakis 2024-06-02 12:20:15 +03:00
parent 45bfcf8707
commit 33999fc6ab
No known key found for this signature in database
GPG Key ID: 7729C7707F7E09D0
2 changed files with 10 additions and 4 deletions

View File

@ -62,7 +62,11 @@ pub trait Method<OBJ: Object>: Serialize + Send + Sync {
const NAME: &'static str;
}
static USING: &[&str] = &[JmapCoreCapability::uri(), JmapMailCapability::uri()];
static USING: &[&str] = &[
JmapCoreCapability::uri(),
JmapMailCapability::uri(),
JmapSubmissionCapability::uri(),
];
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]

View File

@ -66,7 +66,7 @@ fn test_jmap_query() {
futures::executor::block_on(req.add_call(&email_call));
assert_eq!(
r#"{"using":["urn:ietf:params:jmap:core","urn:ietf:params:jmap:mail"],"methodCalls":[["Email/query",{"accountId":"account_id","calculateTotal":false,"collapseThreads":false,"filter":{"conditions":[{"inMailbox":"mailbox_id"},{"conditions":[{"subject":"wah"},{"conditions":[{"from":"Manos"},{"conditions":[{"subject":"foo"},{"subject":"bar"}],"operator":"OR"}],"operator":"AND"}],"operator":"OR"}],"operator":"AND"},"position":0,"sort":null},"m0"]]}"#,
r#"{"using":["urn:ietf:params:jmap:core","urn:ietf:params:jmap:mail","urn:ietf:params:jmap:submission"],"methodCalls":[["Email/query",{"accountId":"account_id","calculateTotal":false,"collapseThreads":false,"filter":{"conditions":[{"inMailbox":"mailbox_id"},{"conditions":[{"subject":"wah"},{"conditions":[{"from":"Manos"},{"conditions":[{"subject":"foo"},{"subject":"bar"}],"operator":"OR"}],"operator":"AND"}],"operator":"OR"}],"operator":"AND"},"position":0,"sort":null},"m0"]]}"#,
serde_json::to_string(&req).unwrap().as_str()
);
assert_eq!(*futures::executor::block_on(request_no.lock()), 1);
@ -269,7 +269,8 @@ fn test_jmap_identity_methods() {
],
"using" : [
"urn:ietf:params:jmap:core",
"urn:ietf:params:jmap:mail"
"urn:ietf:params:jmap:mail",
"urn:ietf:params:jmap:submission"
]
}},
);
@ -426,7 +427,8 @@ fn test_jmap_argument_serde() {
],
"using": [
"urn:ietf:params:jmap:core",
"urn:ietf:params:jmap:mail"
"urn:ietf:params:jmap:mail",
"urn:ietf:params:jmap:submission"
]
}},
);