pub async fn handle_message_query<B: ChatBackend>(
backend: &B,
caller: &B::CallerCtx,
args: Value,
using: &[String],
) -> Result<HandlerOutput, JmapError>Expand description
Handle a Message/query method call (draft-atwood-jmap-chat-00 §Message).
args is the RFC 8620 §5.5 /query request shape (accountId, optional
filter, optional sort, optional position / anchor /
anchorOffset, optional limit, optional calculateTotal); the
returned Value is the §5.5 /query response shape (accountId,
queryState, canCalculateChanges, position, ids, optional
total, optional limit).
Unknown filter clauses and sort properties are refused with
unsupportedFilter / unsupportedSort (RFC 8620 §5.5).
using is the request’s capability list (pass
jmap_server::CallContext::using); without
urn:ietf:params:jmap:metadata a draft-ietf-jmap-metadata-05 §3.6
filter condition is unsupportedFilter (-05 §3). A JMAP Search
where (crate-jmap docs/specs/jmap-search.md) needs
urn:ietf:params:jmap:search in using and "Message" in
ChatSettings::search_capability, else unsupportedFilter; it is
checked with jmap_search::check_where_filter and makes
canCalculateChanges false. It does not lift the chatId /
hasMention: true rule.
Returns (response_args, extra_invocations). The extra list is always empty.
§Errors
Returns a method-level JmapError:
invalidArgumentswhenaccountIdis missing or not a valid Id, or whenfilter,sort,position,anchor,anchorOffsetorlimitis malformed;accountNotFoundwhen the backend does not knowaccountId;unsupportedFilterwhen the filter does not decode as a Message filter, or holds a draft-ietf-jmap-metadata-05 §3.6 condition withouturn:ietf:params:jmap:metadatainusing;unsupportedFilter, too, when the filter is not a single condition withchatIdorhasMention: true, setstext, or setsthreadRootIdwithout thread support, or when a JMAP Searchwhereis refused; a malformedwhereisinvalidArgumentsand one nested too deepqueryTooComplex(jmap_search::check_where_filter);unsupportedSortwhensortnames a property this server does not define;anchorNotFoundwhenanchoris not in the results;serverFailwhen the backend fails, or any other RFC 8620 §5.5 error the backend returns.