mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 17:44:35 +03:00
imapclient: parse fetch attribute "internaldate" as time.Time instead of keeping it as string
similar to the SAVEDATE fetch attribute implemented recently.
This commit is contained in:
@ -688,7 +688,10 @@ func (c *Conn) xmsgatt1() FetchAttr {
|
||||
|
||||
case "INTERNALDATE":
|
||||
c.xspace()
|
||||
return FetchInternalDate(c.xquoted()) // todo: parsed time
|
||||
s := c.xquoted()
|
||||
v, err := time.Parse("_2-Jan-2006 15:04:05 -0700", s)
|
||||
c.xcheckf(err, "parsing internaldate")
|
||||
return FetchInternalDate{v}
|
||||
|
||||
case "SAVEDATE":
|
||||
c.xspace()
|
||||
|
@ -455,7 +455,10 @@ type Address struct {
|
||||
}
|
||||
|
||||
// "INTERNALDATE" fetch response.
|
||||
type FetchInternalDate string // todo: parsed time
|
||||
type FetchInternalDate struct {
|
||||
Date time.Time
|
||||
}
|
||||
|
||||
func (f FetchInternalDate) Attr() string { return "INTERNALDATE" }
|
||||
|
||||
// "SAVEDATE" fetch response. ../rfc/8514:265
|
||||
|
Reference in New Issue
Block a user