1
This commit is contained in:
parent
2792145d0f
commit
4b546e7709
@ -108,6 +108,24 @@ func (this *mail) fillMailDto(p *common.MailDto) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this* mail) isMailUser(accountId string) bool {
|
||||||
|
{
|
||||||
|
p := this.recipients
|
||||||
|
if p != nil {
|
||||||
|
if _, ok := p.Load(accountId); ok {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
this.traverseUserGroup(
|
||||||
|
func (groupId int64, group *userGroup) bool {
|
||||||
|
return true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func (this *mail) traverseRecipients(cb func(string) bool) {
|
func (this *mail) traverseRecipients(cb func(string) bool) {
|
||||||
p := this.recipients
|
p := this.recipients
|
||||||
if p != nil {
|
if p != nil {
|
||||||
@ -117,11 +135,15 @@ func (this *mail) traverseRecipients(cb func(string) bool) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *mail) traverseUserGroup(cb func(int64) bool) {
|
func (this *mail) traverseUserGroup(cb func(int64, *userGroup) bool) {
|
||||||
p := this.userGroups
|
p := this.userGroups
|
||||||
if p != nil {
|
if p != nil {
|
||||||
p.Range(func (k, v interface{}) bool {
|
p.Range(func (k, v interface{}) bool {
|
||||||
return cb(k.(int64))
|
if v != nil {
|
||||||
|
return cb(k.(int64), v.(*userGroup))
|
||||||
|
} else {
|
||||||
|
return cb(k.(int64), nil)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -234,7 +234,7 @@ func (this *mailMgr) addMail(m *mail) {
|
|||||||
this.wholeMails.Store(m.mailId, m)
|
this.wholeMails.Store(m.mailId, m)
|
||||||
} else if m.isType(constant.MAIL_TYPE_GROUP) {
|
} else if m.isType(constant.MAIL_TYPE_GROUP) {
|
||||||
m.traverseUserGroup(
|
m.traverseUserGroup(
|
||||||
func (int64) bool {
|
func (int64, *userGroup) bool {
|
||||||
this.groupMails.Store(m.mailId, m)
|
this.groupMails.Store(m.mailId, m)
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user