коммит произвёл
Saturnino Abril
родитель
dc24e91fae
Коммит
e0f5ee97b4
@@ -306,6 +306,10 @@ func (api *PluginAPI) GetChannelMembers(channelId string, page, perPage int) (*m
|
|||||||
return api.app.GetChannelMembersPage(channelId, page, perPage)
|
return api.app.GetChannelMembersPage(channelId, page, perPage)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (api *PluginAPI) GetChannelMembersByIds(channelId string, userIds []string) (*model.ChannelMembers, *model.AppError) {
|
||||||
|
return api.app.GetChannelMembersByIds(channelId, userIds)
|
||||||
|
}
|
||||||
|
|
||||||
func (api *PluginAPI) UpdateChannelMemberRoles(channelId, userId, newRoles string) (*model.ChannelMember, *model.AppError) {
|
func (api *PluginAPI) UpdateChannelMemberRoles(channelId, userId, newRoles string) (*model.ChannelMember, *model.AppError) {
|
||||||
return api.app.UpdateChannelMemberRoles(channelId, userId, newRoles)
|
return api.app.UpdateChannelMemberRoles(channelId, userId, newRoles)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -185,6 +185,11 @@ type API interface {
|
|||||||
// Minimum server version: 5.6
|
// Minimum server version: 5.6
|
||||||
GetChannelMembers(channelId string, page, perPage int) (*model.ChannelMembers, *model.AppError)
|
GetChannelMembers(channelId string, page, perPage int) (*model.ChannelMembers, *model.AppError)
|
||||||
|
|
||||||
|
// GetChannelMembersByIds gets a channel membership for a particular User
|
||||||
|
//
|
||||||
|
// Minimum server version: 5.6
|
||||||
|
GetChannelMembersByIds(channelId string, userIds []string) (*model.ChannelMembers, *model.AppError)
|
||||||
|
|
||||||
// UpdateChannelMemberRoles updates a user's roles for a channel.
|
// UpdateChannelMemberRoles updates a user's roles for a channel.
|
||||||
UpdateChannelMemberRoles(channelId, userId, newRoles string) (*model.ChannelMember, *model.AppError)
|
UpdateChannelMemberRoles(channelId, userId, newRoles string) (*model.ChannelMember, *model.AppError)
|
||||||
|
|
||||||
|
|||||||
@@ -1898,6 +1898,36 @@ func (s *apiRPCServer) GetChannelMembers(args *Z_GetChannelMembersArgs, returns
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Z_GetChannelMembersByIdsArgs struct {
|
||||||
|
A string
|
||||||
|
B []string
|
||||||
|
}
|
||||||
|
|
||||||
|
type Z_GetChannelMembersByIdsReturns struct {
|
||||||
|
A *model.ChannelMembers
|
||||||
|
B *model.AppError
|
||||||
|
}
|
||||||
|
|
||||||
|
func (g *apiRPCClient) GetChannelMembersByIds(channelId string, userIds []string) (*model.ChannelMembers, *model.AppError) {
|
||||||
|
_args := &Z_GetChannelMembersByIdsArgs{channelId, userIds}
|
||||||
|
_returns := &Z_GetChannelMembersByIdsReturns{}
|
||||||
|
if err := g.client.Call("Plugin.GetChannelMembersByIds", _args, _returns); err != nil {
|
||||||
|
log.Printf("RPC call to GetChannelMembersByIds API failed: %s", err.Error())
|
||||||
|
}
|
||||||
|
return _returns.A, _returns.B
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *apiRPCServer) GetChannelMembersByIds(args *Z_GetChannelMembersByIdsArgs, returns *Z_GetChannelMembersByIdsReturns) error {
|
||||||
|
if hook, ok := s.impl.(interface {
|
||||||
|
GetChannelMembersByIds(channelId string, userIds []string) (*model.ChannelMembers, *model.AppError)
|
||||||
|
}); ok {
|
||||||
|
returns.A, returns.B = hook.GetChannelMembersByIds(args.A, args.B)
|
||||||
|
} else {
|
||||||
|
return encodableError(fmt.Errorf("API GetChannelMembersByIds called but not implemented."))
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
type Z_UpdateChannelMemberRolesArgs struct {
|
type Z_UpdateChannelMemberRolesArgs struct {
|
||||||
A string
|
A string
|
||||||
B string
|
B string
|
||||||
|
|||||||
@@ -458,22 +458,22 @@ func (_m *API) GetChannelMembers(channelId string, page int, perPage int) (*mode
|
|||||||
return r0, r1
|
return r0, r1
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetChannelsForTeamForUser provides a mock function with given fields: teamId, userId, includeDeleted
|
// GetChannelMembersByIds provides a mock function with given fields: channelId, userIds
|
||||||
func (_m *API) GetChannelsForTeamForUser(teamId string, userId string, includeDeleted bool) (*model.ChannelList, *model.AppError) {
|
func (_m *API) GetChannelMembersByIds(channelId string, userIds []string) (*model.ChannelMembers, *model.AppError) {
|
||||||
ret := _m.Called(teamId, userId, includeDeleted)
|
ret := _m.Called(channelId, userIds)
|
||||||
|
|
||||||
var r0 *model.ChannelList
|
var r0 *model.ChannelMembers
|
||||||
if rf, ok := ret.Get(0).(func(string, string, bool) *model.ChannelList); ok {
|
if rf, ok := ret.Get(0).(func(string, []string) *model.ChannelMembers); ok {
|
||||||
r0 = rf(teamId, userId, includeDeleted)
|
r0 = rf(channelId, userIds)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(0) != nil {
|
if ret.Get(0) != nil {
|
||||||
r0 = ret.Get(0).(*model.ChannelList)
|
r0 = ret.Get(0).(*model.ChannelMembers)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var r1 *model.AppError
|
var r1 *model.AppError
|
||||||
if rf, ok := ret.Get(1).(func(string, string, bool) *model.AppError); ok {
|
if rf, ok := ret.Get(1).(func(string, []string) *model.AppError); ok {
|
||||||
r1 = rf(teamId, userId, includeDeleted)
|
r1 = rf(channelId, userIds)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(1) != nil {
|
if ret.Get(1) != nil {
|
||||||
r1 = ret.Get(1).(*model.AppError)
|
r1 = ret.Get(1).(*model.AppError)
|
||||||
@@ -508,6 +508,31 @@ func (_m *API) GetChannelStats(channelId string) (*model.ChannelStats, *model.Ap
|
|||||||
return r0, r1
|
return r0, r1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetChannelsForTeamForUser provides a mock function with given fields: teamId, userId, includeDeleted
|
||||||
|
func (_m *API) GetChannelsForTeamForUser(teamId string, userId string, includeDeleted bool) (*model.ChannelList, *model.AppError) {
|
||||||
|
ret := _m.Called(teamId, userId, includeDeleted)
|
||||||
|
|
||||||
|
var r0 *model.ChannelList
|
||||||
|
if rf, ok := ret.Get(0).(func(string, string, bool) *model.ChannelList); ok {
|
||||||
|
r0 = rf(teamId, userId, includeDeleted)
|
||||||
|
} else {
|
||||||
|
if ret.Get(0) != nil {
|
||||||
|
r0 = ret.Get(0).(*model.ChannelList)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var r1 *model.AppError
|
||||||
|
if rf, ok := ret.Get(1).(func(string, string, bool) *model.AppError); ok {
|
||||||
|
r1 = rf(teamId, userId, includeDeleted)
|
||||||
|
} else {
|
||||||
|
if ret.Get(1) != nil {
|
||||||
|
r1 = ret.Get(1).(*model.AppError)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return r0, r1
|
||||||
|
}
|
||||||
|
|
||||||
// GetConfig provides a mock function with given fields:
|
// GetConfig provides a mock function with given fields:
|
||||||
func (_m *API) GetConfig() *model.Config {
|
func (_m *API) GetConfig() *model.Config {
|
||||||
ret := _m.Called()
|
ret := _m.Called()
|
||||||
@@ -549,6 +574,31 @@ func (_m *API) GetDirectChannel(userId1 string, userId2 string) (*model.Channel,
|
|||||||
return r0, r1
|
return r0, r1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetEmoji provides a mock function with given fields: emojiId
|
||||||
|
func (_m *API) GetEmoji(emojiId string) (*model.Emoji, *model.AppError) {
|
||||||
|
ret := _m.Called(emojiId)
|
||||||
|
|
||||||
|
var r0 *model.Emoji
|
||||||
|
if rf, ok := ret.Get(0).(func(string) *model.Emoji); ok {
|
||||||
|
r0 = rf(emojiId)
|
||||||
|
} else {
|
||||||
|
if ret.Get(0) != nil {
|
||||||
|
r0 = ret.Get(0).(*model.Emoji)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var r1 *model.AppError
|
||||||
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
||||||
|
r1 = rf(emojiId)
|
||||||
|
} else {
|
||||||
|
if ret.Get(1) != nil {
|
||||||
|
r1 = ret.Get(1).(*model.AppError)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return r0, r1
|
||||||
|
}
|
||||||
|
|
||||||
// GetEmojiByName provides a mock function with given fields: name
|
// GetEmojiByName provides a mock function with given fields: name
|
||||||
func (_m *API) GetEmojiByName(name string) (*model.Emoji, *model.AppError) {
|
func (_m *API) GetEmojiByName(name string) (*model.Emoji, *model.AppError) {
|
||||||
ret := _m.Called(name)
|
ret := _m.Called(name)
|
||||||
@@ -606,31 +656,6 @@ func (_m *API) GetEmojiImage(emojiId string) ([]byte, string, *model.AppError) {
|
|||||||
return r0, r1, r2
|
return r0, r1, r2
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetEmoji provides a mock function with given fields: emojiId
|
|
||||||
func (_m *API) GetEmoji(emojiId string) (*model.Emoji, *model.AppError) {
|
|
||||||
ret := _m.Called(emojiId)
|
|
||||||
|
|
||||||
var r0 *model.Emoji
|
|
||||||
if rf, ok := ret.Get(0).(func(string) *model.Emoji); ok {
|
|
||||||
r0 = rf(emojiId)
|
|
||||||
} else {
|
|
||||||
if ret.Get(0) != nil {
|
|
||||||
r0 = ret.Get(0).(*model.Emoji)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var r1 *model.AppError
|
|
||||||
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
||||||
r1 = rf(emojiId)
|
|
||||||
} else {
|
|
||||||
if ret.Get(1) != nil {
|
|
||||||
r1 = ret.Get(1).(*model.AppError)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return r0, r1
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetFileInfo provides a mock function with given fields: fileId
|
// GetFileInfo provides a mock function with given fields: fileId
|
||||||
func (_m *API) GetFileInfo(fileId string) (*model.FileInfo, *model.AppError) {
|
func (_m *API) GetFileInfo(fileId string) (*model.FileInfo, *model.AppError) {
|
||||||
ret := _m.Called(fileId)
|
ret := _m.Called(fileId)
|
||||||
@@ -1307,7 +1332,6 @@ func (_m *API) GetUsersInChannel(channelId string, sortBy string, page int, perP
|
|||||||
}
|
}
|
||||||
|
|
||||||
var r1 *model.AppError
|
var r1 *model.AppError
|
||||||
|
|
||||||
if rf, ok := ret.Get(1).(func(string, string, int, int) *model.AppError); ok {
|
if rf, ok := ret.Get(1).(func(string, string, int, int) *model.AppError); ok {
|
||||||
r1 = rf(channelId, sortBy, page, perPage)
|
r1 = rf(channelId, sortBy, page, perPage)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user