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.
|
||||
func fetchFlags(msg *protonmail.Message) []string {
|
||||
var flags []string
|
||||
if msg.IsRead != 0 {
|
||||
if msg.Unread != 1 {
|
||||
flags = append(flags, imap.SeenFlag)
|
||||
}
|
||||
if msg.IsReplied != 0 || msg.IsRepliedAll != 0 {
|
||||
|
|
|
@ -51,7 +51,7 @@ type EventMessage struct {
|
|||
}
|
||||
|
||||
type EventMessageUpdate struct {
|
||||
IsRead *int
|
||||
Unread *int
|
||||
Type *MessageType
|
||||
Time int64
|
||||
IsReplied *int
|
||||
|
@ -97,8 +97,8 @@ func (update *EventMessageUpdate) DiffLabelIDs(current []string) (added, removed
|
|||
|
||||
func (update *EventMessageUpdate) Patch(msg *Message) {
|
||||
msg.Time = update.Time
|
||||
if update.IsRead != nil {
|
||||
msg.IsRead = *update.IsRead
|
||||
if update.Unread != nil {
|
||||
msg.Unread = *update.Unread
|
||||
}
|
||||
if update.Type != nil {
|
||||
msg.Type = *update.Type
|
||||
|
|
|
@ -57,7 +57,7 @@ type Message struct {
|
|||
ID string
|
||||
Order int64
|
||||
Subject string
|
||||
IsRead int
|
||||
Unread int
|
||||
Type MessageType
|
||||
Sender *MessageAddress
|
||||
ReplyTo *MessageAddress
|
||||
|
|
Loading…
Reference in New Issue