MM-14882 Filter out inactive users from out of channel/group mentions (#10685)
* Add FilterByActive to UserSlice type * Filter out inactive users from out of channel/group mentions
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
9c9c00b020
Коммит
b24013d54c
@@ -137,6 +137,19 @@ func (u UserSlice) IDs() []string {
|
||||
return ids
|
||||
}
|
||||
|
||||
func (u UserSlice) FilterByActive(active bool) UserSlice {
|
||||
var matches []*User
|
||||
|
||||
for _, user := range u {
|
||||
if user.DeleteAt == 0 && active {
|
||||
matches = append(matches, user)
|
||||
} else if user.DeleteAt != 0 && !active {
|
||||
matches = append(matches, user)
|
||||
}
|
||||
}
|
||||
return UserSlice(matches)
|
||||
}
|
||||
|
||||
func (u UserSlice) FilterByID(ids []string) UserSlice {
|
||||
var matches []*User
|
||||
for _, user := range u {
|
||||
|
||||
Ссылка в новой задаче
Block a user