mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2026-02-13 20:38:33 +00:00
Tests and final touches
This commit is contained in:
@ -20,7 +20,7 @@ package store
|
||||
import (
|
||||
"net/mail"
|
||||
|
||||
backendMessage "github.com/ProtonMail/proton-bridge/pkg/message"
|
||||
pkgMsg "github.com/ProtonMail/proton-bridge/pkg/message"
|
||||
"github.com/ProtonMail/proton-bridge/pkg/pmapi"
|
||||
bolt "go.etcd.io/bbolt"
|
||||
)
|
||||
@ -121,8 +121,8 @@ func (message *Message) SetContentTypeAndHeader(mimeType string, header mail.Hea
|
||||
return message.store.db.Update(txUpdate)
|
||||
}
|
||||
|
||||
// SetBodyStructure stores serialized body structure in database
|
||||
func (message *Message) SetBodyStructure(bs *backendMessage.BodyStructure) error {
|
||||
// SetBodyStructure stores serialized body structure in database.
|
||||
func (message *Message) SetBodyStructure(bs *pkgMsg.BodyStructure) error {
|
||||
txUpdate := func(tx *bolt.Tx) error {
|
||||
return message.store.txPutBodyStructure(
|
||||
tx.Bucket(bodystructureBucket),
|
||||
@ -132,10 +132,10 @@ func (message *Message) SetBodyStructure(bs *backendMessage.BodyStructure) error
|
||||
return message.store.db.Update(txUpdate)
|
||||
}
|
||||
|
||||
// GetBodyStructure deserialize body structure from database. If body structure
|
||||
// GetBodyStructure deserializes body structure from database. If body structure
|
||||
// is not in database it returns nil error and nil body structure. If error
|
||||
// occurs it returns nil body structure.
|
||||
func (message *Message) GetBodyStructure() (bs *backendMessage.BodyStructure, err error) {
|
||||
func (message *Message) GetBodyStructure() (bs *pkgMsg.BodyStructure, err error) {
|
||||
txRead := func(tx *bolt.Tx) error {
|
||||
bs, err = message.store.txGetBodyStructure(
|
||||
tx.Bucket(bodystructureBucket),
|
||||
|
||||
Reference in New Issue
Block a user