Add UserHasBeenDeactivated plugin hook (#20894)

Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Этот коммит содержится в:
Matthew Dorner
2023-08-30 01:55:20 -05:00
коммит произвёл GitHub
родитель 8c8b8b7e79
Коммит 5de1e306de
7 изменённых файлов: 144 добавлений и 14 удалений

Просмотреть файл

@@ -1003,6 +1003,16 @@ func (a *App) UpdateActive(c request.CTX, user *model.User, active bool) (*model
a.sendUpdatedUserEvent(*ruser)
if pluginsEnvironment := a.GetPluginsEnvironment(); pluginsEnvironment != nil && !active && user.DeleteAt != 0 {
a.Srv().Go(func() {
pluginContext := pluginContext(c)
pluginsEnvironment.RunMultiPluginHook(func(hooks plugin.Hooks) bool {
hooks.UserHasBeenDeactivated(pluginContext, user)
return true
}, plugin.UserHasBeenDeactivatedID)
})
}
return ruser, nil
}