ChannelStore migration Part 3 (#15504)
* Migration finished * Change error var name * Fix imports * Fix tests * Merge with master * Doing some suggestions * More suggestions * Fix i18n Co-authored-by: Mattermod <mattermod@users.noreply.github.com> Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
5353bceaea
Коммит
bb4df5a68e
@@ -341,9 +341,9 @@ func testGetChannelUnread(t *testing.T, ss store.Store) {
|
||||
require.Nil(t, err)
|
||||
|
||||
// Check for Channel 1
|
||||
ch, err := ss.Channel().GetChannelUnread(c1.Id, uid)
|
||||
ch, nErr := ss.Channel().GetChannelUnread(c1.Id, uid)
|
||||
|
||||
require.Nil(t, err, err)
|
||||
require.Nil(t, nErr, nErr)
|
||||
require.Equal(t, c1.Id, ch.ChannelId, "Wrong channel id")
|
||||
require.Equal(t, teamId1, ch.TeamId, "Wrong team id for channel 1")
|
||||
require.NotNil(t, ch.NotifyProps, "wrong props for channel 1")
|
||||
@@ -351,9 +351,9 @@ func testGetChannelUnread(t *testing.T, ss store.Store) {
|
||||
require.EqualValues(t, 10, ch.MsgCount, "wrong MsgCount for channel 1")
|
||||
|
||||
// Check for Channel 2
|
||||
ch2, err := ss.Channel().GetChannelUnread(c2.Id, uid)
|
||||
ch2, nErr := ss.Channel().GetChannelUnread(c2.Id, uid)
|
||||
|
||||
require.Nil(t, err, err)
|
||||
require.Nil(t, nErr, nErr)
|
||||
require.Equal(t, c2.Id, ch2.ChannelId, "Wrong channel id")
|
||||
require.Equal(t, teamId2, ch2.TeamId, "Wrong team id")
|
||||
require.EqualValues(t, 5, ch2.MentionCount, "wrong MentionCount for channel 2")
|
||||
@@ -5117,7 +5117,7 @@ func testChannelStoreSearchInTeam(t *testing.T, ss store.Store, s SqlSupplier) {
|
||||
{"pipe ignored", teamId, "town square |", false, &model.ChannelList{&o9}},
|
||||
}
|
||||
|
||||
for name, search := range map[string]func(teamId string, term string, includeDeleted bool) (*model.ChannelList, *model.AppError){
|
||||
for name, search := range map[string]func(teamId string, term string, includeDeleted bool) (*model.ChannelList, error){
|
||||
"AutocompleteInTeam": ss.Channel().AutocompleteInTeam,
|
||||
"SearchInTeam": ss.Channel().SearchInTeam,
|
||||
} {
|
||||
@@ -5503,10 +5503,10 @@ func testChannelStoreGetMembersByIds(t *testing.T, ss store.Store) {
|
||||
require.Nil(t, err)
|
||||
|
||||
var members *model.ChannelMembers
|
||||
members, err = ss.Channel().GetMembersByIds(m1.ChannelId, []string{m1.UserId})
|
||||
members, nErr = ss.Channel().GetMembersByIds(m1.ChannelId, []string{m1.UserId})
|
||||
require.Nil(t, nErr, nErr)
|
||||
rm1 := (*members)[0]
|
||||
|
||||
require.Nil(t, err, err)
|
||||
require.Equal(t, m1.ChannelId, rm1.ChannelId, "bad team id")
|
||||
require.Equal(t, m1.UserId, rm1.UserId, "bad user id")
|
||||
|
||||
@@ -5514,12 +5514,12 @@ func testChannelStoreGetMembersByIds(t *testing.T, ss store.Store) {
|
||||
_, err = ss.Channel().SaveMember(m2)
|
||||
require.Nil(t, err)
|
||||
|
||||
members, err = ss.Channel().GetMembersByIds(m1.ChannelId, []string{m1.UserId, m2.UserId, model.NewId()})
|
||||
require.Nil(t, err, err)
|
||||
members, nErr = ss.Channel().GetMembersByIds(m1.ChannelId, []string{m1.UserId, m2.UserId, model.NewId()})
|
||||
require.Nil(t, nErr, nErr)
|
||||
require.Len(t, *members, 2, "return wrong number of results")
|
||||
|
||||
_, err = ss.Channel().GetMembersByIds(m1.ChannelId, []string{})
|
||||
require.NotNil(t, err, "empty user ids - should have failed")
|
||||
_, nErr = ss.Channel().GetMembersByIds(m1.ChannelId, []string{})
|
||||
require.NotNil(t, nErr, "empty user ids - should have failed")
|
||||
}
|
||||
|
||||
func testChannelStoreSearchGroupChannels(t *testing.T, ss store.Store) {
|
||||
@@ -5721,16 +5721,16 @@ func testChannelStoreAnalyticsDeletedTypeCount(t *testing.T, ss store.Store) {
|
||||
}()
|
||||
|
||||
var openStartCount int64
|
||||
openStartCount, err = ss.Channel().AnalyticsDeletedTypeCount("", "O")
|
||||
require.Nil(t, err, err)
|
||||
openStartCount, nErr = ss.Channel().AnalyticsDeletedTypeCount("", "O")
|
||||
require.Nil(t, nErr, nErr)
|
||||
|
||||
var privateStartCount int64
|
||||
privateStartCount, err = ss.Channel().AnalyticsDeletedTypeCount("", "P")
|
||||
require.Nil(t, err, err)
|
||||
privateStartCount, nErr = ss.Channel().AnalyticsDeletedTypeCount("", "P")
|
||||
require.Nil(t, nErr, nErr)
|
||||
|
||||
var directStartCount int64
|
||||
directStartCount, err = ss.Channel().AnalyticsDeletedTypeCount("", "D")
|
||||
require.Nil(t, err, err)
|
||||
directStartCount, nErr = ss.Channel().AnalyticsDeletedTypeCount("", "D")
|
||||
require.Nil(t, nErr, nErr)
|
||||
|
||||
nErr = ss.Channel().Delete(o1.Id, model.GetMillis())
|
||||
require.Nil(t, nErr, "channel should have been deleted")
|
||||
@@ -5743,16 +5743,16 @@ func testChannelStoreAnalyticsDeletedTypeCount(t *testing.T, ss store.Store) {
|
||||
|
||||
var count int64
|
||||
|
||||
count, err = ss.Channel().AnalyticsDeletedTypeCount("", "O")
|
||||
require.Nil(t, err, err)
|
||||
count, nErr = ss.Channel().AnalyticsDeletedTypeCount("", "O")
|
||||
require.Nil(t, err, nErr)
|
||||
assert.Equal(t, openStartCount+2, count, "Wrong open channel deleted count.")
|
||||
|
||||
count, err = ss.Channel().AnalyticsDeletedTypeCount("", "P")
|
||||
require.Nil(t, err, err)
|
||||
count, nErr = ss.Channel().AnalyticsDeletedTypeCount("", "P")
|
||||
require.Nil(t, nErr, nErr)
|
||||
assert.Equal(t, privateStartCount+1, count, "Wrong private channel deleted count.")
|
||||
|
||||
count, err = ss.Channel().AnalyticsDeletedTypeCount("", "D")
|
||||
require.Nil(t, err, err)
|
||||
count, nErr = ss.Channel().AnalyticsDeletedTypeCount("", "D")
|
||||
require.Nil(t, nErr, nErr)
|
||||
assert.Equal(t, directStartCount+1, count, "Wrong direct channel deleted count.")
|
||||
}
|
||||
|
||||
@@ -6538,8 +6538,8 @@ func testChannelStoreExportAllDirectChannels(t *testing.T, ss store.Store, s Sql
|
||||
|
||||
ss.Channel().SaveDirectChannel(&o1, &m1, &m2)
|
||||
|
||||
d1, err := ss.Channel().GetAllDirectChannelsForExportAfter(10000, strings.Repeat("0", 26))
|
||||
assert.Nil(t, err)
|
||||
d1, nErr := ss.Channel().GetAllDirectChannelsForExportAfter(10000, strings.Repeat("0", 26))
|
||||
assert.Nil(t, nErr)
|
||||
|
||||
assert.Len(t, d1, 2)
|
||||
assert.ElementsMatch(t, []string{o1.DisplayName, o2.DisplayName}, []string{d1[0].DisplayName, d1[1].DisplayName})
|
||||
@@ -6601,8 +6601,8 @@ func testChannelStoreExportAllDirectChannelsExcludePrivateAndPublic(t *testing.T
|
||||
|
||||
ss.Channel().SaveDirectChannel(&o1, &m1, &m2)
|
||||
|
||||
d1, err := ss.Channel().GetAllDirectChannelsForExportAfter(10000, strings.Repeat("0", 26))
|
||||
assert.Nil(t, err)
|
||||
d1, nErr := ss.Channel().GetAllDirectChannelsForExportAfter(10000, strings.Repeat("0", 26))
|
||||
assert.Nil(t, nErr)
|
||||
assert.Len(t, d1, 1)
|
||||
assert.Equal(t, o1.DisplayName, d1[0].DisplayName)
|
||||
|
||||
@@ -6651,8 +6651,8 @@ func testChannelStoreExportAllDirectChannelsDeletedChannel(t *testing.T, ss stor
|
||||
nErr = ss.Channel().SetDeleteAt(o1.Id, 1, 1)
|
||||
require.Nil(t, nErr, "channel should have been deleted")
|
||||
|
||||
d1, err := ss.Channel().GetAllDirectChannelsForExportAfter(10000, strings.Repeat("0", 26))
|
||||
assert.Nil(t, err)
|
||||
d1, nErr := ss.Channel().GetAllDirectChannelsForExportAfter(10000, strings.Repeat("0", 26))
|
||||
assert.Nil(t, nErr)
|
||||
|
||||
assert.Equal(t, 0, len(d1))
|
||||
|
||||
|
||||
@@ -144,8 +144,8 @@ func testCreateInitialSidebarCategories(t *testing.T, ss store.Store) {
|
||||
require.Nil(t, nErr)
|
||||
|
||||
// Get and check the categories for channels
|
||||
categories, err := ss.Channel().GetSidebarCategories(userId, teamId)
|
||||
require.Nil(t, err)
|
||||
categories, nErr := ss.Channel().GetSidebarCategories(userId, teamId)
|
||||
require.Nil(t, nErr)
|
||||
require.Len(t, categories.Categories, 3)
|
||||
assert.Equal(t, model.SidebarCategoryFavorites, categories.Categories[0].Type)
|
||||
assert.Equal(t, []string{channel1.Id}, categories.Categories[0].Channels)
|
||||
@@ -207,8 +207,8 @@ func testCreateInitialSidebarCategories(t *testing.T, ss store.Store) {
|
||||
require.Nil(t, nErr)
|
||||
|
||||
// Get and check the categories for channels
|
||||
categories, err := ss.Channel().GetSidebarCategories(userId, teamId)
|
||||
require.Nil(t, err)
|
||||
categories, nErr := ss.Channel().GetSidebarCategories(userId, teamId)
|
||||
require.Nil(t, nErr)
|
||||
require.Len(t, categories.Categories, 3)
|
||||
assert.Equal(t, model.SidebarCategoryFavorites, categories.Categories[0].Type)
|
||||
assert.Equal(t, []string{channel2.Id, channel1.Id}, categories.Categories[0].Channels)
|
||||
@@ -312,8 +312,8 @@ func testCreateInitialSidebarCategories(t *testing.T, ss store.Store) {
|
||||
require.Nil(t, nErr)
|
||||
|
||||
// Get and check the categories for channels
|
||||
categories, err := ss.Channel().GetSidebarCategories(userId, teamId)
|
||||
require.Nil(t, err)
|
||||
categories, nErr := ss.Channel().GetSidebarCategories(userId, teamId)
|
||||
require.Nil(t, nErr)
|
||||
require.Len(t, categories.Categories, 3)
|
||||
assert.Equal(t, model.SidebarCategoryFavorites, categories.Categories[0].Type)
|
||||
assert.Equal(t, []string{}, categories.Categories[0].Channels)
|
||||
@@ -1370,8 +1370,8 @@ func testUpdateSidebarCategories(t *testing.T, ss store.Store, s SqlSupplier) {
|
||||
require.Nil(t, nErr)
|
||||
|
||||
// And some categories
|
||||
initialCategories, err := ss.Channel().GetSidebarCategories(userId, teamId)
|
||||
require.Nil(t, err)
|
||||
initialCategories, nErr := ss.Channel().GetSidebarCategories(userId, teamId)
|
||||
require.Nil(t, nErr)
|
||||
|
||||
channelsCategory := initialCategories.Categories[1]
|
||||
dmsCategory := initialCategories.Categories[2]
|
||||
@@ -1391,8 +1391,8 @@ func testUpdateSidebarCategories(t *testing.T, ss store.Store, s SqlSupplier) {
|
||||
},
|
||||
}
|
||||
|
||||
updatedCategories, err := ss.Channel().UpdateSidebarCategories(userId, teamId, categoriesToUpdate)
|
||||
assert.Nil(t, err)
|
||||
updatedCategories, nErr := ss.Channel().UpdateSidebarCategories(userId, teamId, categoriesToUpdate)
|
||||
assert.Nil(t, nErr)
|
||||
|
||||
// The channels should still exist in the category because they would otherwise be orphaned
|
||||
assert.Equal(t, []string{channel.Id}, updatedCategories[0].Channels)
|
||||
@@ -1510,17 +1510,17 @@ func testUpdateSidebarCategories(t *testing.T, ss store.Store, s SqlSupplier) {
|
||||
nErr = ss.Channel().CreateInitialSidebarCategories(userId, teamId)
|
||||
require.Nil(t, nErr)
|
||||
|
||||
initialCategories, err := ss.Channel().GetSidebarCategories(userId, teamId)
|
||||
require.Nil(t, err)
|
||||
initialCategories, nErr := ss.Channel().GetSidebarCategories(userId, teamId)
|
||||
require.Nil(t, nErr)
|
||||
|
||||
channelsCategory := initialCategories.Categories[1]
|
||||
require.Equal(t, []string{channel.Id}, channelsCategory.Channels)
|
||||
|
||||
customCategory, err := ss.Channel().CreateSidebarCategory(userId, teamId, &model.SidebarCategoryWithChannels{})
|
||||
require.Nil(t, err)
|
||||
customCategory, nErr := ss.Channel().CreateSidebarCategory(userId, teamId, &model.SidebarCategoryWithChannels{})
|
||||
require.Nil(t, nErr)
|
||||
|
||||
// Move the channel one way
|
||||
updatedCategories, err := ss.Channel().UpdateSidebarCategories(userId, teamId, []*model.SidebarCategoryWithChannels{
|
||||
updatedCategories, nErr := ss.Channel().UpdateSidebarCategories(userId, teamId, []*model.SidebarCategoryWithChannels{
|
||||
{
|
||||
SidebarCategory: channelsCategory.SidebarCategory,
|
||||
Channels: []string{},
|
||||
@@ -1530,13 +1530,13 @@ func testUpdateSidebarCategories(t *testing.T, ss store.Store, s SqlSupplier) {
|
||||
Channels: []string{channel.Id},
|
||||
},
|
||||
})
|
||||
assert.Nil(t, err)
|
||||
assert.Nil(t, nErr)
|
||||
|
||||
assert.Equal(t, []string{}, updatedCategories[0].Channels)
|
||||
assert.Equal(t, []string{channel.Id}, updatedCategories[1].Channels)
|
||||
|
||||
// And then the other
|
||||
updatedCategories, err = ss.Channel().UpdateSidebarCategories(userId, teamId, []*model.SidebarCategoryWithChannels{
|
||||
updatedCategories, nErr = ss.Channel().UpdateSidebarCategories(userId, teamId, []*model.SidebarCategoryWithChannels{
|
||||
{
|
||||
SidebarCategory: channelsCategory.SidebarCategory,
|
||||
Channels: []string{channel.Id},
|
||||
@@ -1546,7 +1546,7 @@ func testUpdateSidebarCategories(t *testing.T, ss store.Store, s SqlSupplier) {
|
||||
Channels: []string{},
|
||||
},
|
||||
})
|
||||
assert.Nil(t, err)
|
||||
assert.Nil(t, nErr)
|
||||
assert.Equal(t, []string{channel.Id}, updatedCategories[0].Channels)
|
||||
assert.Equal(t, []string{}, updatedCategories[1].Channels)
|
||||
})
|
||||
|
||||
@@ -16,7 +16,7 @@ type ChannelStore struct {
|
||||
}
|
||||
|
||||
// AnalyticsDeletedTypeCount provides a mock function with given fields: teamId, channelType
|
||||
func (_m *ChannelStore) AnalyticsDeletedTypeCount(teamId string, channelType string) (int64, *model.AppError) {
|
||||
func (_m *ChannelStore) AnalyticsDeletedTypeCount(teamId string, channelType string) (int64, error) {
|
||||
ret := _m.Called(teamId, channelType)
|
||||
|
||||
var r0 int64
|
||||
@@ -26,13 +26,11 @@ func (_m *ChannelStore) AnalyticsDeletedTypeCount(teamId string, channelType str
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(teamId, channelType)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
@@ -60,7 +58,7 @@ func (_m *ChannelStore) AnalyticsTypeCount(teamId string, channelType string) (i
|
||||
}
|
||||
|
||||
// AutocompleteInTeam provides a mock function with given fields: teamId, term, includeDeleted
|
||||
func (_m *ChannelStore) AutocompleteInTeam(teamId string, term string, includeDeleted bool) (*model.ChannelList, *model.AppError) {
|
||||
func (_m *ChannelStore) AutocompleteInTeam(teamId string, term string, includeDeleted bool) (*model.ChannelList, error) {
|
||||
ret := _m.Called(teamId, term, includeDeleted)
|
||||
|
||||
var r0 *model.ChannelList
|
||||
@@ -72,20 +70,18 @@ func (_m *ChannelStore) AutocompleteInTeam(teamId string, term string, includeDe
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, string, bool) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string, bool) error); ok {
|
||||
r1 = rf(teamId, term, includeDeleted)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// AutocompleteInTeamForSearch provides a mock function with given fields: teamId, userId, term, includeDeleted
|
||||
func (_m *ChannelStore) AutocompleteInTeamForSearch(teamId string, userId string, term string, includeDeleted bool) (*model.ChannelList, *model.AppError) {
|
||||
func (_m *ChannelStore) AutocompleteInTeamForSearch(teamId string, userId string, term string, includeDeleted bool) (*model.ChannelList, error) {
|
||||
ret := _m.Called(teamId, userId, term, includeDeleted)
|
||||
|
||||
var r0 *model.ChannelList
|
||||
@@ -97,29 +93,25 @@ func (_m *ChannelStore) AutocompleteInTeamForSearch(teamId string, userId string
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, string, string, bool) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string, string, bool) error); ok {
|
||||
r1 = rf(teamId, userId, term, includeDeleted)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ClearAllCustomRoleAssignments provides a mock function with given fields:
|
||||
func (_m *ChannelStore) ClearAllCustomRoleAssignments() *model.AppError {
|
||||
func (_m *ChannelStore) ClearAllCustomRoleAssignments() error {
|
||||
ret := _m.Called()
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func() *model.AppError); ok {
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func() error); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AppError)
|
||||
}
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
@@ -203,7 +195,7 @@ func (_m *ChannelStore) CreateInitialSidebarCategories(userId string, teamId str
|
||||
}
|
||||
|
||||
// CreateSidebarCategory provides a mock function with given fields: userId, teamId, newCategory
|
||||
func (_m *ChannelStore) CreateSidebarCategory(userId string, teamId string, newCategory *model.SidebarCategoryWithChannels) (*model.SidebarCategoryWithChannels, *model.AppError) {
|
||||
func (_m *ChannelStore) CreateSidebarCategory(userId string, teamId string, newCategory *model.SidebarCategoryWithChannels) (*model.SidebarCategoryWithChannels, error) {
|
||||
ret := _m.Called(userId, teamId, newCategory)
|
||||
|
||||
var r0 *model.SidebarCategoryWithChannels
|
||||
@@ -215,13 +207,11 @@ func (_m *ChannelStore) CreateSidebarCategory(userId string, teamId string, newC
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, string, *model.SidebarCategoryWithChannels) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string, *model.SidebarCategoryWithChannels) error); ok {
|
||||
r1 = rf(userId, teamId, newCategory)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
@@ -242,16 +232,14 @@ func (_m *ChannelStore) Delete(channelId string, time int64) error {
|
||||
}
|
||||
|
||||
// DeleteSidebarCategory provides a mock function with given fields: categoryId
|
||||
func (_m *ChannelStore) DeleteSidebarCategory(categoryId string) *model.AppError {
|
||||
func (_m *ChannelStore) DeleteSidebarCategory(categoryId string) error {
|
||||
ret := _m.Called(categoryId)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(categoryId)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AppError)
|
||||
}
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
@@ -408,7 +396,7 @@ func (_m *ChannelStore) GetAllChannelsCount(opts store.ChannelSearchOpts) (int64
|
||||
}
|
||||
|
||||
// GetAllChannelsForExportAfter provides a mock function with given fields: limit, afterId
|
||||
func (_m *ChannelStore) GetAllChannelsForExportAfter(limit int, afterId string) ([]*model.ChannelForExport, *model.AppError) {
|
||||
func (_m *ChannelStore) GetAllChannelsForExportAfter(limit int, afterId string) ([]*model.ChannelForExport, error) {
|
||||
ret := _m.Called(limit, afterId)
|
||||
|
||||
var r0 []*model.ChannelForExport
|
||||
@@ -420,20 +408,18 @@ func (_m *ChannelStore) GetAllChannelsForExportAfter(limit int, afterId string)
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(int, string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(int, string) error); ok {
|
||||
r1 = rf(limit, afterId)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAllDirectChannelsForExportAfter provides a mock function with given fields: limit, afterId
|
||||
func (_m *ChannelStore) GetAllDirectChannelsForExportAfter(limit int, afterId string) ([]*model.DirectChannelForExport, *model.AppError) {
|
||||
func (_m *ChannelStore) GetAllDirectChannelsForExportAfter(limit int, afterId string) ([]*model.DirectChannelForExport, error) {
|
||||
ret := _m.Called(limit, afterId)
|
||||
|
||||
var r0 []*model.DirectChannelForExport
|
||||
@@ -445,13 +431,11 @@ func (_m *ChannelStore) GetAllDirectChannelsForExportAfter(limit int, afterId st
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(int, string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(int, string) error); ok {
|
||||
r1 = rf(limit, afterId)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
@@ -550,7 +534,7 @@ func (_m *ChannelStore) GetChannelCounts(teamId string, userId string) (*model.C
|
||||
}
|
||||
|
||||
// GetChannelMembersForExport provides a mock function with given fields: userId, teamId
|
||||
func (_m *ChannelStore) GetChannelMembersForExport(userId string, teamId string) ([]*model.ChannelMemberForExport, *model.AppError) {
|
||||
func (_m *ChannelStore) GetChannelMembersForExport(userId string, teamId string) ([]*model.ChannelMemberForExport, error) {
|
||||
ret := _m.Called(userId, teamId)
|
||||
|
||||
var r0 []*model.ChannelMemberForExport
|
||||
@@ -562,13 +546,11 @@ func (_m *ChannelStore) GetChannelMembersForExport(userId string, teamId string)
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(userId, teamId)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
@@ -598,7 +580,7 @@ func (_m *ChannelStore) GetChannelMembersTimezones(channelId string) ([]model.St
|
||||
}
|
||||
|
||||
// GetChannelUnread provides a mock function with given fields: channelId, userId
|
||||
func (_m *ChannelStore) GetChannelUnread(channelId string, userId string) (*model.ChannelUnread, *model.AppError) {
|
||||
func (_m *ChannelStore) GetChannelUnread(channelId string, userId string) (*model.ChannelUnread, error) {
|
||||
ret := _m.Called(channelId, userId)
|
||||
|
||||
var r0 *model.ChannelUnread
|
||||
@@ -610,13 +592,11 @@ func (_m *ChannelStore) GetChannelUnread(channelId string, userId string) (*mode
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(channelId, userId)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
@@ -646,7 +626,7 @@ func (_m *ChannelStore) GetChannels(teamId string, userId string, includeDeleted
|
||||
}
|
||||
|
||||
// GetChannelsBatchForIndexing provides a mock function with given fields: startTime, endTime, limit
|
||||
func (_m *ChannelStore) GetChannelsBatchForIndexing(startTime int64, endTime int64, limit int) ([]*model.Channel, *model.AppError) {
|
||||
func (_m *ChannelStore) GetChannelsBatchForIndexing(startTime int64, endTime int64, limit int) ([]*model.Channel, error) {
|
||||
ret := _m.Called(startTime, endTime, limit)
|
||||
|
||||
var r0 []*model.Channel
|
||||
@@ -658,13 +638,11 @@ func (_m *ChannelStore) GetChannelsBatchForIndexing(startTime int64, endTime int
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(int64, int64, int) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(int64, int64, int) error); ok {
|
||||
r1 = rf(startTime, endTime, limit)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
@@ -694,7 +672,7 @@ func (_m *ChannelStore) GetChannelsByIds(channelIds []string, includeDeleted boo
|
||||
}
|
||||
|
||||
// GetChannelsByScheme provides a mock function with given fields: schemeId, offset, limit
|
||||
func (_m *ChannelStore) GetChannelsByScheme(schemeId string, offset int, limit int) (model.ChannelList, *model.AppError) {
|
||||
func (_m *ChannelStore) GetChannelsByScheme(schemeId string, offset int, limit int) (model.ChannelList, error) {
|
||||
ret := _m.Called(schemeId, offset, limit)
|
||||
|
||||
var r0 model.ChannelList
|
||||
@@ -706,13 +684,11 @@ func (_m *ChannelStore) GetChannelsByScheme(schemeId string, offset int, limit i
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||
r1 = rf(schemeId, offset, limit)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
@@ -959,7 +935,7 @@ func (_m *ChannelStore) GetMembers(channelId string, offset int, limit int) (*mo
|
||||
}
|
||||
|
||||
// GetMembersByIds provides a mock function with given fields: channelId, userIds
|
||||
func (_m *ChannelStore) GetMembersByIds(channelId string, userIds []string) (*model.ChannelMembers, *model.AppError) {
|
||||
func (_m *ChannelStore) GetMembersByIds(channelId string, userIds []string) (*model.ChannelMembers, error) {
|
||||
ret := _m.Called(channelId, userIds)
|
||||
|
||||
var r0 *model.ChannelMembers
|
||||
@@ -971,13 +947,11 @@ func (_m *ChannelStore) GetMembersByIds(channelId string, userIds []string) (*mo
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, []string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, []string) error); ok {
|
||||
r1 = rf(channelId, userIds)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
@@ -1166,7 +1140,7 @@ func (_m *ChannelStore) GetPublicChannelsForTeam(teamId string, offset int, limi
|
||||
}
|
||||
|
||||
// GetSidebarCategories provides a mock function with given fields: userId, teamId
|
||||
func (_m *ChannelStore) GetSidebarCategories(userId string, teamId string) (*model.OrderedSidebarCategories, *model.AppError) {
|
||||
func (_m *ChannelStore) GetSidebarCategories(userId string, teamId string) (*model.OrderedSidebarCategories, error) {
|
||||
ret := _m.Called(userId, teamId)
|
||||
|
||||
var r0 *model.OrderedSidebarCategories
|
||||
@@ -1178,20 +1152,18 @@ func (_m *ChannelStore) GetSidebarCategories(userId string, teamId string) (*mod
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(userId, teamId)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetSidebarCategory provides a mock function with given fields: categoryId
|
||||
func (_m *ChannelStore) GetSidebarCategory(categoryId string) (*model.SidebarCategoryWithChannels, *model.AppError) {
|
||||
func (_m *ChannelStore) GetSidebarCategory(categoryId string) (*model.SidebarCategoryWithChannels, error) {
|
||||
ret := _m.Called(categoryId)
|
||||
|
||||
var r0 *model.SidebarCategoryWithChannels
|
||||
@@ -1203,20 +1175,18 @@ func (_m *ChannelStore) GetSidebarCategory(categoryId string) (*model.SidebarCat
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(categoryId)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetSidebarCategoryOrder provides a mock function with given fields: userId, teamId
|
||||
func (_m *ChannelStore) GetSidebarCategoryOrder(userId string, teamId string) ([]string, *model.AppError) {
|
||||
func (_m *ChannelStore) GetSidebarCategoryOrder(userId string, teamId string) ([]string, error) {
|
||||
ret := _m.Called(userId, teamId)
|
||||
|
||||
var r0 []string
|
||||
@@ -1228,13 +1198,11 @@ func (_m *ChannelStore) GetSidebarCategoryOrder(userId string, teamId string) ([
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(userId, teamId)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
@@ -1264,7 +1232,7 @@ func (_m *ChannelStore) GetTeamChannels(teamId string) (*model.ChannelList, erro
|
||||
}
|
||||
|
||||
// GroupSyncedChannelCount provides a mock function with given fields:
|
||||
func (_m *ChannelStore) GroupSyncedChannelCount() (int64, *model.AppError) {
|
||||
func (_m *ChannelStore) GroupSyncedChannelCount() (int64, error) {
|
||||
ret := _m.Called()
|
||||
|
||||
var r0 int64
|
||||
@@ -1274,13 +1242,11 @@ func (_m *ChannelStore) GroupSyncedChannelCount() (int64, *model.AppError) {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func() *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func() error); ok {
|
||||
r1 = rf()
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
@@ -1350,7 +1316,7 @@ func (_m *ChannelStore) IsUserInChannelUseCache(userId string, channelId string)
|
||||
}
|
||||
|
||||
// MigrateChannelMembers provides a mock function with given fields: fromChannelId, fromUserId
|
||||
func (_m *ChannelStore) MigrateChannelMembers(fromChannelId string, fromUserId string) (map[string]string, *model.AppError) {
|
||||
func (_m *ChannelStore) MigrateChannelMembers(fromChannelId string, fromUserId string) (map[string]string, error) {
|
||||
ret := _m.Called(fromChannelId, fromUserId)
|
||||
|
||||
var r0 map[string]string
|
||||
@@ -1362,13 +1328,11 @@ func (_m *ChannelStore) MigrateChannelMembers(fromChannelId string, fromUserId s
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(fromChannelId, fromUserId)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
@@ -1445,16 +1409,14 @@ func (_m *ChannelStore) PermanentDeleteMembersByUser(userId string) error {
|
||||
}
|
||||
|
||||
// RemoveAllDeactivatedMembers provides a mock function with given fields: channelId
|
||||
func (_m *ChannelStore) RemoveAllDeactivatedMembers(channelId string) *model.AppError {
|
||||
func (_m *ChannelStore) RemoveAllDeactivatedMembers(channelId string) error {
|
||||
ret := _m.Called(channelId)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(channelId)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AppError)
|
||||
}
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
@@ -1489,16 +1451,14 @@ func (_m *ChannelStore) RemoveMembers(channelId string, userIds []string) error
|
||||
}
|
||||
|
||||
// ResetAllChannelSchemes provides a mock function with given fields:
|
||||
func (_m *ChannelStore) ResetAllChannelSchemes() *model.AppError {
|
||||
func (_m *ChannelStore) ResetAllChannelSchemes() error {
|
||||
ret := _m.Called()
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func() *model.AppError); ok {
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func() error); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AppError)
|
||||
}
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
@@ -1611,7 +1571,7 @@ func (_m *ChannelStore) SaveMultipleMembers(members []*model.ChannelMember) ([]*
|
||||
}
|
||||
|
||||
// SearchAllChannels provides a mock function with given fields: term, opts
|
||||
func (_m *ChannelStore) SearchAllChannels(term string, opts store.ChannelSearchOpts) (*model.ChannelListWithTeamData, int64, *model.AppError) {
|
||||
func (_m *ChannelStore) SearchAllChannels(term string, opts store.ChannelSearchOpts) (*model.ChannelListWithTeamData, int64, error) {
|
||||
ret := _m.Called(term, opts)
|
||||
|
||||
var r0 *model.ChannelListWithTeamData
|
||||
@@ -1630,20 +1590,18 @@ func (_m *ChannelStore) SearchAllChannels(term string, opts store.ChannelSearchO
|
||||
r1 = ret.Get(1).(int64)
|
||||
}
|
||||
|
||||
var r2 *model.AppError
|
||||
if rf, ok := ret.Get(2).(func(string, store.ChannelSearchOpts) *model.AppError); ok {
|
||||
var r2 error
|
||||
if rf, ok := ret.Get(2).(func(string, store.ChannelSearchOpts) error); ok {
|
||||
r2 = rf(term, opts)
|
||||
} else {
|
||||
if ret.Get(2) != nil {
|
||||
r2 = ret.Get(2).(*model.AppError)
|
||||
}
|
||||
r2 = ret.Error(2)
|
||||
}
|
||||
|
||||
return r0, r1, r2
|
||||
}
|
||||
|
||||
// SearchArchivedInTeam provides a mock function with given fields: teamId, term, userId
|
||||
func (_m *ChannelStore) SearchArchivedInTeam(teamId string, term string, userId string) (*model.ChannelList, *model.AppError) {
|
||||
func (_m *ChannelStore) SearchArchivedInTeam(teamId string, term string, userId string) (*model.ChannelList, error) {
|
||||
ret := _m.Called(teamId, term, userId)
|
||||
|
||||
var r0 *model.ChannelList
|
||||
@@ -1655,20 +1613,18 @@ func (_m *ChannelStore) SearchArchivedInTeam(teamId string, term string, userId
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, string, string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string, string) error); ok {
|
||||
r1 = rf(teamId, term, userId)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SearchForUserInTeam provides a mock function with given fields: userId, teamId, term, includeDeleted
|
||||
func (_m *ChannelStore) SearchForUserInTeam(userId string, teamId string, term string, includeDeleted bool) (*model.ChannelList, *model.AppError) {
|
||||
func (_m *ChannelStore) SearchForUserInTeam(userId string, teamId string, term string, includeDeleted bool) (*model.ChannelList, error) {
|
||||
ret := _m.Called(userId, teamId, term, includeDeleted)
|
||||
|
||||
var r0 *model.ChannelList
|
||||
@@ -1680,20 +1636,18 @@ func (_m *ChannelStore) SearchForUserInTeam(userId string, teamId string, term s
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, string, string, bool) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string, string, bool) error); ok {
|
||||
r1 = rf(userId, teamId, term, includeDeleted)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SearchGroupChannels provides a mock function with given fields: userId, term
|
||||
func (_m *ChannelStore) SearchGroupChannels(userId string, term string) (*model.ChannelList, *model.AppError) {
|
||||
func (_m *ChannelStore) SearchGroupChannels(userId string, term string) (*model.ChannelList, error) {
|
||||
ret := _m.Called(userId, term)
|
||||
|
||||
var r0 *model.ChannelList
|
||||
@@ -1705,20 +1659,18 @@ func (_m *ChannelStore) SearchGroupChannels(userId string, term string) (*model.
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(userId, term)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SearchInTeam provides a mock function with given fields: teamId, term, includeDeleted
|
||||
func (_m *ChannelStore) SearchInTeam(teamId string, term string, includeDeleted bool) (*model.ChannelList, *model.AppError) {
|
||||
func (_m *ChannelStore) SearchInTeam(teamId string, term string, includeDeleted bool) (*model.ChannelList, error) {
|
||||
ret := _m.Called(teamId, term, includeDeleted)
|
||||
|
||||
var r0 *model.ChannelList
|
||||
@@ -1730,20 +1682,18 @@ func (_m *ChannelStore) SearchInTeam(teamId string, term string, includeDeleted
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, string, bool) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string, bool) error); ok {
|
||||
r1 = rf(teamId, term, includeDeleted)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SearchMore provides a mock function with given fields: userId, teamId, term
|
||||
func (_m *ChannelStore) SearchMore(userId string, teamId string, term string) (*model.ChannelList, *model.AppError) {
|
||||
func (_m *ChannelStore) SearchMore(userId string, teamId string, term string) (*model.ChannelList, error) {
|
||||
ret := _m.Called(userId, teamId, term)
|
||||
|
||||
var r0 *model.ChannelList
|
||||
@@ -1755,13 +1705,11 @@ func (_m *ChannelStore) SearchMore(userId string, teamId string, term string) (*
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, string, string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string, string) error); ok {
|
||||
r1 = rf(userId, teamId, term)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
@@ -1874,16 +1822,14 @@ func (_m *ChannelStore) UpdateMember(member *model.ChannelMember) (*model.Channe
|
||||
}
|
||||
|
||||
// UpdateMembersRole provides a mock function with given fields: channelID, userIDs
|
||||
func (_m *ChannelStore) UpdateMembersRole(channelID string, userIDs []string) *model.AppError {
|
||||
func (_m *ChannelStore) UpdateMembersRole(channelID string, userIDs []string) error {
|
||||
ret := _m.Called(channelID, userIDs)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(string, []string) *model.AppError); ok {
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, []string) error); ok {
|
||||
r0 = rf(channelID, userIDs)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AppError)
|
||||
}
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
@@ -1913,7 +1859,7 @@ func (_m *ChannelStore) UpdateMultipleMembers(members []*model.ChannelMember) ([
|
||||
}
|
||||
|
||||
// UpdateSidebarCategories provides a mock function with given fields: userId, teamId, categories
|
||||
func (_m *ChannelStore) UpdateSidebarCategories(userId string, teamId string, categories []*model.SidebarCategoryWithChannels) ([]*model.SidebarCategoryWithChannels, *model.AppError) {
|
||||
func (_m *ChannelStore) UpdateSidebarCategories(userId string, teamId string, categories []*model.SidebarCategoryWithChannels) ([]*model.SidebarCategoryWithChannels, error) {
|
||||
ret := _m.Called(userId, teamId, categories)
|
||||
|
||||
var r0 []*model.SidebarCategoryWithChannels
|
||||
@@ -1925,29 +1871,25 @@ func (_m *ChannelStore) UpdateSidebarCategories(userId string, teamId string, ca
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, string, []*model.SidebarCategoryWithChannels) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string, []*model.SidebarCategoryWithChannels) error); ok {
|
||||
r1 = rf(userId, teamId, categories)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateSidebarCategoryOrder provides a mock function with given fields: userId, teamId, categoryOrder
|
||||
func (_m *ChannelStore) UpdateSidebarCategoryOrder(userId string, teamId string, categoryOrder []string) *model.AppError {
|
||||
func (_m *ChannelStore) UpdateSidebarCategoryOrder(userId string, teamId string, categoryOrder []string) error {
|
||||
ret := _m.Called(userId, teamId, categoryOrder)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(string, string, []string) *model.AppError); ok {
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, []string) error); ok {
|
||||
r0 = rf(userId, teamId, categoryOrder)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AppError)
|
||||
}
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
@@ -1982,7 +1924,7 @@ func (_m *ChannelStore) UpdateSidebarChannelsByPreferences(preferences *model.Pr
|
||||
}
|
||||
|
||||
// UserBelongsToChannels provides a mock function with given fields: userId, channelIds
|
||||
func (_m *ChannelStore) UserBelongsToChannels(userId string, channelIds []string) (bool, *model.AppError) {
|
||||
func (_m *ChannelStore) UserBelongsToChannels(userId string, channelIds []string) (bool, error) {
|
||||
ret := _m.Called(userId, channelIds)
|
||||
|
||||
var r0 bool
|
||||
@@ -1992,13 +1934,11 @@ func (_m *ChannelStore) UserBelongsToChannels(userId string, channelIds []string
|
||||
r0 = ret.Get(0).(bool)
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, []string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, []string) error); ok {
|
||||
r1 = rf(userId, channelIds)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
|
||||
Ссылка в новой задаче
Block a user