* spelling: comments

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Josh Soref
2022-01-19 23:37:27 -05:00
коммит произвёл GitHub
родитель 3207d861ca
Коммит 294bd44971
47 изменённых файлов: 66 добавлений и 66 удалений

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

@@ -580,7 +580,7 @@ config-reset: ## Resets the config/config.json file to the default.
diff-config: ## Compares default configuration between two mattermost versions diff-config: ## Compares default configuration between two mattermost versions
@./scripts/diff-config.sh @./scripts/diff-config.sh
clean: stop-docker ## Clean up everything except persistant server data. clean: stop-docker ## Clean up everything except persistent server data.
@echo Cleaning @echo Cleaning
rm -Rf $(DIST_ROOT) rm -Rf $(DIST_ROOT)
@@ -670,7 +670,7 @@ ifeq ($(BUILD_ENTERPRISE_READY),true)
@! ag --ignore Makefile --ignore-dir vendor --ignore-dir runtime '(TODO|XXX|FIXME|"FIX ME")[: ]+' enterprise/ @! ag --ignore Makefile --ignore-dir vendor --ignore-dir runtime '(TODO|XXX|FIXME|"FIX ME")[: ]+' enterprise/
endif endif
## Help documentatin à la https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html ## Help documentation à la https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
help: help:
@grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' ./Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' @grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' ./Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@echo @echo

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

@@ -4494,7 +4494,7 @@ SOFTWARE.
This product contains 'archiver' by Matthew Holt This product contains 'archiver' by Matthew Holt
A library to handle direferen archive files (zip, rar, tar.gz...) A library to handle different archive files (zip, rar, tar.gz...)
* HOMEPAGE: * HOMEPAGE:
* https://github.com/mholt/archiver * https://github.com/mholt/archiver

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

@@ -1706,7 +1706,7 @@ func TestInstallMarketplacePlugin(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
th := SetupConfig(t, func(cfg *model.Config) { th := SetupConfig(t, func(cfg *model.Config) {
// Disable auto-installing prepackged plugins // Disable auto-installing prepackaged plugins
*cfg.PluginSettings.AutomaticPrepackagedPlugins = false *cfg.PluginSettings.AutomaticPrepackagedPlugins = false
}).InitBasic() }).InitBasic()
defer th.TearDown() defer th.TearDown()

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

@@ -2680,7 +2680,7 @@ func TestSetPostUnreadWithoutCollapsedThreads(t *testing.T) {
// user2: first root mention @user1 // user2: first root mention @user1
// - user1: hello // - user1: hello
// - user2: mention @u1 // - user2: mention @u1
// - user1: another repoy // - user1: another reply
// - user2: another mention @u1 // - user2: another mention @u1
// user1: a root post // user1: a root post
// user2: Another root mention @u1 // user2: Another root mention @u1

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

@@ -75,7 +75,7 @@ func generateSupportPacket(c *Context, w http.ResponseWriter, r *http.Request) {
const OutputDirectory = "support_packet" const OutputDirectory = "support_packet"
// Checking to see if the user is a admin of any sort or not // Checking to see if the user is a admin of any sort or not
// If they are a admin, they should theoritcally have access to one or more of the system console read permissions // If they are a admin, they should theoretically have access to one or more of the system console read permissions
if !c.App.SessionHasPermissionToAny(*c.AppContext.Session(), model.SysconsoleReadPermissions) { if !c.App.SessionHasPermissionToAny(*c.AppContext.Session(), model.SysconsoleReadPermissions) {
c.SetPermissionError(model.SysconsoleReadPermissions...) c.SetPermissionError(model.SysconsoleReadPermissions...)
return return

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

@@ -752,7 +752,7 @@ func TestUpdateIncomingHook(t *testing.T) {
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnablePostIconOverride = false }) th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnablePostIconOverride = false })
th.TestForSystemAdminAndLocal(t, func(t *testing.T, client *model.Client4) { th.TestForSystemAdminAndLocal(t, func(t *testing.T, client *model.Client4) {
// webhook creations are allways performed by a sysadmin // webhook creations are always performed by a sysadmin
// because it's not currently possible to create a webhook via // because it's not currently possible to create a webhook via
// local mode // local mode
var err error var err error

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

@@ -111,7 +111,7 @@ type AppIface interface {
DeleteGroupConstrainedMemberships(c *request.Context) error DeleteGroupConstrainedMemberships(c *request.Context) error
// DeletePublicKey will delete plugin public key from the config. // DeletePublicKey will delete plugin public key from the config.
DeletePublicKey(name string) *model.AppError DeletePublicKey(name string) *model.AppError
// DemoteUserToGuest Convert user's roles and all his mermbership's roles from // DemoteUserToGuest Convert user's roles and all his membership's roles from
// regular user roles to guest roles. // regular user roles to guest roles.
DemoteUserToGuest(user *model.User) *model.AppError DemoteUserToGuest(user *model.User) *model.AppError
// DisablePlugin will set the config for an installed plugin to disabled, triggering deactivation if active. // DisablePlugin will set the config for an installed plugin to disabled, triggering deactivation if active.
@@ -253,7 +253,7 @@ type AppIface interface {
// PopulateWebConnConfig checks if the connection id already exists in the hub, // PopulateWebConnConfig checks if the connection id already exists in the hub,
// and if so, accordingly populates the other fields of the webconn. // and if so, accordingly populates the other fields of the webconn.
PopulateWebConnConfig(s *model.Session, cfg *WebConnConfig, seqVal string) (*WebConnConfig, error) PopulateWebConnConfig(s *model.Session, cfg *WebConnConfig, seqVal string) (*WebConnConfig, error)
// PromoteGuestToUser Convert user's roles and all his mermbership's roles from // PromoteGuestToUser Convert user's roles and all his membership's roles from
// guest roles to regular user roles. // guest roles to regular user roles.
PromoteGuestToUser(c *request.Context, user *model.User, requestorId string) *model.AppError PromoteGuestToUser(c *request.Context, user *model.User, requestorId string) *model.AppError
// RenameChannel is used to rename the channel Name and the DisplayName fields // RenameChannel is used to rename the channel Name and the DisplayName fields

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

@@ -565,7 +565,7 @@ func TestDisableUserBots(t *testing.T) {
err = th.App.disableUserBots(th.Context, ownerId1) err = th.App.disableUserBots(th.Context, ownerId1)
require.Nil(t, err) require.Nil(t, err)
// Check all bots and corrensponding users are disabled for creator 1 // Check all bots and corresponding users are disabled for creator 1
for _, bot := range bots { for _, bot := range bots {
retbot, err2 := th.App.GetBot(bot.UserId, true) retbot, err2 := th.App.GetBot(bot.UserId, true)
require.Nil(t, err2) require.Nil(t, err2)

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

@@ -1048,7 +1048,7 @@ func TestGetPublicChannelsForTeam(t *testing.T) {
expectedChannels = append(expectedChannels, rchannel) expectedChannels = append(expectedChannels, rchannel)
} }
// Fetch public channels multipile times // Fetch public channels multiple times
channelList, err := th.App.GetPublicChannelsForTeam(team.Id, 0, 5) channelList, err := th.App.GetPublicChannelsForTeam(team.Id, 0, 5)
require.Nil(t, err) require.Nil(t, err)
channelList2, err := th.App.GetPublicChannelsForTeam(team.Id, 5, 5) channelList2, err := th.App.GetPublicChannelsForTeam(team.Id, 5, 5)
@@ -1081,7 +1081,7 @@ func TestGetPrivateChannelsForTeam(t *testing.T) {
expectedChannels = append(expectedChannels, rchannel) expectedChannels = append(expectedChannels, rchannel)
} }
// Fetch private channels multipile times // Fetch private channels multiple times
channelList, err := th.App.GetPrivateChannelsForTeam(team.Id, 0, 5) channelList, err := th.App.GetPrivateChannelsForTeam(team.Id, 0, 5)
require.Nil(t, err) require.Nil(t, err)
channelList2, err := th.App.GetPrivateChannelsForTeam(team.Id, 5, 5) channelList2, err := th.App.GetPrivateChannelsForTeam(team.Id, 5, 5)
@@ -2216,7 +2216,7 @@ func TestMarkChannelAsUnreadFromPostCollapsedThreadsTurnedOff(t *testing.T) {
// user2: first root mention @user1 // user2: first root mention @user1
// - user1: hello // - user1: hello
// - user2: mention @u1 // - user2: mention @u1
// - user1: another repoy // - user1: another reply
// - user2: another mention @u1 // - user2: another mention @u1
// user1: a root post // user1: a root post
// user2: Another root mention @u1 // user2: Another root mention @u1

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

@@ -186,11 +186,11 @@ func (job *EmailBatchingJob) checkPendingNotifications(now time.Time, handler fu
var interval int64 var interval int64
preference, err := job.service.store.Preference().Get(userID, model.PreferenceCategoryNotifications, model.PreferenceNameEmailInterval) preference, err := job.service.store.Preference().Get(userID, model.PreferenceCategoryNotifications, model.PreferenceNameEmailInterval)
if err != nil { if err != nil {
// use the default batching interval if an error ocurrs while fetching user preferences // use the default batching interval if an error occurs while fetching user preferences
interval, _ = strconv.ParseInt(model.PreferenceEmailIntervalBatchingSeconds, 10, 64) interval, _ = strconv.ParseInt(model.PreferenceEmailIntervalBatchingSeconds, 10, 64)
} else { } else {
if value, err := strconv.ParseInt(preference.Value, 10, 64); err != nil { if value, err := strconv.ParseInt(preference.Value, 10, 64); err != nil {
// // use the default batching interval if an error ocurrs while deserializing user preferences // // use the default batching interval if an error occurs while deserializing user preferences
interval, _ = strconv.ParseInt(model.PreferenceEmailIntervalBatchingSeconds, 10, 64) interval, _ = strconv.ParseInt(model.PreferenceEmailIntervalBatchingSeconds, 10, 64)
} else { } else {
interval = value interval = value

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

@@ -387,7 +387,7 @@ func TestExportGMandDMChannels(t *testing.T) {
channels, nErr = th2.App.Srv().Store.Channel().GetAllDirectChannelsForExportAfter(1000, "00000000") channels, nErr = th2.App.Srv().Store.Channel().GetAllDirectChannelsForExportAfter(1000, "00000000")
require.NoError(t, nErr) require.NoError(t, nErr)
// Adding some deteminism so its possible to assert on slice index // Adding some determinism so its possible to assert on slice index
sort.Slice(channels, func(i, j int) bool { return channels[i].Type > channels[j].Type }) sort.Slice(channels, func(i, j int) bool { return channels[i].Type > channels[j].Type })
assert.Equal(t, 2, len(channels)) assert.Equal(t, 2, len(channels))
assert.ElementsMatch(t, []string{th1.BasicUser.Username, user1.Username, user2.Username}, *channels[0].Members) assert.ElementsMatch(t, []string{th1.BasicUser.Username, user1.Username, user2.Username}, *channels[0].Members)
@@ -465,7 +465,7 @@ func TestExportDMandGMPost(t *testing.T) {
posts, err = th2.App.Srv().Store.Post().GetDirectPostParentsForExportAfter(1000, "0000000") posts, err = th2.App.Srv().Store.Post().GetDirectPostParentsForExportAfter(1000, "0000000")
require.NoError(t, err) require.NoError(t, err)
// Adding some deteminism so its possible to assert on slice index // Adding some determinism so its possible to assert on slice index
sort.Slice(posts, func(i, j int) bool { return posts[i].Message > posts[j].Message }) sort.Slice(posts, func(i, j int) bool { return posts[i].Message > posts[j].Message })
assert.Equal(t, 4, len(posts)) assert.Equal(t, 4, len(posts))
assert.ElementsMatch(t, gmMembers, *posts[0].ChannelMembers) assert.ElementsMatch(t, gmMembers, *posts[0].ChannelMembers)

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

@@ -39,7 +39,7 @@ func extractTarGz(gzipStream io.Reader, dst string) error {
return errors.Wrap(err, "failed to read next file from archive") return errors.Wrap(err, "failed to read next file from archive")
} }
// Pre-emptively check type flag to avoid reporting a misleading error in // Preemptively check type flag to avoid reporting a misleading error in
// trying to sanitize the header name. // trying to sanitize the header name.
switch header.Typeflag { switch header.Typeflag {
case tar.TypeDir: case tar.TypeDir:

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

@@ -55,7 +55,7 @@ func NewSynchronizer(params SyncParams) (*Synchronizer, error) {
}, nil }, nil
} }
// EnsureReady blocks until the syncronizer is ready to update feature flag values // EnsureReady blocks until the synchronizer is ready to update feature flag values
func (f *Synchronizer) EnsureReady() error { func (f *Synchronizer) EnsureReady() error {
if err := f.client.BlockUntilReady(10); err != nil { if err := f.client.BlockUntilReady(10); err != nil {
return errors.Wrap(err, "split.io client could not initialize") return errors.Wrap(err, "split.io client could not initialize")

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

@@ -648,7 +648,7 @@ type UploadFileTask struct {
imageType string imageType string
imageOrientation int imageOrientation int
// Testing: overrideable dependency functions // Testing: overridable dependency functions
pluginsEnvironment *plugin.Environment pluginsEnvironment *plugin.Environment
writeFile func(io.Reader, string) (int64, *model.AppError) writeFile func(io.Reader, string) (int64, *model.AppError)
saveToDatabase func(*model.FileInfo) (*model.FileInfo, error) saveToDatabase func(*model.FileInfo) (*model.FileInfo, error)

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

@@ -617,7 +617,7 @@ func TestImportValidateUserImportData(t *testing.T) {
data.NotifyProps.MentionKeys = ptrStr("valid") data.NotifyProps.MentionKeys = ptrStr("valid")
checkNoError(t, validateUserImportData(&data)) checkNoError(t, validateUserImportData(&data))
//Test the emai batching interval validators //Test the email batching interval validators
//Happy paths //Happy paths
data.EmailInterval = ptrStr("immediately") data.EmailInterval = ptrStr("immediately")
checkNoError(t, validateUserImportData(&data)) checkNoError(t, validateUserImportData(&data))

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

@@ -536,7 +536,7 @@ func (a *App) getAddManageSecureConnectionsPermissionsMigration() (permissionsMa
Add: []string{PermissionManageSecureConnections}, Add: []string{PermissionManageSecureConnections},
}) })
// remote the decprecated permission from system admin // remote the deprecated permission from system admin
transformations = append(transformations, transformations = append(transformations,
permissionTransformation{ permissionTransformation{
On: isRole(model.SystemAdminRoleId), On: isRole(model.SystemAdminRoleId),
@@ -667,7 +667,7 @@ func (a *App) getAddComplianceSubsectionPermissions() (permissionsMap, error) {
Add: permissionsComplianceWrite, Add: permissionsComplianceWrite,
}) })
// Ancilary permissions // Ancillary permissions
transformations = append(transformations, permissionTransformation{ transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PermissionSysconsoleWriteComplianceDataRetentionPolicy.Id), On: permissionExists(model.PermissionSysconsoleWriteComplianceDataRetentionPolicy.Id),
Add: []string{model.PermissionCreateDataRetentionJob.Id}, Add: []string{model.PermissionCreateDataRetentionJob.Id},

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

@@ -639,7 +639,7 @@ func (a *App) mergePrepackagedPlugins(remoteMarketplacePlugins map[string]*model
continue continue
} }
// If available in the markteplace, only overwrite if newer. // If available in the marketplace, only overwrite if newer.
prepackagedVersion, err := semver.Parse(prepackaged.Manifest.Version) prepackagedVersion, err := semver.Parse(prepackaged.Manifest.Version)
if err != nil { if err != nil {
return model.NewAppError("mergePrepackagedPlugins", "app.plugin.invalid_version.app_error", nil, err.Error(), http.StatusBadRequest) return model.NewAppError("mergePrepackagedPlugins", "app.plugin.invalid_version.app_error", nil, err.Error(), http.StatusBadRequest)

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

@@ -299,7 +299,7 @@ func (a *App) CreatePost(c *request.Context, post *model.Post, channel *model.Ch
rPostCopy := rpost.Clone() rPostCopy := rpost.Clone()
// FIXME: Removes PreviewPost from the post payload sent to the MessageHasBeenPosted hook so that plugins compiled with older versions of // FIXME: Removes PreviewPost from the post payload sent to the MessageHasBeenPosted hook so that plugins compiled with older versions of
// Mattermost—without the gob registeration of the PreviewPost struct—won't crash. // Mattermost—without the gob registration of the PreviewPost struct—won't crash.
if rPostCopy.Metadata != nil { if rPostCopy.Metadata != nil {
rPostCopy.Metadata = rPostCopy.Metadata.Copy() rPostCopy.Metadata = rPostCopy.Metadata.Copy()
} }

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

@@ -515,7 +515,7 @@ func (a *App) getLinkMetadata(requestURL string, timestamp int64, isNewPost bool
referencedPostID := requestURL[len(requestURL)-26:] referencedPostID := requestURL[len(requestURL)-26:]
referencedPost, appErr := a.GetSinglePost(referencedPostID) referencedPost, appErr := a.GetSinglePost(referencedPostID)
// TODO: Look into saving a value in the LinkMetadat.Data field to prevent perpetually re-querying for the deleted post. // TODO: Look into saving a value in the LinkMetadata.Data field to prevent perpetually re-querying for the deleted post.
if appErr != nil { if appErr != nil {
return nil, nil, nil, appErr return nil, nil, nil, appErr
} }

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

@@ -929,7 +929,7 @@ func TestGetTeamMembers(t *testing.T) {
return users[i].Id < users[j].Id return users[i].Id < users[j].Id
}) })
// Fetch team members multipile times // Fetch team members multiple times
members, err := th.App.GetTeamMembers(th.BasicTeam.Id, 0, 5, nil) members, err := th.App.GetTeamMembers(th.BasicTeam.Id, 0, 5, nil)
require.Nil(t, err) require.Nil(t, err)

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

@@ -2037,7 +2037,7 @@ func (a *App) GetViewUsersRestrictions(userID string) (*model.ViewUsersRestricti
return &model.ViewUsersRestrictions{Teams: teamIDsWithPermission, Channels: channelIDs}, nil return &model.ViewUsersRestrictions{Teams: teamIDsWithPermission, Channels: channelIDs}, nil
} }
// PromoteGuestToUser Convert user's roles and all his mermbership's roles from // PromoteGuestToUser Convert user's roles and all his membership's roles from
// guest roles to regular user roles. // guest roles to regular user roles.
func (a *App) PromoteGuestToUser(c *request.Context, user *model.User, requestorId string) *model.AppError { func (a *App) PromoteGuestToUser(c *request.Context, user *model.User, requestorId string) *model.AppError {
nErr := a.ch.srv.userService.PromoteGuestToUser(user) nErr := a.ch.srv.userService.PromoteGuestToUser(user)
@@ -2097,7 +2097,7 @@ func (a *App) PromoteGuestToUser(c *request.Context, user *model.User, requestor
return nil return nil
} }
// DemoteUserToGuest Convert user's roles and all his mermbership's roles from // DemoteUserToGuest Convert user's roles and all his membership's roles from
// regular user roles to guest roles. // regular user roles to guest roles.
func (a *App) DemoteUserToGuest(user *model.User) *model.AppError { func (a *App) DemoteUserToGuest(user *model.User) *model.AppError {
demotedUser, nErr := a.ch.srv.userService.DemoteUserToGuest(user) demotedUser, nErr := a.ch.srv.userService.DemoteUserToGuest(user)

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

@@ -120,7 +120,7 @@ func TestAdjustProfileImage(t *testing.T) {
assert.True(t, adjusted.Len() > 0) assert.True(t, adjusted.Len() > 0)
assert.NotEqual(t, testjpg, adjusted) assert.NotEqual(t, testjpg, adjusted)
// default image should require adjustement // default image should require adjustment
user := th.BasicUser user := th.BasicUser
image, err := th.App.GetDefaultProfileImage(user) image, err := th.App.GetDefaultProfileImage(user)
require.Nil(t, err) require.Nil(t, err)
@@ -524,7 +524,7 @@ func TestUpdateUserEmail(t *testing.T) {
tokens, err = th.App.Srv().Store.Token().GetAllTokensByType(TokenTypeVerifyEmail) tokens, err = th.App.Srv().Store.Token().GetAllTokensByType(TokenTypeVerifyEmail)
// We verify the same conditions as the earlier function, // We verify the same conditions as the earlier function,
// but we also need to ensure that this is not the same token // but we also need to ensure that this is not the same token
// as before, which is possible if the token updation goroutine // as before, which is possible if the token update goroutine
// hasn't yet run. // hasn't yet run.
return err == nil && len(tokens) == 1 && tokens[0].Token != firstToken.Token return err == nil && len(tokens) == 1 && tokens[0].Token != firstToken.Token
}, 100*time.Millisecond, 10*time.Millisecond) }, 100*time.Millisecond, 10*time.Millisecond)

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

@@ -47,7 +47,7 @@ func (us *UserService) isPasswordValid(password string) error {
} }
// IsPasswordValidWithSettings is a utility functions that checks if the given password // IsPasswordValidWithSettings is a utility functions that checks if the given password
// comforms to the password settings. It returns the error id as error value. // conforms to the password settings. It returns the error id as error value.
func IsPasswordValidWithSettings(password string, settings *model.PasswordSettings) error { func IsPasswordValidWithSettings(password string, settings *model.PasswordSettings) error {
id := "model.user.is_valid.pwd" id := "model.user.is_valid.pwd"
isError := false isError := false

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

@@ -35,7 +35,7 @@ func main() {
"keycloak": 8080, "keycloak": 8080,
"prometheus": 9090, "prometheus": 9090,
"grafana": 3000, "grafana": 3000,
"mysql-read-replica": 3306, // FIXME: not recorgnizing the successfully running service on port 3307. "mysql-read-replica": 3306, // FIXME: not recognizing the successfully running service on port 3307.
} }
command := []string{} command := []string{}
for _, arg := range os.Args[1:] { for _, arg := range os.Args[1:] {

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

@@ -20,7 +20,7 @@ RUN_SERVER_IN_BACKGROUND ?= true
# Data loaded by default in openldap when container starts. # Data loaded by default in openldap when container starts.
# #
# Posible options: test or qa # Possible options: test or qa
LDAP_DATA ?= test LDAP_DATA ?= test
# Mock the CWS. # Mock the CWS.

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

@@ -17,7 +17,7 @@ type ChannelCounts struct {
} }
func (o *ChannelCounts) Etag() string { func (o *ChannelCounts) Etag() string {
// we don't include CountsRoot in ETag calculation, since it's a deriviative // we don't include CountsRoot in ETag calculation, since it's a derivative
ids := []string{} ids := []string{}
for id := range o.Counts { for id := range o.Counts {
ids = append(ids, id) ids = append(ids, id)

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

@@ -1978,7 +1978,7 @@ func (c *Client4) GetBotsIncludeDeleted(page, perPage int, etag string) ([]*Bot,
return bots, BuildResponse(r), nil return bots, BuildResponse(r), nil
} }
// GetBotsOrphaned fetches the given page of bots, only including orphanded bots. // GetBotsOrphaned fetches the given page of bots, only including orphaned bots.
func (c *Client4) GetBotsOrphaned(page, perPage int, etag string) ([]*Bot, *Response, error) { func (c *Client4) GetBotsOrphaned(page, perPage int, etag string) ([]*Bot, *Response, error) {
query := fmt.Sprintf("?page=%v&per_page=%v&only_orphaned="+c.boolString(true), page, perPage) query := fmt.Sprintf("?page=%v&per_page=%v&only_orphaned="+c.boolString(true), page, perPage)
r, err := c.DoAPIGet(c.botsRoute()+query, etag) r, err := c.DoAPIGet(c.botsRoute()+query, etag)

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

@@ -14,7 +14,7 @@ type PostMetadata struct {
// Files holds information about the file attachments on the post. // Files holds information about the file attachments on the post.
Files []*FileInfo `json:"files,omitempty"` Files []*FileInfo `json:"files,omitempty"`
// Images holds the dimensions of all external images in the post as a map of the image URL to its diemsnions. // Images holds the dimensions of all external images in the post as a map of the image URL to its dimensions.
// This includes image embeds (when the message contains a plaintext link to an image), Markdown images, images // This includes image embeds (when the message contains a plaintext link to an image), Markdown images, images
// contained in the OpenGraph metadata, and images contained in message attachments. It does not contain // contained in the OpenGraph metadata, and images contained in message attachments. It does not contain
// the dimensions of any file attachments as those are stored in FileInfos. // the dimensions of any file attachments as those are stored in FileInfos.

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

@@ -558,7 +558,7 @@ func (r *Role) GetChannelModeratedPermissions(channelType ChannelType) map[strin
return moderatedPermissions return moderatedPermissions
} }
// RolePatchFromChannelModerationsPatch Creates and returns a RolePatch based on a slice of ChannelModerationPatchs, roleName is expected to be either "members" or "guests". // RolePatchFromChannelModerationsPatch Creates and returns a RolePatch based on a slice of ChannelModerationPatches, roleName is expected to be either "members" or "guests".
func (r *Role) RolePatchFromChannelModerationsPatch(channelModerationsPatch []*ChannelModerationPatch, roleName string) *RolePatch { func (r *Role) RolePatchFromChannelModerationsPatch(channelModerationsPatch []*ChannelModerationPatch, roleName string) *RolePatch {
permissionsToAddToPatch := make(map[string]bool) permissionsToAddToPatch := make(map[string]bool)

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

@@ -163,7 +163,7 @@ The killer feature of `markdown-it` is very effective support of
[syntax plugins](https://www.npmjs.org/browse/keyword/markdown-it-plugin). [syntax plugins](https://www.npmjs.org/browse/keyword/markdown-it-plugin).
### [Emojies](https://github.com/markdown-it/markdown-it-emoji) ### [Emojis](https://github.com/markdown-it/markdown-it-emoji)
> Classic markup: :wink: :crush: :cry: :tear: :laughing: :yum: > Classic markup: :wink: :crush: :cry: :tear: :laughing: :yum:
> >

2
model/testdata/markdown-sample.md поставляемый
Просмотреть файл

@@ -163,7 +163,7 @@ The killer feature of `markdown-it` is very effective support of
[syntax plugins](https://www.npmjs.org/browse/keyword/markdown-it-plugin). [syntax plugins](https://www.npmjs.org/browse/keyword/markdown-it-plugin).
### [Emojies](https://github.com/markdown-it/markdown-it-emoji) ### [Emojis](https://github.com/markdown-it/markdown-it-emoji)
> Classic markup: :wink: :crush: :cry: :tear: :laughing: :yum: > Classic markup: :wink: :crush: :cry: :tear: :laughing: :yum:
> >

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

@@ -703,7 +703,7 @@ func IsValidUserRoles(userRoles string) bool {
return true return true
} }
// Make sure you acually want to use this function. In context.go there are functions to check permissions // Make sure you actually want to use this function. In context.go there are functions to check permissions
// This function should not be used to check permissions. // This function should not be used to check permissions.
func (u *User) IsGuest() bool { func (u *User) IsGuest() bool {
return IsInRole(u.Roles, SystemGuestRoleId) return IsInRole(u.Roles, SystemGuestRoleId)
@@ -713,13 +713,13 @@ func (u *User) IsSystemAdmin() bool {
return IsInRole(u.Roles, SystemAdminRoleId) return IsInRole(u.Roles, SystemAdminRoleId)
} }
// Make sure you acually want to use this function. In context.go there are functions to check permissions // Make sure you actually want to use this function. In context.go there are functions to check permissions
// This function should not be used to check permissions. // This function should not be used to check permissions.
func (u *User) IsInRole(inRole string) bool { func (u *User) IsInRole(inRole string) bool {
return IsInRole(u.Roles, inRole) return IsInRole(u.Roles, inRole)
} }
// Make sure you acually want to use this function. In context.go there are functions to check permissions // Make sure you actually want to use this function. In context.go there are functions to check permissions
// This function should not be used to check permissions. // This function should not be used to check permissions.
func IsInRole(userRoles string, inRole string) bool { func IsInRole(userRoles string, inRole string) bool {
roles := strings.Split(userRoles, " ") roles := strings.Split(userRoles, " ")

4
services/cache/cache.go поставляемый
Просмотреть файл

@@ -23,11 +23,11 @@ type Cache interface {
Set(key string, value interface{}) error Set(key string, value interface{}) error
// SetWithDefaultExpiry adds the given key and value to the store with the default expiry. If // SetWithDefaultExpiry adds the given key and value to the store with the default expiry. If
// the key already exists, it will overwrite the previoous value // the key already exists, it will overwrite the previous value
SetWithDefaultExpiry(key string, value interface{}) error SetWithDefaultExpiry(key string, value interface{}) error
// SetWithExpiry adds the given key and value to the cache with the given expiry. If the key // SetWithExpiry adds the given key and value to the cache with the given expiry. If the key
// already exists, it will overwrite the previoous value // already exists, it will overwrite the previous value
SetWithExpiry(key string, value interface{}, ttl time.Duration) error SetWithExpiry(key string, value interface{}, ttl time.Duration) error
// Get the content stored in the cache for the given key, and decode it into the value interface. // Get the content stored in the cache for the given key, and decode it into the value interface.

4
services/cache/lru.go поставляемый
Просмотреть файл

@@ -75,13 +75,13 @@ func (l *LRU) Set(key string, value interface{}) error {
} }
// SetWithDefaultExpiry adds the given key and value to the store with the default expiry. If // SetWithDefaultExpiry adds the given key and value to the store with the default expiry. If
// the key already exists, it will overwrite the previoous value // the key already exists, it will overwrite the previous value
func (l *LRU) SetWithDefaultExpiry(key string, value interface{}) error { func (l *LRU) SetWithDefaultExpiry(key string, value interface{}) error {
return l.SetWithExpiry(key, value, l.defaultExpiry) return l.SetWithExpiry(key, value, l.defaultExpiry)
} }
// SetWithExpiry adds the given key and value to the cache with the given expiry. If the key // SetWithExpiry adds the given key and value to the cache with the given expiry. If the key
// already exists, it will overwrite the previoous value // already exists, it will overwrite the previous value
func (l *LRU) SetWithExpiry(key string, value interface{}, ttl time.Duration) error { func (l *LRU) SetWithExpiry(key string, value interface{}, ttl time.Duration) error {
return l.set(key, value, ttl) return l.set(key, value, ttl)
} }

2
services/cache/provider.go поставляемый
Просмотреть файл

@@ -9,7 +9,7 @@ import (
"github.com/mattermost/mattermost-server/v6/model" "github.com/mattermost/mattermost-server/v6/model"
) )
// CacheOptions contains options for initializaing a cache // CacheOptions contains options for initializing a cache
type CacheOptions struct { type CacheOptions struct {
Size int Size int
DefaultExpiry time.Duration DefaultExpiry time.Duration

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

@@ -23,7 +23,7 @@ type customTransport struct {
// RoundTrip implements the http.Roundtripper interface. // RoundTrip implements the http.Roundtripper interface.
func (t *customTransport) RoundTrip(req *http.Request) (*http.Response, error) { func (t *customTransport) RoundTrip(req *http.Request) (*http.Response, error) {
// Rountrippers should not modify the original request. // Roundtrippers should not modify the original request.
newReq := req.Clone(context.Background()) newReq := req.Clone(context.Background())
*newReq.URL = *req.URL *newReq.URL = *req.URL
req.URL.Scheme = t.scheme req.URL.Scheme = t.scheme

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

@@ -106,7 +106,7 @@ func (m *MFA) Activate(userMfaSecret, userID string, token string) error {
return nil return nil
} }
// Deactivate set the mfa as deactive, remove the mfa secret, store it with the StoreActive and StoreSecret functions provided // Deactivate set the mfa as deactivated, remove the mfa secret, store it with the StoreActive and StoreSecret functions provided
func (m *MFA) Deactivate(userId string) error { func (m *MFA) Deactivate(userId string) error {
if err := m.store.UpdateMfaActive(userId, false); err != nil { if err := m.store.UpdateMfaActive(userId, false); err != nil {
return errors.Wrap(err, "unable to store mfa active") return errors.Wrap(err, "unable to store mfa active")

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

@@ -352,7 +352,7 @@ func (l *Logger) RedirectStdLog(level Level, fields ...Field) func() {
// RemoveTargets safely removes one or more targets based on the filtering method. // RemoveTargets safely removes one or more targets based on the filtering method.
// `f` should return true to delete the target, false to keep it. // `f` should return true to delete the target, false to keep it.
// When removing a target, best effort is made to write any queued log records before // When removing a target, best effort is made to write any queued log records before
// closing, with cxt determining how much time can be spent in total. // closing, with ctx determining how much time can be spent in total.
// Note, keep the timeout short since this method blocks certain logging operations. // Note, keep the timeout short since this method blocks certain logging operations.
func (l *Logger) RemoveTargets(ctx context.Context, f func(ti TargetInfo) bool) error { func (l *Logger) RemoveTargets(ctx context.Context, f func(ti TargetInfo) bool) error {
return l.log.Logr().RemoveTargets(ctx, f) return l.log.Logr().RemoveTargets(ctx, f)
@@ -379,7 +379,7 @@ func (l *Logger) Flush() error {
return l.log.Logr().FlushWithTimeout(ctx) return l.log.Logr().FlushWithTimeout(ctx)
} }
// Flush forces all targets to write out any queued log records with the specfified timeout. // Flush forces all targets to write out any queued log records with the specified timeout.
func (l *Logger) FlushWithTimeout(ctx context.Context) error { func (l *Logger) FlushWithTimeout(ctx context.Context) error {
return l.log.Logr().FlushWithTimeout(ctx) return l.log.Logr().FlushWithTimeout(ctx)
} }

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

@@ -90,7 +90,7 @@ func (s SqlChannelStore) createInitialSidebarCategoriesT(transaction *gorp.Trans
if !hasCategoryOfType[model.SidebarCategoryChannels] { if !hasCategoryOfType[model.SidebarCategoryChannels] {
if err := transaction.Insert(&model.SidebarCategory{ if err := transaction.Insert(&model.SidebarCategory{
DisplayName: "Channels", // This will be retranslateed by the client into the user's locale DisplayName: "Channels", // This will be retranslated by the client into the user's locale
Id: channelsCategoryId, Id: channelsCategoryId,
UserId: userId, UserId: userId,
TeamId: teamId, TeamId: teamId,
@@ -104,7 +104,7 @@ func (s SqlChannelStore) createInitialSidebarCategoriesT(transaction *gorp.Trans
if !hasCategoryOfType[model.SidebarCategoryDirectMessages] { if !hasCategoryOfType[model.SidebarCategoryDirectMessages] {
if err := transaction.Insert(&model.SidebarCategory{ if err := transaction.Insert(&model.SidebarCategory{
DisplayName: "Direct Messages", // This will be retranslateed by the client into the user's locale DisplayName: "Direct Messages", // This will be retranslated by the client into the user's locale
Id: directMessagesCategoryId, Id: directMessagesCategoryId,
UserId: userId, UserId: userId,
TeamId: teamId, TeamId: teamId,

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

@@ -1208,7 +1208,7 @@ func (s SqlTeamStore) UpdateLastTeamIconUpdate(teamId string, curTime int64) err
} }
// GetTeamsByScheme returns from the database all teams that match the schemeId provided as parameter, up to // GetTeamsByScheme returns from the database all teams that match the schemeId provided as parameter, up to
// a total limit passed as paramater and paginated by offset number passed as parameter. // a total limit passed as parameter and paginated by offset number passed as parameter.
func (s SqlTeamStore) GetTeamsByScheme(schemeId string, offset int, limit int) ([]*model.Team, error) { func (s SqlTeamStore) GetTeamsByScheme(schemeId string, offset int, limit int) ([]*model.Team, error) {
query, args, err := s.teamsQuery.Where(sq.Eq{"SchemeId": schemeId}). query, args, err := s.teamsQuery.Where(sq.Eq{"SchemeId": schemeId}).
OrderBy("DisplayName"). OrderBy("DisplayName").
@@ -1381,7 +1381,7 @@ func (s SqlTeamStore) AnalyticsGetTeamCountForScheme(schemeId string) (int64, er
return count, nil return count, nil
} }
// GetAllForExportAfter returns teams for export, up to a total limit passed as paramater where Teams.Id is greater than the afterId passed as parameter. // GetAllForExportAfter returns teams for export, up to a total limit passed as parameter where Teams.Id is greater than the afterId passed as parameter.
func (s SqlTeamStore) GetAllForExportAfter(limit int, afterId string) ([]*model.TeamForExport, error) { func (s SqlTeamStore) GetAllForExportAfter(limit int, afterId string) ([]*model.TeamForExport, error) {
var data []*model.TeamForExport var data []*model.TeamForExport
query, args, err := s.getQueryBuilder(). query, args, err := s.getQueryBuilder().

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

@@ -629,7 +629,7 @@ func (s *SqlThreadStore) MaintainMembership(userId, postId string, opts store.Th
membership, err := s.getMembershipForUser(trx, userId, postId) membership, err := s.getMembershipForUser(trx, userId, postId)
now := utils.MillisFromTime(time.Now()) now := utils.MillisFromTime(time.Now())
// if memebership exists, update it if: // if membership exists, update it if:
// a. user started/stopped following a thread // a. user started/stopped following a thread
// b. mention count changed // b. mention count changed
// c. user viewed a thread // c. user viewed a thread

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

@@ -3879,7 +3879,7 @@ func groupTestAdminRoleGroupsForSyncableMemberChannel(t *testing.T, ss store.Sto
}) })
require.NoError(t, err) require.NoError(t, err)
// User is a member of both groups but only one is SchmeAdmin: true // User is a member of both groups but only one is SchemeAdmin: true
actualGroupIDs, err := ss.Group().AdminRoleGroupsForSyncableMember(user.Id, channel.Id, model.GroupSyncableTypeChannel) actualGroupIDs, err := ss.Group().AdminRoleGroupsForSyncableMember(user.Id, channel.Id, model.GroupSyncableTypeChannel)
require.NoError(t, err) require.NoError(t, err)
require.ElementsMatch(t, []string{group1.Id}, actualGroupIDs) require.ElementsMatch(t, []string{group1.Id}, actualGroupIDs)
@@ -3966,7 +3966,7 @@ func groupTestAdminRoleGroupsForSyncableMemberTeam(t *testing.T, ss store.Store)
}) })
require.NoError(t, err) require.NoError(t, err)
// User is a member of both groups but only one is SchmeAdmin: true // User is a member of both groups but only one is SchemeAdmin: true
actualGroupIDs, err := ss.Group().AdminRoleGroupsForSyncableMember(user.Id, team.Id, model.GroupSyncableTypeTeam) actualGroupIDs, err := ss.Group().AdminRoleGroupsForSyncableMember(user.Id, team.Id, model.GroupSyncableTypeTeam)
require.NoError(t, err) require.NoError(t, err)
require.ElementsMatch(t, []string{group1.Id}, actualGroupIDs) require.ElementsMatch(t, []string{group1.Id}, actualGroupIDs)

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

@@ -4028,7 +4028,7 @@ func testUserStoreAnalyticsActiveCountForPeriod(t *testing.T, ss store.Store, s
// u0 last activity status is two months ago. // u0 last activity status is two months ago.
// u1 last activity status is one month ago // u1 last activity status is one month ago
// u2 last activiy is two days ago // u2 last activity is two days ago
// u2 last activity is one day ago // u2 last activity is one day ago
// u3 last activity is within last day // u3 last activity is within last day
// u4 last activity is within last day // u4 last activity is within last day

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

@@ -19,9 +19,9 @@ It is possible to manually test specific sections of any test, instead of using
## Test plugins ## Test plugins
There are two test plugins: `testplugin.tar.gz` and `testplugin2.tar.gz`. These are use in some integration tests in the `api4` package. Any changes to the plugin bundles require updating the coresponding signatures. There are two test plugins: `testplugin.tar.gz` and `testplugin2.tar.gz`. These are use in some integration tests in the `api4` package. Any changes to the plugin bundles require updating the corresponding signatures.
First, import the public and privat development key: First, import the public and private development key:
``` ```
$ gpg --import ./development-public-key.gpg $ gpg --import ./development-public-key.gpg
$ gpg --import ./development-private-key.asc $ gpg --import ./development-private-key.asc
@@ -29,7 +29,7 @@ $ gpg --import ./development-private-key.asc
This has to be done only once. This has to be done only once.
Then update the sigantures: Then update the signatures:
``` ```
$ gpg -u F3FACE45E0DE642C8BD6A8E64C7C6562C192CC1F --verbose --personal-digest-preferences SHA256 --detach-sign testplugin.tar.gz $ gpg -u F3FACE45E0DE642C8BD6A8E64C7C6562C192CC1F --verbose --personal-digest-preferences SHA256 --detach-sign testplugin.tar.gz
$ gpg -u F3FACE45E0DE642C8BD6A8E64C7C6562C192CC1F --verbose --personal-digest-preferences SHA256 --detach-sign --armor testplugin.tar.gz $ gpg -u F3FACE45E0DE642C8BD6A8E64C7C6562C192CC1F --verbose --personal-digest-preferences SHA256 --detach-sign --armor testplugin.tar.gz

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

@@ -55,7 +55,7 @@ _Italics_
- List - List
- List Sub-item - List Sub-item
[Link](http://i.giphy.com/xNrM4cGJ8u3ao.gif) [Link](http://i.giphy.com/xNrM4cGJ8u3ao.gif)
[![Github](https://assets-cdn.github.com/favicon.ico)](https://github.com/mattermost/platform) [![GitHub](https://assets-cdn.github.com/favicon.ico)](https://github.com/mattermost/platform)
| Left-Aligned Text | Center Aligned Text | Right Aligned Text | | Left-Aligned Text | Center Aligned Text | Right Aligned Text |
| :------------ |:---------------:| -----:| | :------------ |:---------------:| -----:|
| Left column 1 | this text | $100 | | Left column 1 | this text | $100 |

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

@@ -83,7 +83,7 @@ func TestGetIPAddress(t *testing.T) {
assert.Equal(t, "10.1.0.1", GetIPAddress(&httpRequest3, []string{"X-Forwarded-For", "X-Real-Ip"})) assert.Equal(t, "10.1.0.1", GetIPAddress(&httpRequest3, []string{"X-Forwarded-For", "X-Real-Ip"}))
// Test without an X-Fowarded-For // Test without an X-Forwarded-For
httpRequest4 := http.Request{ httpRequest4 := http.Request{
Header: http.Header{ Header: http.Header{
"X-Real-Ip": []string{"10.1.0.1"}, "X-Real-Ip": []string{"10.1.0.1"},

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

@@ -345,7 +345,7 @@ func TestPublicFilesRequest(t *testing.T) {
assert.Equal(t, 301, res.Code) assert.Equal(t, 301, res.Code)
} }
/* Test disabled for now so we don't requrie the client to build. Maybe re-enable after client gets moved out. /* Test disabled for now so we don't require the client to build. Maybe re-enable after client gets moved out.
func TestStatic(t *testing.T) { func TestStatic(t *testing.T) {
Setup() Setup()