1
This commit is contained in:
parent
75e3d5dde8
commit
a83364131e
@ -9,3 +9,7 @@ var Inbox = new(inbox)
|
||||
func (this *inbox) Mark(accountId string, mailId int64, nowTime int64) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (this *inbox) Delete(accountId string, mailId int64, nowTime int64) error {
|
||||
return nil
|
||||
}
|
||||
|
@ -76,6 +76,26 @@ func (this *player) GetAttachment(mails []common.Mail) error {
|
||||
func (this *player) DeleteMails(mails []common.Mail) error {
|
||||
this.checkLock()
|
||||
var resultErr error
|
||||
var nowTime int64
|
||||
for _, m := range(mails) {
|
||||
if m.IsValid(this) {
|
||||
mi := this.getInbox(m.GetMailId())
|
||||
if mi == nil {
|
||||
err := model.Inbox.Delete(this.GetAccountId(), m.GetMailId(), nowTime)
|
||||
if err != nil {
|
||||
resultErr = err
|
||||
break
|
||||
}
|
||||
mi = new(inbox)
|
||||
mi.mailId = m.GetMailId()
|
||||
mi.state = constant.INBOX_STATE_DELETED
|
||||
mi.expireTime = m.GetExpireTime()
|
||||
this.inboxHash[mi.mailId] = mi
|
||||
} else if mi.state != constant.INBOX_STATE_DELETED {
|
||||
mi.state = constant.INBOX_STATE_DELETED
|
||||
}
|
||||
}
|
||||
}
|
||||
return resultErr
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user