jmap: skip Email/get call if no emails to get

No need to send a JMAP request if there are no object to fetch.

Signed-off-by: Tristan Partin <tristan@partin.io>
Acked-by: Robin Jarry <robin@jarry.cc>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
This commit is contained in:
Tristan Partin
2024-05-29 16:46:48 -05:00
committed by Robin Jarry
parent 659069dd1f
commit 0465509eed

View File

@@ -154,6 +154,10 @@ func (w *JMAPWorker) handleFetchMessageHeaders(msg *types.FetchMessageHeaders) e
missing = append(missing, id)
}
if len(missing) == 0 {
return nil
}
var req jmap.Request
req.Invoke(&email.Get{
Account: w.accountId,