[GH-19267] Spelling comments (#19268)
* 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>
Этот коммит содержится в:
4
Makefile
4
Makefile
@@ -580,7 +580,7 @@ config-reset: ## Resets the config/config.json file to the default.
|
||||
diff-config: ## Compares default configuration between two mattermost versions
|
||||
@./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
|
||||
|
||||
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/
|
||||
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:
|
||||
@grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' ./Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
||||
@echo
|
||||
|
||||
@@ -4494,7 +4494,7 @@ SOFTWARE.
|
||||
|
||||
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:
|
||||
* https://github.com/mholt/archiver
|
||||
|
||||
@@ -1706,7 +1706,7 @@ func TestInstallMarketplacePlugin(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
th := SetupConfig(t, func(cfg *model.Config) {
|
||||
// Disable auto-installing prepackged plugins
|
||||
// Disable auto-installing prepackaged plugins
|
||||
*cfg.PluginSettings.AutomaticPrepackagedPlugins = false
|
||||
}).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -2680,7 +2680,7 @@ func TestSetPostUnreadWithoutCollapsedThreads(t *testing.T) {
|
||||
// user2: first root mention @user1
|
||||
// - user1: hello
|
||||
// - user2: mention @u1
|
||||
// - user1: another repoy
|
||||
// - user1: another reply
|
||||
// - user2: another mention @u1
|
||||
// user1: a root post
|
||||
// user2: Another root mention @u1
|
||||
|
||||
@@ -75,7 +75,7 @@ func generateSupportPacket(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
const OutputDirectory = "support_packet"
|
||||
|
||||
// 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) {
|
||||
c.SetPermissionError(model.SysconsoleReadPermissions...)
|
||||
return
|
||||
|
||||
@@ -752,7 +752,7 @@ func TestUpdateIncomingHook(t *testing.T) {
|
||||
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnablePostIconOverride = false })
|
||||
|
||||
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
|
||||
// local mode
|
||||
var err error
|
||||
|
||||
@@ -111,7 +111,7 @@ type AppIface interface {
|
||||
DeleteGroupConstrainedMemberships(c *request.Context) error
|
||||
// DeletePublicKey will delete plugin public key from the config.
|
||||
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.
|
||||
DemoteUserToGuest(user *model.User) *model.AppError
|
||||
// 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,
|
||||
// and if so, accordingly populates the other fields of the webconn.
|
||||
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.
|
||||
PromoteGuestToUser(c *request.Context, user *model.User, requestorId string) *model.AppError
|
||||
// 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)
|
||||
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 {
|
||||
retbot, err2 := th.App.GetBot(bot.UserId, true)
|
||||
require.Nil(t, err2)
|
||||
|
||||
@@ -1048,7 +1048,7 @@ func TestGetPublicChannelsForTeam(t *testing.T) {
|
||||
expectedChannels = append(expectedChannels, rchannel)
|
||||
}
|
||||
|
||||
// Fetch public channels multipile times
|
||||
// Fetch public channels multiple times
|
||||
channelList, err := th.App.GetPublicChannelsForTeam(team.Id, 0, 5)
|
||||
require.Nil(t, err)
|
||||
channelList2, err := th.App.GetPublicChannelsForTeam(team.Id, 5, 5)
|
||||
@@ -1081,7 +1081,7 @@ func TestGetPrivateChannelsForTeam(t *testing.T) {
|
||||
expectedChannels = append(expectedChannels, rchannel)
|
||||
}
|
||||
|
||||
// Fetch private channels multipile times
|
||||
// Fetch private channels multiple times
|
||||
channelList, err := th.App.GetPrivateChannelsForTeam(team.Id, 0, 5)
|
||||
require.Nil(t, err)
|
||||
channelList2, err := th.App.GetPrivateChannelsForTeam(team.Id, 5, 5)
|
||||
@@ -2216,7 +2216,7 @@ func TestMarkChannelAsUnreadFromPostCollapsedThreadsTurnedOff(t *testing.T) {
|
||||
// user2: first root mention @user1
|
||||
// - user1: hello
|
||||
// - user2: mention @u1
|
||||
// - user1: another repoy
|
||||
// - user1: another reply
|
||||
// - user2: another mention @u1
|
||||
// user1: a root post
|
||||
// user2: Another root mention @u1
|
||||
|
||||
@@ -186,11 +186,11 @@ func (job *EmailBatchingJob) checkPendingNotifications(now time.Time, handler fu
|
||||
var interval int64
|
||||
preference, err := job.service.store.Preference().Get(userID, model.PreferenceCategoryNotifications, model.PreferenceNameEmailInterval)
|
||||
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)
|
||||
} else {
|
||||
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)
|
||||
} else {
|
||||
interval = value
|
||||
|
||||
@@ -387,7 +387,7 @@ func TestExportGMandDMChannels(t *testing.T) {
|
||||
channels, nErr = th2.App.Srv().Store.Channel().GetAllDirectChannelsForExportAfter(1000, "00000000")
|
||||
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 })
|
||||
assert.Equal(t, 2, len(channels))
|
||||
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")
|
||||
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 })
|
||||
assert.Equal(t, 4, len(posts))
|
||||
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")
|
||||
}
|
||||
|
||||
// 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.
|
||||
switch header.Typeflag {
|
||||
case tar.TypeDir:
|
||||
|
||||
@@ -55,7 +55,7 @@ func NewSynchronizer(params SyncParams) (*Synchronizer, error) {
|
||||
}, 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 {
|
||||
if err := f.client.BlockUntilReady(10); err != nil {
|
||||
return errors.Wrap(err, "split.io client could not initialize")
|
||||
|
||||
@@ -648,7 +648,7 @@ type UploadFileTask struct {
|
||||
imageType string
|
||||
imageOrientation int
|
||||
|
||||
// Testing: overrideable dependency functions
|
||||
// Testing: overridable dependency functions
|
||||
pluginsEnvironment *plugin.Environment
|
||||
writeFile func(io.Reader, string) (int64, *model.AppError)
|
||||
saveToDatabase func(*model.FileInfo) (*model.FileInfo, error)
|
||||
|
||||
@@ -617,7 +617,7 @@ func TestImportValidateUserImportData(t *testing.T) {
|
||||
data.NotifyProps.MentionKeys = ptrStr("valid")
|
||||
checkNoError(t, validateUserImportData(&data))
|
||||
|
||||
//Test the emai batching interval validators
|
||||
//Test the email batching interval validators
|
||||
//Happy paths
|
||||
data.EmailInterval = ptrStr("immediately")
|
||||
checkNoError(t, validateUserImportData(&data))
|
||||
|
||||
@@ -536,7 +536,7 @@ func (a *App) getAddManageSecureConnectionsPermissionsMigration() (permissionsMa
|
||||
Add: []string{PermissionManageSecureConnections},
|
||||
})
|
||||
|
||||
// remote the decprecated permission from system admin
|
||||
// remote the deprecated permission from system admin
|
||||
transformations = append(transformations,
|
||||
permissionTransformation{
|
||||
On: isRole(model.SystemAdminRoleId),
|
||||
@@ -667,7 +667,7 @@ func (a *App) getAddComplianceSubsectionPermissions() (permissionsMap, error) {
|
||||
Add: permissionsComplianceWrite,
|
||||
})
|
||||
|
||||
// Ancilary permissions
|
||||
// Ancillary permissions
|
||||
transformations = append(transformations, permissionTransformation{
|
||||
On: permissionExists(model.PermissionSysconsoleWriteComplianceDataRetentionPolicy.Id),
|
||||
Add: []string{model.PermissionCreateDataRetentionJob.Id},
|
||||
|
||||
@@ -639,7 +639,7 @@ func (a *App) mergePrepackagedPlugins(remoteMarketplacePlugins map[string]*model
|
||||
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)
|
||||
if err != nil {
|
||||
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()
|
||||
|
||||
// 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 {
|
||||
rPostCopy.Metadata = rPostCopy.Metadata.Copy()
|
||||
}
|
||||
|
||||
@@ -515,7 +515,7 @@ func (a *App) getLinkMetadata(requestURL string, timestamp int64, isNewPost bool
|
||||
referencedPostID := requestURL[len(requestURL)-26:]
|
||||
|
||||
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 {
|
||||
return nil, nil, nil, appErr
|
||||
}
|
||||
|
||||
@@ -929,7 +929,7 @@ func TestGetTeamMembers(t *testing.T) {
|
||||
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)
|
||||
require.Nil(t, err)
|
||||
|
||||
|
||||
@@ -2037,7 +2037,7 @@ func (a *App) GetViewUsersRestrictions(userID string) (*model.ViewUsersRestricti
|
||||
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.
|
||||
func (a *App) PromoteGuestToUser(c *request.Context, user *model.User, requestorId string) *model.AppError {
|
||||
nErr := a.ch.srv.userService.PromoteGuestToUser(user)
|
||||
@@ -2097,7 +2097,7 @@ func (a *App) PromoteGuestToUser(c *request.Context, user *model.User, requestor
|
||||
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.
|
||||
func (a *App) DemoteUserToGuest(user *model.User) *model.AppError {
|
||||
demotedUser, nErr := a.ch.srv.userService.DemoteUserToGuest(user)
|
||||
|
||||
@@ -120,7 +120,7 @@ func TestAdjustProfileImage(t *testing.T) {
|
||||
assert.True(t, adjusted.Len() > 0)
|
||||
assert.NotEqual(t, testjpg, adjusted)
|
||||
|
||||
// default image should require adjustement
|
||||
// default image should require adjustment
|
||||
user := th.BasicUser
|
||||
image, err := th.App.GetDefaultProfileImage(user)
|
||||
require.Nil(t, err)
|
||||
@@ -524,7 +524,7 @@ func TestUpdateUserEmail(t *testing.T) {
|
||||
tokens, err = th.App.Srv().Store.Token().GetAllTokensByType(TokenTypeVerifyEmail)
|
||||
// We verify the same conditions as the earlier function,
|
||||
// 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.
|
||||
return err == nil && len(tokens) == 1 && tokens[0].Token != firstToken.Token
|
||||
}, 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
|
||||
// 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 {
|
||||
id := "model.user.is_valid.pwd"
|
||||
isError := false
|
||||
|
||||
@@ -35,7 +35,7 @@ func main() {
|
||||
"keycloak": 8080,
|
||||
"prometheus": 9090,
|
||||
"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{}
|
||||
for _, arg := range os.Args[1:] {
|
||||
|
||||
@@ -20,7 +20,7 @@ RUN_SERVER_IN_BACKGROUND ?= true
|
||||
|
||||
# Data loaded by default in openldap when container starts.
|
||||
#
|
||||
# Posible options: test or qa
|
||||
# Possible options: test or qa
|
||||
LDAP_DATA ?= test
|
||||
|
||||
# Mock the CWS.
|
||||
|
||||
@@ -17,7 +17,7 @@ type ChannelCounts struct {
|
||||
}
|
||||
|
||||
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{}
|
||||
for id := range o.Counts {
|
||||
ids = append(ids, id)
|
||||
|
||||
@@ -1978,7 +1978,7 @@ func (c *Client4) GetBotsIncludeDeleted(page, perPage int, etag string) ([]*Bot,
|
||||
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) {
|
||||
query := fmt.Sprintf("?page=%v&per_page=%v&only_orphaned="+c.boolString(true), page, perPage)
|
||||
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 []*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
|
||||
// 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.
|
||||
|
||||
@@ -558,7 +558,7 @@ func (r *Role) GetChannelModeratedPermissions(channelType ChannelType) map[strin
|
||||
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 {
|
||||
permissionsToAddToPatch := make(map[string]bool)
|
||||
|
||||
|
||||
2
model/testdata/markdown-sample-with-rewritten-image-urls.md
поставляемый
2
model/testdata/markdown-sample-with-rewritten-image-urls.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).
|
||||
|
||||
|
||||
### [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:
|
||||
>
|
||||
|
||||
2
model/testdata/markdown-sample.md
поставляемый
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).
|
||||
|
||||
|
||||
### [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:
|
||||
>
|
||||
|
||||
@@ -703,7 +703,7 @@ func IsValidUserRoles(userRoles string) bool {
|
||||
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.
|
||||
func (u *User) IsGuest() bool {
|
||||
return IsInRole(u.Roles, SystemGuestRoleId)
|
||||
@@ -713,13 +713,13 @@ func (u *User) IsSystemAdmin() bool {
|
||||
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.
|
||||
func (u *User) IsInRole(inRole string) bool {
|
||||
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.
|
||||
func IsInRole(userRoles string, inRole string) bool {
|
||||
roles := strings.Split(userRoles, " ")
|
||||
|
||||
4
services/cache/cache.go
поставляемый
4
services/cache/cache.go
поставляемый
@@ -23,11 +23,11 @@ type Cache interface {
|
||||
Set(key string, value interface{}) error
|
||||
|
||||
// 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
|
||||
|
||||
// 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
|
||||
|
||||
// Get the content stored in the cache for the given key, and decode it into the value interface.
|
||||
|
||||
4
services/cache/lru.go
поставляемый
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
|
||||
// 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 {
|
||||
return l.SetWithExpiry(key, value, l.defaultExpiry)
|
||||
}
|
||||
|
||||
// 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 {
|
||||
return l.set(key, value, ttl)
|
||||
}
|
||||
|
||||
2
services/cache/provider.go
поставляемый
2
services/cache/provider.go
поставляемый
@@ -9,7 +9,7 @@ import (
|
||||
"github.com/mattermost/mattermost-server/v6/model"
|
||||
)
|
||||
|
||||
// CacheOptions contains options for initializaing a cache
|
||||
// CacheOptions contains options for initializing a cache
|
||||
type CacheOptions struct {
|
||||
Size int
|
||||
DefaultExpiry time.Duration
|
||||
|
||||
@@ -23,7 +23,7 @@ type customTransport struct {
|
||||
|
||||
// RoundTrip implements the http.Roundtripper interface.
|
||||
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.URL = *req.URL
|
||||
req.URL.Scheme = t.scheme
|
||||
|
||||
@@ -106,7 +106,7 @@ func (m *MFA) Activate(userMfaSecret, userID string, token string) error {
|
||||
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 {
|
||||
if err := m.store.UpdateMfaActive(userId, false); err != nil {
|
||||
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.
|
||||
// `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
|
||||
// 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.
|
||||
func (l *Logger) RemoveTargets(ctx context.Context, f func(ti TargetInfo) bool) error {
|
||||
return l.log.Logr().RemoveTargets(ctx, f)
|
||||
@@ -379,7 +379,7 @@ func (l *Logger) Flush() error {
|
||||
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 {
|
||||
return l.log.Logr().FlushWithTimeout(ctx)
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ func (s SqlChannelStore) createInitialSidebarCategoriesT(transaction *gorp.Trans
|
||||
|
||||
if !hasCategoryOfType[model.SidebarCategoryChannels] {
|
||||
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,
|
||||
UserId: userId,
|
||||
TeamId: teamId,
|
||||
@@ -104,7 +104,7 @@ func (s SqlChannelStore) createInitialSidebarCategoriesT(transaction *gorp.Trans
|
||||
|
||||
if !hasCategoryOfType[model.SidebarCategoryDirectMessages] {
|
||||
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,
|
||||
UserId: userId,
|
||||
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
|
||||
// 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) {
|
||||
query, args, err := s.teamsQuery.Where(sq.Eq{"SchemeId": schemeId}).
|
||||
OrderBy("DisplayName").
|
||||
@@ -1381,7 +1381,7 @@ func (s SqlTeamStore) AnalyticsGetTeamCountForScheme(schemeId string) (int64, er
|
||||
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) {
|
||||
var data []*model.TeamForExport
|
||||
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)
|
||||
now := utils.MillisFromTime(time.Now())
|
||||
// if memebership exists, update it if:
|
||||
// if membership exists, update it if:
|
||||
// a. user started/stopped following a thread
|
||||
// b. mention count changed
|
||||
// c. user viewed a thread
|
||||
|
||||
@@ -3879,7 +3879,7 @@ func groupTestAdminRoleGroupsForSyncableMemberChannel(t *testing.T, ss store.Sto
|
||||
})
|
||||
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)
|
||||
require.NoError(t, err)
|
||||
require.ElementsMatch(t, []string{group1.Id}, actualGroupIDs)
|
||||
@@ -3966,7 +3966,7 @@ func groupTestAdminRoleGroupsForSyncableMemberTeam(t *testing.T, ss store.Store)
|
||||
})
|
||||
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)
|
||||
require.NoError(t, err)
|
||||
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.
|
||||
// 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
|
||||
// u3 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
|
||||
|
||||
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-private-key.asc
|
||||
@@ -29,7 +29,7 @@ $ gpg --import ./development-private-key.asc
|
||||
|
||||
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 --armor testplugin.tar.gz
|
||||
|
||||
@@ -55,7 +55,7 @@ _Italics_
|
||||
- List
|
||||
- List Sub-item
|
||||
[Link](http://i.giphy.com/xNrM4cGJ8u3ao.gif)
|
||||
[](https://github.com/mattermost/platform)
|
||||
[](https://github.com/mattermost/platform)
|
||||
| Left-Aligned Text | Center Aligned Text | Right Aligned Text |
|
||||
| :------------ |:---------------:| -----:|
|
||||
| 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"}))
|
||||
|
||||
// Test without an X-Fowarded-For
|
||||
// Test without an X-Forwarded-For
|
||||
httpRequest4 := http.Request{
|
||||
Header: http.Header{
|
||||
"X-Real-Ip": []string{"10.1.0.1"},
|
||||
|
||||
@@ -345,7 +345,7 @@ func TestPublicFilesRequest(t *testing.T) {
|
||||
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) {
|
||||
Setup()
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user