mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
spelling (#19956)
* spelling: activated Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: attachments Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: categories Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: category Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: cellspacing Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: channel Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: compliance Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: constraint Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: counts Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: createat Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: deactivate Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: destination Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: exceeded Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: failed Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: foreign Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: hours Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: inactivity Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: inappropriate Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: initialization Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: initialized Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: management Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: mismatch Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: recipients Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: scheme Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: signature Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: subscription Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: suggestions Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: sync Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: telemetry Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: webhook Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * Trigger CI ```release-note NONE ``` Co-authored-by: Josh Soref <jsoref@users.noreply.github.com> Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
This commit is contained in:
@@ -339,7 +339,7 @@ func getInvoicesForSubscription(c *Context, w http.ResponseWriter, r *http.Reque
|
||||
|
||||
func getSubscriptionInvoicePDF(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
if c.App.Channels().License() == nil || !*c.App.Channels().License().Features.Cloud {
|
||||
c.Err = model.NewAppError("Api4.getSuscriptionInvoicePDF", "api.cloud.license_error", nil, "", http.StatusNotImplemented)
|
||||
c.Err = model.NewAppError("Api4.getSubscriptionInvoicePDF", "api.cloud.license_error", nil, "", http.StatusNotImplemented)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -355,7 +355,7 @@ func getSubscriptionInvoicePDF(c *Context, w http.ResponseWriter, r *http.Reques
|
||||
|
||||
pdfData, filename, appErr := c.App.Cloud().GetInvoicePDF(c.AppContext.Session().UserId, c.Params.InvoiceId)
|
||||
if appErr != nil {
|
||||
c.Err = model.NewAppError("Api4.getSuscriptionInvoicePDF", "api.cloud.request_error", nil, appErr.Error(), http.StatusInternalServerError)
|
||||
c.Err = model.NewAppError("Api4.getSubscriptionInvoicePDF", "api.cloud.request_error", nil, appErr.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -1429,15 +1429,15 @@ func updateUserActive(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
auditRec.AddMeta("active", active)
|
||||
|
||||
// true when you're trying to de-activate yourself
|
||||
isSelfDeactive := !active && c.Params.UserId == c.AppContext.Session().UserId
|
||||
isSelfDeactivate := !active && c.Params.UserId == c.AppContext.Session().UserId
|
||||
|
||||
if !isSelfDeactive && !c.App.SessionHasPermissionTo(*c.AppContext.Session(), model.PermissionSysconsoleWriteUserManagementUsers) {
|
||||
if !isSelfDeactivate && !c.App.SessionHasPermissionTo(*c.AppContext.Session(), model.PermissionSysconsoleWriteUserManagementUsers) {
|
||||
c.Err = model.NewAppError("updateUserActive", "api.user.update_active.permissions.app_error", nil, "userId="+c.Params.UserId, http.StatusForbidden)
|
||||
return
|
||||
}
|
||||
|
||||
// if EnableUserDeactivation flag is disabled the user cannot deactivate himself.
|
||||
if isSelfDeactive && !*c.App.Config().TeamSettings.EnableUserDeactivation {
|
||||
if isSelfDeactivate && !*c.App.Config().TeamSettings.EnableUserDeactivation {
|
||||
c.Err = model.NewAppError("updateUserActive", "api.user.update_active.not_enable.app_error", nil, "userId="+c.Params.UserId, http.StatusUnauthorized)
|
||||
return
|
||||
}
|
||||
@@ -1466,7 +1466,7 @@ func updateUserActive(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
auditRec.Success()
|
||||
c.LogAudit(fmt.Sprintf("user_id=%s active=%v", user.Id, active))
|
||||
|
||||
if isSelfDeactive {
|
||||
if isSelfDeactivate {
|
||||
c.App.Srv().Go(func() {
|
||||
if err := c.App.Srv().EmailService.SendDeactivateAccountEmail(user.Email, user.Locale, c.App.GetSiteURL()); err != nil {
|
||||
c.LogErrorByCode(model.NewAppError("SendDeactivateEmail", "api.user.send_deactivate_email_and_forget.failed.error", nil, err.Error(), http.StatusInternalServerError))
|
||||
|
||||
@@ -59,7 +59,7 @@ func createIncomingHook(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
userId := c.AppContext.Session().UserId
|
||||
if hook.UserId != "" && hook.UserId != userId {
|
||||
if !c.App.SessionHasPermissionToTeam(*c.AppContext.Session(), channel.TeamId, model.PermissionManageOthersIncomingWebhooks) {
|
||||
c.LogAudit("fail - innapropriate permissions")
|
||||
c.LogAudit("fail - inappropriate permissions")
|
||||
c.SetPermissionError(model.PermissionManageOthersIncomingWebhooks)
|
||||
return
|
||||
}
|
||||
@@ -414,7 +414,7 @@ func createOutgoingHook(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
hook.CreatorId = c.AppContext.Session().UserId
|
||||
} else {
|
||||
if !c.App.SessionHasPermissionToTeam(*c.AppContext.Session(), hook.TeamId, model.PermissionManageOthersOutgoingWebhooks) {
|
||||
c.LogAudit("fail - innapropriate permissions")
|
||||
c.LogAudit("fail - inappropriate permissions")
|
||||
c.SetPermissionError(model.PermissionManageOthersOutgoingWebhooks)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ func (a *App) TestEmail(userID string, cfg *model.Config) *model.AppError {
|
||||
func (s *Server) serverBusyStateChanged(sbs *model.ServerBusyState) {
|
||||
s.Busy.ClusterEventChanged(sbs)
|
||||
if sbs.Busy {
|
||||
mlog.Warn("server busy state activitated via cluster event - non-critical services disabled", mlog.Int64("expires_sec", sbs.Expires))
|
||||
mlog.Warn("server busy state activated via cluster event - non-critical services disabled", mlog.Int64("expires_sec", sbs.Expires))
|
||||
} else {
|
||||
mlog.Info("server busy state cleared via cluster event - non-critical services enabled")
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ func (a *App) GetComplianceReport(reportId string) (*model.Compliance, *model.Ap
|
||||
var nfErr *store.ErrNotFound
|
||||
switch {
|
||||
case errors.As(err, &nfErr):
|
||||
return nil, model.NewAppError("GetComplicanceReport", "app.compliance.get.finding.app_error", nil, nfErr.Error(), http.StatusNotFound)
|
||||
return nil, model.NewAppError("GetComplianceReport", "app.compliance.get.finding.app_error", nil, nfErr.Error(), http.StatusNotFound)
|
||||
default:
|
||||
return nil, model.NewAppError("GetComplianceReport", "app.compliance.get.finding.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ func (s *Server) setupFeatureFlags() {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Server) updateFeatureFlagValuesFromManagment() {
|
||||
func (s *Server) updateFeatureFlagValuesFromManagement() {
|
||||
newCfg := s.configStore.GetNoEnv().Clone()
|
||||
oldFlags := *newCfg.FeatureFlags
|
||||
newFlags := s.featureFlagSynchronizer.UpdateFeatureFlagValues(oldFlags)
|
||||
@@ -94,13 +94,13 @@ func (s *Server) startFeatureFlagUpdateJob() error {
|
||||
s.Log.Warn("Problem connecting to feature flag management. Will fallback to cloud cache.", mlog.Err(err))
|
||||
return
|
||||
}
|
||||
s.updateFeatureFlagValuesFromManagment()
|
||||
s.updateFeatureFlagValuesFromManagement()
|
||||
for {
|
||||
select {
|
||||
case <-s.featureFlagStop:
|
||||
return
|
||||
case <-ticker.C:
|
||||
s.updateFeatureFlagValuesFromManagment()
|
||||
s.updateFeatureFlagValuesFromManagement()
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
@@ -832,13 +832,13 @@ func (a *App) importUserTeams(user *model.User, data *[]UserTeamImportData) *mod
|
||||
if nErr != nil {
|
||||
var appErr *model.AppError
|
||||
var conflictErr *store.ErrConflict
|
||||
var limitExeededErr *store.ErrLimitExceeded
|
||||
var limitExceededErr *store.ErrLimitExceeded
|
||||
switch {
|
||||
case errors.As(nErr, &appErr): // in case we haven't converted to plain error.
|
||||
return appErr
|
||||
case errors.As(nErr, &conflictErr):
|
||||
return model.NewAppError("BulkImport", "app.import.import_user_teams.save_members.conflict.app_error", nil, nErr.Error(), http.StatusBadRequest)
|
||||
case errors.As(nErr, &limitExeededErr):
|
||||
case errors.As(nErr, &limitExceededErr):
|
||||
return model.NewAppError("BulkImport", "app.import.import_user_teams.save_members.max_accounts.app_error", nil, nErr.Error(), http.StatusBadRequest)
|
||||
default: // last fallback in case it doesn't map to an existing app error.
|
||||
return model.NewAppError("BulkImport", "app.import.import_user_teams.save_members.error", nil, nErr.Error(), http.StatusInternalServerError)
|
||||
|
||||
@@ -509,13 +509,13 @@ func (a *App) doLocalWarnMetricsRequest(c *request.Context, rawURL string, upstr
|
||||
},
|
||||
},
|
||||
)
|
||||
attachements := []*model.SlackAttachment{{
|
||||
attachments := []*model.SlackAttachment{{
|
||||
AuthorName: "",
|
||||
Title: "",
|
||||
Actions: actions,
|
||||
Text: i18n.T("api.server.warn_metric.bot_response.notification_failure.body"),
|
||||
}}
|
||||
model.ParseSlackAttachment(botPost, attachements)
|
||||
model.ParseSlackAttachment(botPost, attachments)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -338,10 +338,10 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod
|
||||
}
|
||||
|
||||
if *a.Config().EmailSettings.SendEmailNotifications {
|
||||
emailReceipients := append(mentionedUsersList, notificationsForCRT.Email...)
|
||||
emailReceipients = model.RemoveDuplicateStrings(emailReceipients)
|
||||
emailRecipients := append(mentionedUsersList, notificationsForCRT.Email...)
|
||||
emailRecipients = model.RemoveDuplicateStrings(emailRecipients)
|
||||
|
||||
for _, id := range emailReceipients {
|
||||
for _, id := range emailRecipients {
|
||||
if profileMap[id] == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ func SetLogger(logger *mlog.Logger) Option {
|
||||
}
|
||||
}
|
||||
|
||||
func SkipPostInitializiation() Option {
|
||||
func SkipPostInitialization() Option {
|
||||
return func(s *Server) error {
|
||||
s.skipPostInit = true
|
||||
|
||||
|
||||
@@ -98,12 +98,12 @@ func (ch *Channels) verifyPlugin(plugin, signature io.ReadSeeker) *model.AppErro
|
||||
return model.NewAppError("VerifyPlugin", "api.plugin.verify_plugin.app_error", nil, "", http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
func verifySignature(publicKey, message, signatrue io.Reader) error {
|
||||
func verifySignature(publicKey, message, signature io.Reader) error {
|
||||
pk, err := decodeIfArmored(publicKey)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "can't decode public key")
|
||||
}
|
||||
s, err := decodeIfArmored(signatrue)
|
||||
s, err := decodeIfArmored(signature)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "can't decode signature")
|
||||
}
|
||||
|
||||
@@ -630,7 +630,7 @@ func NewServer(options ...Option) (*Server, error) {
|
||||
go func() {
|
||||
appInstance := New(ServerConnector(s.Channels()))
|
||||
if err := appInstance.UpdateProductNotices(); err != nil {
|
||||
mlog.Warn("Failied to perform initial product notices fetch", mlog.Err(err))
|
||||
mlog.Warn("Failed to perform initial product notices fetch", mlog.Err(err))
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
@@ -27,8 +27,8 @@ func (s *Server) doInactivityCheck() {
|
||||
return
|
||||
}
|
||||
|
||||
inactivityDurationHourseEnv := os.Getenv("MM_INACTIVITY_DURATION")
|
||||
inactivityDurationHours, parseError := strconv.ParseFloat(inactivityDurationHourseEnv, 64)
|
||||
inactivityDurationHoursEnv := os.Getenv("MM_INACTIVITY_DURATION")
|
||||
inactivityDurationHours, parseError := strconv.ParseFloat(inactivityDurationHoursEnv, 64)
|
||||
if parseError != nil {
|
||||
// default to 100 hours
|
||||
inactivityDurationHours = serverInactivityHours
|
||||
@@ -50,14 +50,14 @@ func (s *Server) doInactivityCheck() {
|
||||
if systemValue != nil {
|
||||
sysT, _ := strconv.ParseInt(systemValue.Value, 10, 64)
|
||||
tt := time.Unix(sysT/1000, 0)
|
||||
timeLastSentInativityEmail := time.Since(tt).Hours()
|
||||
timeLastSentInactivityEmail := time.Since(tt).Hours()
|
||||
|
||||
lastPostAt, _ := s.Store.Post().GetLastPostRowCreateAt()
|
||||
if lastPostAt != 0 {
|
||||
posT := time.Unix(lastPostAt/1000, 0)
|
||||
timeForLastPost := time.Since(posT).Hours()
|
||||
|
||||
if timeLastSentInativityEmail > inactivityDurationHours && timeForLastPost > inactivityDurationHours {
|
||||
if timeLastSentInactivityEmail > inactivityDurationHours && timeForLastPost > inactivityDurationHours {
|
||||
s.takeInactivityAction()
|
||||
}
|
||||
return
|
||||
@@ -68,7 +68,7 @@ func (s *Server) doInactivityCheck() {
|
||||
sesT := time.Unix(lastSessionAt/1000, 0)
|
||||
timeForLastSession := time.Since(sesT).Hours()
|
||||
|
||||
if timeLastSentInativityEmail > inactivityDurationHours && timeForLastSession > inactivityDurationHours {
|
||||
if timeLastSentInactivityEmail > inactivityDurationHours && timeForLastSession > inactivityDurationHours {
|
||||
s.takeInactivityAction()
|
||||
}
|
||||
return
|
||||
|
||||
@@ -650,7 +650,7 @@ func (a *App) JoinUserToTeam(c *request.Context, team *model.Team, user *model.U
|
||||
if err != nil {
|
||||
var appErr *model.AppError
|
||||
var conflictErr *store.ErrConflict
|
||||
var limitExeededErr *store.ErrLimitExceeded
|
||||
var limitExceededErr *store.ErrLimitExceeded
|
||||
switch {
|
||||
case errors.Is(err, teams.AcceptedDomainError):
|
||||
return nil, model.NewAppError("JoinUserToTeam", "api.team.join_user_to_team.allowed_domains.app_error", nil, "", http.StatusBadRequest)
|
||||
@@ -662,7 +662,7 @@ func (a *App) JoinUserToTeam(c *request.Context, team *model.Team, user *model.U
|
||||
return nil, appErr
|
||||
case errors.As(err, &conflictErr):
|
||||
return nil, model.NewAppError("JoinUserToTeam", "app.team.join_user_to_team.save_member.conflict.app_error", nil, err.Error(), http.StatusBadRequest)
|
||||
case errors.As(err, &limitExeededErr):
|
||||
case errors.As(err, &limitExceededErr):
|
||||
return nil, model.NewAppError("JoinUserToTeam", "app.team.join_user_to_team.save_member.max_accounts.app_error", nil, err.Error(), http.StatusBadRequest)
|
||||
default: // last fallback in case it doesn't map to an existing app error.
|
||||
return nil, model.NewAppError("JoinUserToTeam", "app.team.join_user_to_team.save_member.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
|
||||
@@ -147,9 +147,9 @@ SET @preparedStatement = (SELECT IF(
|
||||
'SELECT 1'
|
||||
));
|
||||
|
||||
PREPARE updateIfMissmatch FROM @preparedStatement;
|
||||
EXECUTE updateIfMissmatch;
|
||||
DEALLOCATE PREPARE updateIfMissmatch;
|
||||
PREPARE updateIfMismatch FROM @preparedStatement;
|
||||
EXECUTE updateIfMismatch;
|
||||
DEALLOCATE PREPARE updateIfMismatch;
|
||||
|
||||
SET @preparedStatement = (SELECT IF(
|
||||
(
|
||||
|
||||
@@ -8,6 +8,6 @@ import (
|
||||
)
|
||||
|
||||
type AccountMigrationInterface interface {
|
||||
MigrateToLdap(fromAuthService string, forignUserFieldNameToMatch string, force bool, dryRun bool) *model.AppError
|
||||
MigrateToLdap(fromAuthService string, foreignUserFieldNameToMatch string, force bool, dryRun bool) *model.AppError
|
||||
MigrateToSaml(fromAuthService string, usersMap map[string]string, auto bool, dryRun bool) *model.AppError
|
||||
}
|
||||
|
||||
@@ -14,13 +14,13 @@ type AccountMigrationInterface struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// MigrateToLdap provides a mock function with given fields: fromAuthService, forignUserFieldNameToMatch, force, dryRun
|
||||
func (_m *AccountMigrationInterface) MigrateToLdap(fromAuthService string, forignUserFieldNameToMatch string, force bool, dryRun bool) *model.AppError {
|
||||
ret := _m.Called(fromAuthService, forignUserFieldNameToMatch, force, dryRun)
|
||||
// MigrateToLdap provides a mock function with given fields: fromAuthService, foreignUserFieldNameToMatch, force, dryRun
|
||||
func (_m *AccountMigrationInterface) MigrateToLdap(fromAuthService string, foreignUserFieldNameToMatch string, force bool, dryRun bool) *model.AppError {
|
||||
ret := _m.Called(fromAuthService, foreignUserFieldNameToMatch, force, dryRun)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(string, string, bool, bool) *model.AppError); ok {
|
||||
r0 = rf(fromAuthService, forignUserFieldNameToMatch, force, dryRun)
|
||||
r0 = rf(fromAuthService, foreignUserFieldNameToMatch, force, dryRun)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AppError)
|
||||
|
||||
@@ -260,7 +260,7 @@ type Hooks interface {
|
||||
// Minimum server version: 6.5
|
||||
OnInstall(c *Context, event model.OnInstallEvent) error
|
||||
|
||||
// OnSendDailyTelemetry is invoked when the server send the daily telemtry data.
|
||||
// OnSendDailyTelemetry is invoked when the server send the daily telemetry data.
|
||||
//
|
||||
// Minimum server version: 6.5
|
||||
OnSendDailyTelemetry()
|
||||
|
||||
@@ -80,12 +80,12 @@ func BLVUserFromUserAndTeams(user *model.User, teamsIds, channelsIds []string) *
|
||||
fullnameSuggestions = searchengine.GetSuggestionInputsSplitBy(fullname, " ")
|
||||
}
|
||||
|
||||
nicknameSuggesitons := []string{}
|
||||
nicknameSuggestions := []string{}
|
||||
if user.Nickname != "" {
|
||||
nicknameSuggesitons = searchengine.GetSuggestionInputsSplitBy(user.Nickname, " ")
|
||||
nicknameSuggestions = searchengine.GetSuggestionInputsSplitBy(user.Nickname, " ")
|
||||
}
|
||||
|
||||
usernameAndNicknameSuggestions := append(usernameSuggestions, nicknameSuggesitons...)
|
||||
usernameAndNicknameSuggestions := append(usernameSuggestions, nicknameSuggestions...)
|
||||
|
||||
return &BLVUser{
|
||||
Id: user.Id,
|
||||
|
||||
@@ -62,7 +62,7 @@ func New() (*Tracer, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
mlog.Info("Opentracing initialzed")
|
||||
mlog.Info("Opentracing initialized")
|
||||
return &Tracer{
|
||||
closer: closer,
|
||||
}, nil
|
||||
|
||||
@@ -297,7 +297,7 @@ func (b *S3FileBackend) MoveFile(oldPath, newPath string) error {
|
||||
}
|
||||
|
||||
if _, err := b.client.CopyObject(context.Background(), dstOpts, srcOpts); err != nil {
|
||||
return errors.Wrapf(err, "unable to copy the file to %s to the new destionation", newPath)
|
||||
return errors.Wrapf(err, "unable to copy the file to %s to the new destination", newPath)
|
||||
}
|
||||
|
||||
if err := b.client.RemoveObject(context.Background(), b.bucket, oldPath, s3.RemoveObjectOptions{}); err != nil {
|
||||
|
||||
@@ -143,7 +143,7 @@ type ErrUniqueConstraint struct {
|
||||
// Examples:
|
||||
//
|
||||
// store.NewErrUniqueConstraint("DisplayName") // single column constraint
|
||||
// store.NewErrUniqueConstraint("Name", "Source") // multi-column constaint
|
||||
// store.NewErrUniqueConstraint("Name", "Source") // multi-column constraint
|
||||
func NewErrUniqueConstraint(columns ...string) *ErrUniqueConstraint {
|
||||
return &ErrUniqueConstraint{
|
||||
Columns: columns,
|
||||
|
||||
@@ -35,8 +35,8 @@ const (
|
||||
EmojiCacheSize = 5000
|
||||
EmojiCacheSec = 30 * 60
|
||||
|
||||
ChannelPinnedPostsCounsCacheSize = model.ChannelCacheSize
|
||||
ChannelPinnedPostsCountsCacheSec = 30 * 60
|
||||
ChannelPinnedPostsCountsCacheSize = model.ChannelCacheSize
|
||||
ChannelPinnedPostsCountsCacheSec = 30 * 60
|
||||
|
||||
ChannelMembersCountsCacheSize = model.ChannelCacheSize
|
||||
ChannelMembersCountsCacheSec = 30 * 60
|
||||
@@ -206,7 +206,7 @@ func NewLocalCacheLayer(baseStore store.Store, metrics einterfaces.MetricsInterf
|
||||
|
||||
// Channels
|
||||
if localCacheStore.channelPinnedPostCountsCache, err = cacheProvider.NewCache(&cache.CacheOptions{
|
||||
Size: ChannelPinnedPostsCounsCacheSize,
|
||||
Size: ChannelPinnedPostsCountsCacheSize,
|
||||
Name: "ChannelPinnedPostsCounts",
|
||||
DefaultExpiry: ChannelPinnedPostsCountsCacheSec * time.Second,
|
||||
InvalidateClusterEvent: model.ClusterEventInvalidateCacheForChannelPinnedpostsCounts,
|
||||
|
||||
@@ -1326,7 +1326,7 @@ func (s SqlChannelStore) GetPrivateChannelsForTeam(teamId string, offset int, li
|
||||
|
||||
err = s.GetReplicaX().Select(&channels, query, args...)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to find chaneld with teamId=%s", teamId)
|
||||
return nil, errors.Wrapf(err, "failed to find channel with teamId=%s", teamId)
|
||||
}
|
||||
return channels, nil
|
||||
}
|
||||
@@ -1349,7 +1349,7 @@ func (s SqlChannelStore) GetPublicChannelsForTeam(teamId string, offset int, lim
|
||||
`, teamId, limit, offset)
|
||||
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to find chaneld with teamId=%s", teamId)
|
||||
return nil, errors.Wrapf(err, "failed to find channel with teamId=%s", teamId)
|
||||
}
|
||||
|
||||
return channels, nil
|
||||
@@ -2229,7 +2229,7 @@ func (s SqlChannelStore) GetMemberCount(channelId string, allowFromCache bool) (
|
||||
AND ChannelMembers.ChannelId = ?
|
||||
AND Users.DeleteAt = 0`, channelId)
|
||||
if err != nil {
|
||||
return 0, errors.Wrapf(err, "failed to count ChanenelMembers with channelId=%s", channelId)
|
||||
return 0, errors.Wrapf(err, "failed to count ChannelMembers with channelId=%s", channelId)
|
||||
}
|
||||
|
||||
return count, nil
|
||||
|
||||
@@ -683,7 +683,7 @@ func (s SqlChannelStore) UpdateSidebarCategories(userId, teamId string, categori
|
||||
).ToSql()
|
||||
|
||||
if err2 != nil {
|
||||
return nil, nil, errors.Wrap(err2, "update_sidebar_catetories_tosql")
|
||||
return nil, nil, errors.Wrap(err2, "update_sidebar_categories_tosql")
|
||||
}
|
||||
|
||||
if _, err = transaction.Exec(query, args...); err != nil {
|
||||
@@ -1017,7 +1017,7 @@ func (s SqlChannelStore) DeleteSidebarCategory(categoryId string) error {
|
||||
Delete("SidebarCategories").
|
||||
Where(sq.Eq{"Id": categoryId}).ToSql()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "delete_sidebar_cateory_tosql")
|
||||
return errors.Wrap(err, "delete_sidebar_category_tosql")
|
||||
}
|
||||
if _, err = transaction.Exec(query, args...); err != nil {
|
||||
return errors.Wrap(err, "failed to delete SidebarCategory")
|
||||
@@ -1028,7 +1028,7 @@ func (s SqlChannelStore) DeleteSidebarCategory(categoryId string) error {
|
||||
Delete("SidebarChannels").
|
||||
Where(sq.Eq{"CategoryId": categoryId}).ToSql()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "delete_sidebar_cateory_tosql")
|
||||
return errors.Wrap(err, "delete_sidebar_category_tosql")
|
||||
}
|
||||
if _, err = transaction.Exec(query, args...); err != nil {
|
||||
return errors.Wrap(err, "failed to delete SidebarChannel")
|
||||
|
||||
@@ -226,7 +226,7 @@ func (me *SqlSessionStore) GetLastSessionRowCreateAt() (int64, error) {
|
||||
var createAt int64
|
||||
err := me.GetReplicaX().Get(&createAt, query)
|
||||
if err != nil {
|
||||
return 0, errors.Wrapf(err, "failed to get last session creatat")
|
||||
return 0, errors.Wrapf(err, "failed to get last session createat")
|
||||
}
|
||||
|
||||
return createAt, nil
|
||||
|
||||
@@ -809,7 +809,7 @@ func (s SqlSharedChannelStore) UpdateAttachmentLastSyncAt(id string, syncTime in
|
||||
|
||||
result, err := s.GetMasterX().Exec(squery, args...)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to update LastSycnAt for SharedChannelAttachment")
|
||||
return errors.Wrap(err, "failed to update LastSyncAt for SharedChannelAttachment")
|
||||
}
|
||||
|
||||
count, err := result.RowsAffected()
|
||||
|
||||
@@ -1391,7 +1391,7 @@ func (s SqlTeamStore) AnalyticsGetTeamCountForScheme(schemeId string) (int64, er
|
||||
var count int64
|
||||
err = s.GetReplicaX().Get(&count, query, args...)
|
||||
if err != nil {
|
||||
return 0, errors.Wrapf(err, "failed to count Teams with schemdId=%s", schemeId)
|
||||
return 0, errors.Wrapf(err, "failed to count Teams with schemeId=%s", schemeId)
|
||||
}
|
||||
|
||||
return count, nil
|
||||
|
||||
@@ -155,7 +155,7 @@ func (s SqlWebhookStore) GetIncomingByTeamByUser(teamId string, userId string, o
|
||||
}
|
||||
|
||||
if err := s.GetReplicaX().Select(&webhooks, queryString, args...); err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to find IncomingWebhoook with teamId=%s", teamId)
|
||||
return nil, errors.Wrapf(err, "failed to find IncomingWebhook with teamId=%s", teamId)
|
||||
}
|
||||
|
||||
return webhooks, nil
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table align="center" border="0" cellpadding="0" cellspcing="0" width="612px">
|
||||
<table align="center" border="0" cellpadding="0" cellspacing="0" width="612px">
|
||||
<tr>
|
||||
<td style="border-bottom: 1px solid #E5E5E5"></td>
|
||||
</tr>
|
||||
@@ -66,7 +66,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table align="center" border="0" cellpadding="0" cellspcing="0" width="612px">
|
||||
<table align="center" border="0" cellpadding="0" cellspacing="0" width="612px">
|
||||
<tr>
|
||||
<td style="border-bottom: 1px solid #E5E5E5"></td>
|
||||
</tr>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table align="center" border="0" cellpadding="0" cellspcing="0" width="612px">
|
||||
<table align="center" border="0" cellpadding="0" cellspacing="0" width="612px">
|
||||
<tr>
|
||||
<td style="border-bottom: 1px solid #E5E5E5"></td>
|
||||
</tr>
|
||||
@@ -65,7 +65,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table align="center" border="0" cellpadding="0" cellspcing="0" width="612px">
|
||||
<table align="center" border="0" cellpadding="0" cellspacing="0" width="612px">
|
||||
<tr>
|
||||
<td style="border-bottom: 1px solid #E5E5E5"></td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user