Gh 9610 add plugin api for update user active method (#9854)

* wip

* wip

* After running make plugin-mocks

* Add
TestUpdateUserActive and run make pluginapi

* Adding plugin_api_test.go

* Better formatting of code using gofmt

* Fix tests and run make pluginapi

* Specify the minimum server version on the comments

* Include more tests as per the CR

* Fix tests

* Checking err.Id intsead of err & Removed comments and trailing spaces

* wip

* Fix tests as per CR and spaces

* Make changes to tests as per CR
Этот коммит содержится в:
akhilanandbv003
2018-12-12 09:18:41 -06:00
коммит произвёл Jesse Hallam
родитель febc5115fd
Коммит 11059b0251
7 изменённых файлов: 112 добавлений и 0 удалений

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

@@ -1145,6 +1145,35 @@ func (s *apiRPCServer) UpdateUserStatus(args *Z_UpdateUserStatusArgs, returns *Z
return nil
}
type Z_UpdateUserActiveArgs struct {
A string
B bool
}
type Z_UpdateUserActiveReturns struct {
A *model.AppError
}
func (g *apiRPCClient) UpdateUserActive(userId string, active bool) *model.AppError {
_args := &Z_UpdateUserActiveArgs{userId, active}
_returns := &Z_UpdateUserActiveReturns{}
if err := g.client.Call("Plugin.UpdateUserActive", _args, _returns); err != nil {
log.Printf("RPC call to UpdateUserActive API failed: %s", err.Error())
}
return _returns.A
}
func (s *apiRPCServer) UpdateUserActive(args *Z_UpdateUserActiveArgs, returns *Z_UpdateUserActiveReturns) error {
if hook, ok := s.impl.(interface {
UpdateUserActive(userId string, active bool) *model.AppError
}); ok {
returns.A = hook.UpdateUserActive(args.A, args.B)
} else {
return encodableError(fmt.Errorf("API UpdateUserActive called but not implemented."))
}
return nil
}
type Z_GetUsersInChannelArgs struct {
A string
B string