修复复制邮件后的默认邮箱归属判断
Some checks are pending
Security Checks / security (push) Waiting to run

This commit is contained in:
smail 2026-09-06 07:04:44 +08:00
parent c4777dae85
commit bdbafd936b

View File

@ -781,7 +781,11 @@ func Move2DefaultBox(ctx *context.Context, mailIDs []int, groupName string) erro
rollbackGroupTransaction(session)
return fmt.Errorf("load default mailbox move ownership: %w", err)
}
if len(relations) != len(uniqueIDs) {
ownedEmailIDs := make(map[int]struct{}, len(relations))
for _, relation := range relations {
ownedEmailIDs[relation.EmailID] = struct{}{}
}
if len(ownedEmailIDs) != len(uniqueIDs) {
rollbackGroupTransaction(session)
return errors2.New("one or more messages are not owned by the user")
}