mirror of
https://git.sr.ht/~rjarry/aerc
synced 2026-03-02 18:23:33 +01:00
Fetch an email's entire thread in the JMAP backend. Changelog-added: Fetch entire threads in the JMAP backend. Signed-off-by: Tristan Partin <tristan@partin.io> Tested-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
44 lines
907 B
Go
44 lines
907 B
Go
package cache
|
|
|
|
func (c *JMAPCache) GetMailboxState() (string, error) {
|
|
buf, err := c.get(mailboxStateKey)
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
return string(buf), nil
|
|
}
|
|
|
|
func (c *JMAPCache) PutMailboxState(state string) error {
|
|
return c.put(mailboxStateKey, []byte(state))
|
|
}
|
|
|
|
func (c *JMAPCache) GetEmailState() (string, error) {
|
|
buf, err := c.get(emailStateKey)
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
return string(buf), nil
|
|
}
|
|
|
|
func (c *JMAPCache) PutEmailState(state string) error {
|
|
return c.put(emailStateKey, []byte(state))
|
|
}
|
|
|
|
func (c *JMAPCache) GetThreadState() (string, error) {
|
|
buf, err := c.get(threadStateKey)
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
return string(buf), nil
|
|
}
|
|
|
|
func (c *JMAPCache) PutThreadState(state string) error {
|
|
return c.put(threadStateKey, []byte(state))
|
|
}
|
|
|
|
const (
|
|
mailboxStateKey = "state/mailbox"
|
|
emailStateKey = "state/email"
|
|
threadStateKey = "state/thread"
|
|
)
|