Import/Export backend

This commit is contained in:
Michal Horejsek
2020-06-17 15:29:41 +02:00
parent 49316a935c
commit 1c10cc5065
107 changed files with 2869 additions and 743 deletions

View File

@ -22,6 +22,7 @@ import (
"net/mail"
"strconv"
"strings"
"time"
"github.com/ProtonMail/proton-bridge/pkg/pmapi"
"github.com/cucumber/godog"
@ -63,6 +64,9 @@ func thereIsUserWithMailbox(bddUserID, mailboxName string) error {
if err != nil {
return internalError(err, "getting store of %s", account.Username())
}
if store == nil {
return nil
}
return internalError(store.RebuildMailboxes(), "rebuilding mailboxes")
}
@ -122,6 +126,12 @@ func thereAreMessagesInMailboxesForAddressOfUser(mailboxNames, bddAddressID, bdd
if cell.Value == "true" {
message.LabelIDs = append(message.LabelIDs, "10")
}
case "time": //nolint[goconst]
date, err := time.Parse(timeFormat, cell.Value)
if err != nil {
return internalError(err, "parsing time")
}
message.Time = date.Unix()
default:
return fmt.Errorf("unexpected column name: %s", head[n].Value)
}