From 1ee872578c734956acc7f5e4168638de244c3ce2 Mon Sep 17 00:00:00 2001 From: Jason Simmons <1382389+jasimmons@users.noreply.github.com> Date: Mon, 22 Oct 2018 08:49:50 -0400 Subject: GH-9636 plugins api GetUsersInChannelByStatus (#9645) * adds GetUsersInChannelByStatus to plugin api with generated rpc code. * fixed typo in comment with actual func name * replaced Response model with AppError in output of GetUsersInChannelByStatus * removed etag param from GetUsersInChannelByStatus since it is not used * plugin api for GetUsersInChannelByStatus updated to take the limit, conforming to the app api. * fixed an issue in my own logic on app/plugin integration. * adds GetUsersInChannelByStatus to plugin api with generated rpc code. * fixed typo in comment with actual func name * replaced Response model with AppError in output of GetUsersInChannelByStatus * removed etag param from GetUsersInChannelByStatus since it is not used * plugin api for GetUsersInChannelByStatus updated to take the limit, conforming to the app api. * fixed an issue in my own logic on app/plugin integration. * GetUsersInChannelByStatus changed to more generic GetUsersInChannel which takes a sortBy parameter, allowing for more granular/extensible sorting functionality in the future * GetUsersInChannel accepts sort parameter of 'username' and 'status'. Both values are consts in model pkg. * Documents minimum server version for GetUsersInChannel. * adds GetUsersInChannelByStatus to plugin api with generated rpc code. * fixed typo in comment with actual func name * replaced Response model with AppError in output of GetUsersInChannelByStatus * removed etag param from GetUsersInChannelByStatus since it is not used * plugin api for GetUsersInChannelByStatus updated to take the limit, conforming to the app api. * fixed an issue in my own logic on app/plugin integration. * adds GetUsersInChannelByStatus to plugin api with generated rpc code. * Resolved conflict on rebase * replaced Response model with AppError in output of GetUsersInChannelByStatus * removed etag param from GetUsersInChannelByStatus since it is not used * plugin api for GetUsersInChannelByStatus updated to take the limit, conforming to the app api. * fixed an issue in my own logic on app/plugin integration. * GetUsersInChannelByStatus changed to more generic GetUsersInChannel which takes a sortBy parameter, allowing for more granular/extensible sorting functionality in the future * GetUsersInChannel accepts sort parameter of 'username' and 'status'. Both values are consts in model pkg. * Documents minimum server version for GetUsersInChannel. * replaces GetUsersInChannel from #9608 / #9643 with sortBy functionality --- plugin/api.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'plugin/api.go') diff --git a/plugin/api.go b/plugin/api.go index dc60bb57a..0f481784e 100644 --- a/plugin/api.go +++ b/plugin/api.go @@ -77,6 +77,12 @@ type API interface { // The status parameter can be: "online", "away", "dnd", or "offline". UpdateUserStatus(userId, status string) (*model.Status, *model.AppError) + // GetUsersInChannel returns a page of users in a channel. Page counting starts at 0. + // The sortBy parameter can be: "username" or "status". + // + // Minimum server version: 5.6 + GetUsersInChannel(channelId, sortBy string, page, perPage int) ([]*model.User, *model.AppError) + // GetLDAPUserAttributes will return LDAP attributes for a user. // The attributes parameter should be a list of attributes to pull. // Returns a map with attribute names as keys and the user's attributes as values. @@ -183,11 +189,6 @@ type API interface { // DeleteChannelMember deletes a channel membership for a user. DeleteChannelMember(channelId, userId string) *model.AppError - // GetUsersInChannel gets users in given channel. - // - // Minimum server version: 5.6 - GetUsersInChannel(channelId string, page int, perPage int) ([]*model.User, *model.AppError) - // CreatePost creates a post. CreatePost(post *model.Post) (*model.Post, *model.AppError) -- cgit v1.2.3-1-g7c22