Merge pull request #38 from apiote/master
PM API: read field in messages name changed to unread
This commit is contained in:
commit
35f64bc7ef
|
@ -99,7 +99,7 @@ func hasLabel(msg *protonmail.Message, labelID string) bool {
|
||||||
// Doesn't support imap.DeletedFlag.
|
// Doesn't support imap.DeletedFlag.
|
||||||
func fetchFlags(msg *protonmail.Message) []string {
|
func fetchFlags(msg *protonmail.Message) []string {
|
||||||
var flags []string
|
var flags []string
|
||||||
if msg.IsRead != 0 {
|
if msg.Unread != 1 {
|
||||||
flags = append(flags, imap.SeenFlag)
|
flags = append(flags, imap.SeenFlag)
|
||||||
}
|
}
|
||||||
if msg.IsReplied != 0 || msg.IsRepliedAll != 0 {
|
if msg.IsReplied != 0 || msg.IsRepliedAll != 0 {
|
||||||
|
|
|
@ -51,7 +51,7 @@ type EventMessage struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type EventMessageUpdate struct {
|
type EventMessageUpdate struct {
|
||||||
IsRead *int
|
Unread *int
|
||||||
Type *MessageType
|
Type *MessageType
|
||||||
Time int64
|
Time int64
|
||||||
IsReplied *int
|
IsReplied *int
|
||||||
|
@ -97,8 +97,8 @@ func (update *EventMessageUpdate) DiffLabelIDs(current []string) (added, removed
|
||||||
|
|
||||||
func (update *EventMessageUpdate) Patch(msg *Message) {
|
func (update *EventMessageUpdate) Patch(msg *Message) {
|
||||||
msg.Time = update.Time
|
msg.Time = update.Time
|
||||||
if update.IsRead != nil {
|
if update.Unread != nil {
|
||||||
msg.IsRead = *update.IsRead
|
msg.Unread = *update.Unread
|
||||||
}
|
}
|
||||||
if update.Type != nil {
|
if update.Type != nil {
|
||||||
msg.Type = *update.Type
|
msg.Type = *update.Type
|
||||||
|
|
|
@ -57,7 +57,7 @@ type Message struct {
|
||||||
ID string
|
ID string
|
||||||
Order int64
|
Order int64
|
||||||
Subject string
|
Subject string
|
||||||
IsRead int
|
Unread int
|
||||||
Type MessageType
|
Type MessageType
|
||||||
Sender *MessageAddress
|
Sender *MessageAddress
|
||||||
ReplyTo *MessageAddress
|
ReplyTo *MessageAddress
|
||||||
|
|
Loading…
Reference in New Issue