This commit is contained in:
aozhiwei 2024-04-25 08:52:43 +08:00
parent 75e3d5dde8
commit a83364131e
2 changed files with 24 additions and 0 deletions

View File

@ -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
}

View File

@ -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
}