From ffebfbf56fc9eab3cd7232e656438edfa80d8826 Mon Sep 17 00:00:00 2001 From: SimonSimonB Date: Fri, 5 Feb 2021 11:22:27 +0100 Subject: [PATCH] Fix initialisms/app (#16818) Automatic Merge --- app/admin.go | 4 +- app/analytics.go | 40 +- app/app_iface.go | 476 +++++++------- app/audit.go | 8 +- app/authorization.go | 32 +- app/auto_responder.go | 6 +- app/bot.go | 10 +- app/channel.go | 332 +++++----- app/channel_category.go | 58 +- app/command.go | 42 +- app/email.go | 8 +- app/email_batching.go | 36 +- app/export.go | 12 +- app/file.go | 50 +- app/file_bench_test.go | 26 +- app/file_test.go | 58 +- app/group.go | 14 +- app/import_functions.go | 40 +- app/import_functions_test.go | 14 +- app/import_test.go | 14 +- app/integration_action.go | 16 +- app/notification.go | 26 +- app/notification_push.go | 34 +- app/notification_push_test.go | 10 +- app/notification_test.go | 44 +- app/oauth.go | 68 +- app/opentracing/opentracing_layer.go | 948 +++++++++++++-------------- app/plugin_api.go | 266 ++++---- app/plugin_api_test.go | 12 +- app/plugin_commands.go | 12 +- app/plugin_requests.go | 6 +- app/post.go | 80 +-- app/post_test.go | 10 +- app/preference.go | 34 +- app/product_notices.go | 26 +- app/ratelimit.go | 4 +- app/session.go | 42 +- app/slack.go | 6 +- app/slack_test.go | 14 +- app/slashcommands/auto_channels.go | 8 +- app/slashcommands/helper_test.go | 4 +- app/status.go | 86 +-- app/team.go | 222 +++---- app/team_test.go | 34 +- app/terms_of_service.go | 6 +- app/upload.go | 4 +- app/user.go | 272 ++++---- app/user_terms_of_service.go | 10 +- app/user_test.go | 2 +- app/web_conn.go | 14 +- app/web_hub.go | 76 +-- app/web_hub_test.go | 6 +- app/webhook.go | 74 +-- app/webhook_test.go | 10 +- app/webhub_fuzz.go | 4 +- 55 files changed, 1885 insertions(+), 1885 deletions(-) diff --git a/app/admin.go b/app/admin.go index cb6f8c6755..3d9c491f35 100644 --- a/app/admin.go +++ b/app/admin.go @@ -203,7 +203,7 @@ func (a *App) TestSiteURL(siteURL string) *model.AppError { return nil } -func (a *App) TestEmail(userId string, cfg *model.Config) *model.AppError { +func (a *App) TestEmail(userID string, cfg *model.Config) *model.AppError { if *cfg.EmailSettings.SMTPServer == "" { return model.NewAppError("testEmail", "api.admin.test_email.missing_server", nil, utils.T("api.context.invalid_param.app_error", map[string]interface{}{"Name": "SMTPServer"}), http.StatusBadRequest) } @@ -219,7 +219,7 @@ func (a *App) TestEmail(userId string, cfg *model.Config) *model.AppError { return model.NewAppError("testEmail", "api.admin.test_email.reenter_password", nil, "", http.StatusBadRequest) } } - user, err := a.GetUser(userId) + user, err := a.GetUser(userID) if err != nil { return err } diff --git a/app/analytics.go b/app/analytics.go index ae73158563..7a3c360b1a 100644 --- a/app/analytics.go +++ b/app/analytics.go @@ -16,7 +16,7 @@ const ( MonthMilliseconds = 31 * DayMilliseconds ) -func (a *App) GetAnalytics(name string, teamId string) (model.AnalyticsRows, *model.AppError) { +func (a *App) GetAnalytics(name string, teamID string) (model.AnalyticsRows, *model.AppError) { skipIntensiveQueries := false var systemUserCount int64 systemUserCount, err := a.Srv().Store.User().Count(model.UserCountOptions{}) @@ -46,19 +46,19 @@ func (a *App) GetAnalytics(name string, teamId string) (model.AnalyticsRows, *mo openChan := make(chan store.StoreResult, 1) privateChan := make(chan store.StoreResult, 1) go func() { - count, err2 := a.Srv().Store.Channel().AnalyticsTypeCount(teamId, model.CHANNEL_OPEN) + count, err2 := a.Srv().Store.Channel().AnalyticsTypeCount(teamID, model.CHANNEL_OPEN) openChan <- store.StoreResult{Data: count, NErr: err2} close(openChan) }() go func() { - count, err2 := a.Srv().Store.Channel().AnalyticsTypeCount(teamId, model.CHANNEL_PRIVATE) + count, err2 := a.Srv().Store.Channel().AnalyticsTypeCount(teamID, model.CHANNEL_PRIVATE) privateChan <- store.StoreResult{Data: count, NErr: err2} close(privateChan) }() var userChan chan store.StoreResult var userInactiveChan chan store.StoreResult - if teamId == "" { + if teamID == "" { userInactiveChan = make(chan store.StoreResult, 1) go func() { count, err2 := a.Srv().Store.User().AnalyticsGetInactiveUsersCount() @@ -68,7 +68,7 @@ func (a *App) GetAnalytics(name string, teamId string) (model.AnalyticsRows, *mo } else { userChan = make(chan store.StoreResult, 1) go func() { - count, err2 := a.Srv().Store.User().Count(model.UserCountOptions{TeamId: teamId}) + count, err2 := a.Srv().Store.User().Count(model.UserCountOptions{TeamId: teamID}) userChan <- store.StoreResult{Data: count, NErr: err2} close(userChan) }() @@ -78,7 +78,7 @@ func (a *App) GetAnalytics(name string, teamId string) (model.AnalyticsRows, *mo if !skipIntensiveQueries { postChan = make(chan store.StoreResult, 1) go func() { - count, err2 := a.Srv().Store.Post().AnalyticsPostCount(teamId, false, false) + count, err2 := a.Srv().Store.Post().AnalyticsPostCount(teamID, false, false) postChan <- store.StoreResult{Data: count, NErr: err2} close(postChan) }() @@ -199,7 +199,7 @@ func (a *App) GetAnalytics(name string, teamId string) (model.AnalyticsRows, *mo return rows, nil } analyticsRows, nErr := a.Srv().Store.Post().AnalyticsPostCountsByDay(&model.AnalyticsPostCountsOptions{ - TeamId: teamId, + TeamId: teamID, BotsOnly: true, YesterdayOnly: false, }) @@ -214,7 +214,7 @@ func (a *App) GetAnalytics(name string, teamId string) (model.AnalyticsRows, *mo return rows, nil } analyticsRows, nErr := a.Srv().Store.Post().AnalyticsPostCountsByDay(&model.AnalyticsPostCountsOptions{ - TeamId: teamId, + TeamId: teamID, BotsOnly: false, YesterdayOnly: false, }) @@ -229,7 +229,7 @@ func (a *App) GetAnalytics(name string, teamId string) (model.AnalyticsRows, *mo return rows, nil } - analyticsRows, nErr := a.Srv().Store.Post().AnalyticsUserCountsWithPostsByDay(teamId) + analyticsRows, nErr := a.Srv().Store.Post().AnalyticsUserCountsWithPostsByDay(teamID) if nErr != nil { return nil, model.NewAppError("GetAnalytics", "app.post.analytics_user_counts_posts_by_day.app_error", nil, nErr.Error(), http.StatusInternalServerError) } @@ -246,21 +246,21 @@ func (a *App) GetAnalytics(name string, teamId string) (model.AnalyticsRows, *mo iHookChan := make(chan store.StoreResult, 1) go func() { - c, err2 := a.Srv().Store.Webhook().AnalyticsIncomingCount(teamId) + c, err2 := a.Srv().Store.Webhook().AnalyticsIncomingCount(teamID) iHookChan <- store.StoreResult{Data: c, NErr: err2} close(iHookChan) }() oHookChan := make(chan store.StoreResult, 1) go func() { - c, err2 := a.Srv().Store.Webhook().AnalyticsOutgoingCount(teamId) + c, err2 := a.Srv().Store.Webhook().AnalyticsOutgoingCount(teamID) oHookChan <- store.StoreResult{Data: c, NErr: err2} close(oHookChan) }() commandChan := make(chan store.StoreResult, 1) go func() { - c, nErr := a.Srv().Store.Command().AnalyticsCommandCount(teamId) + c, nErr := a.Srv().Store.Command().AnalyticsCommandCount(teamID) commandChan <- store.StoreResult{Data: c, NErr: nErr} close(commandChan) }() @@ -278,14 +278,14 @@ func (a *App) GetAnalytics(name string, teamId string) (model.AnalyticsRows, *mo if !skipIntensiveQueries { fileChan = make(chan store.StoreResult, 1) go func() { - count, err2 := a.Srv().Store.Post().AnalyticsPostCount(teamId, true, false) + count, err2 := a.Srv().Store.Post().AnalyticsPostCount(teamID, true, false) fileChan <- store.StoreResult{Data: count, NErr: err2} close(fileChan) }() hashtagChan = make(chan store.StoreResult, 1) go func() { - count, err2 := a.Srv().Store.Post().AnalyticsPostCount(teamId, false, true) + count, err2 := a.Srv().Store.Post().AnalyticsPostCount(teamID, false, true) hashtagChan <- store.StoreResult{Data: count, NErr: err2} close(hashtagChan) }() @@ -341,8 +341,8 @@ func (a *App) GetAnalytics(name string, teamId string) (model.AnalyticsRows, *mo return nil, nil } -func (a *App) GetRecentlyActiveUsersForTeam(teamId string) (map[string]*model.User, *model.AppError) { - users, err := a.Srv().Store.User().GetRecentlyActiveUsersForTeam(teamId, 0, 100, nil) +func (a *App) GetRecentlyActiveUsersForTeam(teamID string) (map[string]*model.User, *model.AppError) { + users, err := a.Srv().Store.User().GetRecentlyActiveUsersForTeam(teamID, 0, 100, nil) if err != nil { return nil, model.NewAppError("GetRecentlyActiveUsersForTeam", "app.user.get_recently_active_users.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -356,8 +356,8 @@ func (a *App) GetRecentlyActiveUsersForTeam(teamId string) (map[string]*model.Us return userMap, nil } -func (a *App) GetRecentlyActiveUsersForTeamPage(teamId string, page, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { - users, err := a.Srv().Store.User().GetRecentlyActiveUsersForTeam(teamId, page*perPage, perPage, viewRestrictions) +func (a *App) GetRecentlyActiveUsersForTeamPage(teamID string, page, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { + users, err := a.Srv().Store.User().GetRecentlyActiveUsersForTeam(teamID, page*perPage, perPage, viewRestrictions) if err != nil { return nil, model.NewAppError("GetRecentlyActiveUsersForTeamPage", "app.user.get_recently_active_users.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -365,8 +365,8 @@ func (a *App) GetRecentlyActiveUsersForTeamPage(teamId string, page, perPage int return a.sanitizeProfiles(users, asAdmin), nil } -func (a *App) GetNewUsersForTeamPage(teamId string, page, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { - users, err := a.Srv().Store.User().GetNewUsersForTeam(teamId, page*perPage, perPage, viewRestrictions) +func (a *App) GetNewUsersForTeamPage(teamID string, page, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { + users, err := a.Srv().Store.User().GetNewUsersForTeam(teamID, page*perPage, perPage, viewRestrictions) if err != nil { return nil, model.NewAppError("GetNewUsersForTeamPage", "app.user.get_new_users.app_error", nil, err.Error(), http.StatusInternalServerError) } diff --git a/app/app_iface.go b/app/app_iface.go index 2eeaaaaa43..6c4c92ef90 100644 --- a/app/app_iface.go +++ b/app/app_iface.go @@ -37,11 +37,11 @@ import ( type AppIface interface { // @openTracingParams args ExecuteCommand(args *model.CommandArgs) (*model.CommandResponse, *model.AppError) - // @openTracingParams teamId + // @openTracingParams teamID // previous ListCommands now ListAutocompleteCommands - ListAutocompleteCommands(teamId string, T goi18n.TranslateFunc) ([]*model.Command, *model.AppError) - // @openTracingParams teamId, skipSlackParsing - CreateCommandPost(post *model.Post, teamId string, response *model.CommandResponse, skipSlackParsing bool) (*model.Post, *model.AppError) + ListAutocompleteCommands(teamID string, T goi18n.TranslateFunc) ([]*model.Command, *model.AppError) + // @openTracingParams teamID, skipSlackParsing + CreateCommandPost(post *model.Post, teamID string, response *model.CommandResponse, skipSlackParsing bool) (*model.Post, *model.AppError) // AddCursorIdsForPostList adds NextPostId and PrevPostId as cursor to the PostList. // The conditional blocks ensure that it sets those cursor IDs immediately as afterPost, beforePost or empty, // and only query to database whenever necessary. @@ -126,10 +126,10 @@ type AppIface interface { FillInPostProps(post *model.Post, channel *model.Channel) *model.AppError // FilterNonGroupChannelMembers returns the subset of the given user IDs of the users who are not members of groups // associated to the channel excluding bots - FilterNonGroupChannelMembers(userIds []string, channel *model.Channel) ([]string, error) + FilterNonGroupChannelMembers(userIDs []string, channel *model.Channel) ([]string, error) // FilterNonGroupTeamMembers returns the subset of the given user IDs of the users who are not members of groups // associated to the team excluding bots. - FilterNonGroupTeamMembers(userIds []string, team *model.Team) ([]string, error) + FilterNonGroupTeamMembers(userIDs []string, team *model.Team) ([]string, error) // GetAllLdapGroupsPage retrieves all LDAP groups under the configured base DN using the default or configured group // filter. GetAllLdapGroupsPage(page int, perPage int, opts model.LdapGroupSearchOpts) ([]*model.Group, int, *model.AppError) @@ -155,7 +155,7 @@ type AppIface interface { // GetFilteredUsersStats is used to get a count of users based on the set of filters supported by UserCountOptions. GetFilteredUsersStats(options *model.UserCountOptions) (*model.UsersStats, *model.AppError) // GetGroupsByTeam returns the paged list and the total count of group associated to the given team. - GetGroupsByTeam(teamId string, opts model.GroupSearchOpts) ([]*model.GroupWithSchemeAdmin, int, *model.AppError) + GetGroupsByTeam(teamID string, opts model.GroupSearchOpts) ([]*model.GroupWithSchemeAdmin, int, *model.AppError) // GetKnownUsers returns the list of user ids of users with any direct // relationship with a user. That means any user sharing any channel, including // direct and group channels. @@ -178,7 +178,7 @@ type AppIface interface { // lock instead. GetPluginsEnvironment() *plugin.Environment // GetProductNotices is called from the frontend to fetch the product notices that are relevant to the caller - GetProductNotices(userId, teamId string, client model.NoticeClientType, clientVersion string, locale string) (model.NoticeMessages, *model.AppError) + GetProductNotices(userID, teamID string, client model.NoticeClientType, clientVersion string, locale string) (model.NoticeMessages, *model.AppError) // GetPublicKey will return the actual public key saved in the `name` file. GetPublicKey(name string) ([]byte, *model.AppError) // GetSanitizedConfig gets the configuration for a system admin without any secrets. @@ -193,7 +193,7 @@ type AppIface interface { // GetTeamGroupUsers returns the users who are associated to the team via GroupTeams and GroupMembers. GetTeamGroupUsers(teamID string) ([]*model.User, *model.AppError) // GetTeamSchemeChannelRoles Checks if a team has an override scheme and returns the scheme channel role names or default channel role names. - GetTeamSchemeChannelRoles(teamId string) (guestRoleName string, userRoleName string, adminRoleName string, err *model.AppError) + GetTeamSchemeChannelRoles(teamID string) (guestRoleName string, userRoleName string, adminRoleName string, err *model.AppError) // GetTotalUsersStats is used for the DM list total GetTotalUsersStats(viewRestrictions *model.ViewUsersRestrictions) (*model.UsersStats, *model.AppError) // HubRegister registers a connection to a hub. @@ -223,10 +223,10 @@ type AppIface interface { MarkChannelAsUnreadFromPost(postID string, userID string) (*model.ChannelUnreadAt, *model.AppError) // MentionsToPublicChannels returns all the mentions to public channels, // linking them to their channels - MentionsToPublicChannels(message, teamId string) model.ChannelMentionMap + MentionsToPublicChannels(message, teamID string) model.ChannelMentionMap // MentionsToTeamMembers returns all the @ mentions found in message that // belong to users in the specified team, linking them to their users - MentionsToTeamMembers(message, teamId string) model.UserMentionMap + MentionsToTeamMembers(message, teamID string) model.UserMentionMap // MoveChannel method is prone to data races if someone joins to channel during the move process. However this // function is only exposed to sysadmins and the possibility of this edge case is relatively small. MoveChannel(team *model.Team, channel *model.Channel, user *model.User) *model.AppError @@ -289,7 +289,7 @@ type AppIface interface { // SetStatusLastActivityAt sets the last activity at for a user on the local app server and updates // status to away if needed. Used by the WS to set status to away if an 'online' device disconnects // while an 'away' device is still connected - SetStatusLastActivityAt(userId string, activityAt int64) + SetStatusLastActivityAt(userID string, activityAt int64) // SyncPlugins synchronizes the plugins installed locally // with the plugin bundles available in the file store. SyncPlugins() *model.AppError @@ -324,10 +324,10 @@ type AppIface interface { // UpdateProductNotices is called periodically from a scheduled worker to fetch new notices and update the cache UpdateProductNotices() *model.AppError // UpdateViewedProductNotices is called from the frontend to mark a set of notices as 'viewed' by user - UpdateViewedProductNotices(userId string, noticeIds []string) *model.AppError + UpdateViewedProductNotices(userID string, noticeIds []string) *model.AppError // UpdateViewedProductNoticesForNewUser is called when new user is created to mark all current notices for this // user as viewed in order to avoid showing them imminently on first login - UpdateViewedProductNoticesForNewUser(userId string) + UpdateViewedProductNoticesForNewUser(userID string) // UpdateWebConnUserActivity sets the LastUserActivityAt of the hub for the given session. UpdateWebConnUserActivity(session model.Session, activityAt int64) // UploadFile uploads a single file in form of a completely constructed byte array for a channel. @@ -341,20 +341,20 @@ type AppIface interface { // Uploads some files to the given team and channel as the given user. files and filenames should have // the same length. clientIds should either not be provided or have the same length as files and filenames. // The provided files should be closed by the caller so that they are not leaked. - UploadFiles(teamId string, channelId string, userId string, files []io.ReadCloser, filenames []string, clientIds []string, now time.Time) (*model.FileUploadResponse, *model.AppError) + UploadFiles(teamID string, channelId string, userID string, files []io.ReadCloser, filenames []string, clientIds []string, now time.Time) (*model.FileUploadResponse, *model.AppError) // UserIsInAdminRoleGroup returns true at least one of the user's groups are configured to set the members as // admins in the given syncable. UserIsInAdminRoleGroup(userID, syncableID string, syncableType model.GroupSyncableType) (bool, *model.AppError) // VerifyPlugin checks that the given signature corresponds to the given plugin and matches a trusted certificate. VerifyPlugin(plugin, signature io.ReadSeeker) *model.AppError //GetUserStatusesByIds used by apiV4 - GetUserStatusesByIds(userIds []string) ([]*model.Status, *model.AppError) + GetUserStatusesByIds(userIDs []string) ([]*model.Status, *model.AppError) AcceptLanguage() string AccountMigration() einterfaces.AccountMigrationInterface - ActivateMfa(userId, token string) *model.AppError - AddChannelMember(userId string, channel *model.Channel, userRequestorId string, postRootId string) (*model.ChannelMember, *model.AppError) + ActivateMfa(userID, token string) *model.AppError + AddChannelMember(userID string, channel *model.Channel, userRequestorId string, postRootId string) (*model.ChannelMember, *model.AppError) AddConfigListener(listener func(*model.Config, *model.Config)) string - AddDirectChannels(teamId string, user *model.User) *model.AppError + AddDirectChannels(teamID string, user *model.User) *model.AppError AddLdapPrivateCertificate(fileData *multipart.FileHeader) *model.AppError AddLdapPublicCertificate(fileData *multipart.FileHeader) *model.AppError AddSamlIdpCertificate(fileData *multipart.FileHeader) *model.AppError @@ -363,27 +363,27 @@ type AppIface interface { AddSessionToCache(session *model.Session) AddStatusCache(status *model.Status) AddStatusCacheSkipClusterSend(status *model.Status) - AddTeamMember(teamId, userId string) (*model.TeamMember, *model.AppError) - AddTeamMemberByInviteId(inviteId, userId string) (*model.TeamMember, *model.AppError) - AddTeamMemberByToken(userId, tokenId string) (*model.TeamMember, *model.AppError) - AddTeamMembers(teamId string, userIds []string, userRequestorId string, graceful bool) ([]*model.TeamMemberWithError, *model.AppError) + AddTeamMember(teamID, userID string) (*model.TeamMember, *model.AppError) + AddTeamMemberByInviteId(inviteId, userID string) (*model.TeamMember, *model.AppError) + AddTeamMemberByToken(userID, tokenID string) (*model.TeamMember, *model.AppError) + AddTeamMembers(teamID string, userIDs []string, userRequestorId string, graceful bool) ([]*model.TeamMemberWithError, *model.AppError) AddUserToChannel(user *model.User, channel *model.Channel) (*model.ChannelMember, *model.AppError) - AddUserToTeam(teamId string, userId string, userRequestorId string) (*model.Team, *model.AppError) - AddUserToTeamByInviteId(inviteId string, userId string) (*model.Team, *model.AppError) - AddUserToTeamByTeamId(teamId string, user *model.User) *model.AppError - AddUserToTeamByToken(userId string, tokenId string) (*model.Team, *model.AppError) + AddUserToTeam(teamID string, userID string, userRequestorId string) (*model.Team, *model.AppError) + AddUserToTeamByInviteId(inviteId string, userID string) (*model.Team, *model.AppError) + AddUserToTeamByTeamId(teamID string, user *model.User) *model.AppError + AddUserToTeamByToken(userID string, tokenID string) (*model.Team, *model.AppError) AdjustImage(file io.Reader) (*bytes.Buffer, *model.AppError) - AllowOAuthAppAccessToUser(userId string, authRequest *model.AuthorizeRequest) (string, *model.AppError) + AllowOAuthAppAccessToUser(userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError) AppendFile(fr io.Reader, path string) (int64, *model.AppError) AsymmetricSigningKey() *ecdsa.PrivateKey AttachDeviceId(sessionId string, deviceId string, expiresAt int64) *model.AppError AttachSessionCookies(w http.ResponseWriter, r *http.Request) AuthenticateUserForLogin(id, loginId, password, mfaToken, cwsToken string, ldapOnly bool) (user *model.User, err *model.AppError) AuthorizeOAuthUser(w http.ResponseWriter, r *http.Request, service, code, state, redirectUri string) (io.ReadCloser, string, map[string]string, *model.User, *model.AppError) - AutocompleteChannels(teamId string, term string) (*model.ChannelList, *model.AppError) - AutocompleteChannelsForSearch(teamId string, userId string, term string) (*model.ChannelList, *model.AppError) - AutocompleteUsersInChannel(teamId string, channelId string, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInChannel, *model.AppError) - AutocompleteUsersInTeam(teamId string, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInTeam, *model.AppError) + AutocompleteChannels(teamID string, term string) (*model.ChannelList, *model.AppError) + AutocompleteChannelsForSearch(teamID string, userID string, term string) (*model.ChannelList, *model.AppError) + AutocompleteUsersInChannel(teamID string, channelId string, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInChannel, *model.AppError) + AutocompleteUsersInTeam(teamID string, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInTeam, *model.AppError) BroadcastStatus(status *model.Status) BuildPostReactions(postId string) (*[]ReactionImportData, *model.AppError) BuildPushNotificationMessage(contentsConfig string, post *model.Post, user *model.User, channel *model.Channel, channelName string, senderName string, explicitMention bool, channelWideMention bool, replyToThreadType string) (*model.PushNotification, *model.AppError) @@ -407,8 +407,8 @@ type AppIface interface { ClearChannelMembersCache(channelID string) ClearSessionCacheForAllUsers() ClearSessionCacheForAllUsersSkipClusterSend() - ClearSessionCacheForUser(userId string) - ClearSessionCacheForUserSkipClusterSend(userId string) + ClearSessionCacheForUser(userID string) + ClearSessionCacheForUserSkipClusterSend(userID string) ClearTeamMembersCache(teamID string) ClientConfig() map[string]string ClientConfigHash() string @@ -416,72 +416,72 @@ type AppIface interface { Cluster() einterfaces.ClusterInterface CompareAndDeletePluginKey(pluginId string, key string, oldValue []byte) (bool, *model.AppError) CompareAndSetPluginKey(pluginId string, key string, oldValue, newValue []byte) (bool, *model.AppError) - CompleteOAuth(service string, body io.ReadCloser, teamId string, props map[string]string, tokenUser *model.User) (*model.User, *model.AppError) + CompleteOAuth(service string, body io.ReadCloser, teamID string, props map[string]string, tokenUser *model.User) (*model.User, *model.AppError) CompleteSwitchWithOAuth(service string, userData io.Reader, email string, tokenUser *model.User) (*model.User, *model.AppError) Compliance() einterfaces.ComplianceInterface Config() *model.Config Context() context.Context - CopyFileInfos(userId string, fileIds []string) ([]string, *model.AppError) + CopyFileInfos(userID string, fileIds []string) ([]string, *model.AppError) CreateChannel(channel *model.Channel, addMember bool) (*model.Channel, *model.AppError) - CreateChannelWithUser(channel *model.Channel, userId string) (*model.Channel, *model.AppError) + CreateChannelWithUser(channel *model.Channel, userID string) (*model.Channel, *model.AppError) CreateCommand(cmd *model.Command) (*model.Command, *model.AppError) - CreateCommandWebhook(commandId string, args *model.CommandArgs) (*model.CommandWebhook, *model.AppError) + CreateCommandWebhook(commandID string, args *model.CommandArgs) (*model.CommandWebhook, *model.AppError) CreateEmoji(sessionUserId string, emoji *model.Emoji, multiPartImageData *multipart.Form) (*model.Emoji, *model.AppError) CreateGroup(group *model.Group) (*model.Group, *model.AppError) - CreateGroupChannel(userIds []string, creatorId string) (*model.Channel, *model.AppError) + CreateGroupChannel(userIDs []string, creatorId string) (*model.Channel, *model.AppError) CreateIncomingWebhookForChannel(creatorId string, channel *model.Channel, hook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) CreateJob(job *model.Job) (*model.Job, *model.AppError) CreateOAuthApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppError) CreateOAuthStateToken(extra string) (*model.Token, *model.AppError) - CreateOAuthUser(service string, userData io.Reader, teamId string, tokenUser *model.User) (*model.User, *model.AppError) + CreateOAuthUser(service string, userData io.Reader, teamID string, tokenUser *model.User) (*model.User, *model.AppError) CreateOutgoingWebhook(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) - CreatePasswordRecoveryToken(userId, email string) (*model.Token, *model.AppError) + CreatePasswordRecoveryToken(userID, email string) (*model.Token, *model.AppError) CreatePost(post *model.Post, channel *model.Channel, triggerWebhooks, setOnline bool) (savedPost *model.Post, err *model.AppError) CreatePostAsUser(post *model.Post, currentSessionId string, setOnline bool) (*model.Post, *model.AppError) CreatePostMissingChannel(post *model.Post, triggerWebhooks bool) (*model.Post, *model.AppError) CreateRole(role *model.Role) (*model.Role, *model.AppError) CreateScheme(scheme *model.Scheme) (*model.Scheme, *model.AppError) CreateSession(session *model.Session) (*model.Session, *model.AppError) - CreateSidebarCategory(userId, teamId string, newCategory *model.SidebarCategoryWithChannels) (*model.SidebarCategoryWithChannels, *model.AppError) + CreateSidebarCategory(userID, teamID string, newCategory *model.SidebarCategoryWithChannels) (*model.SidebarCategoryWithChannels, *model.AppError) CreateTeam(team *model.Team) (*model.Team, *model.AppError) - CreateTeamWithUser(team *model.Team, userId string) (*model.Team, *model.AppError) - CreateTermsOfService(text, userId string) (*model.TermsOfService, *model.AppError) + CreateTeamWithUser(team *model.Team, userID string) (*model.Team, *model.AppError) + CreateTermsOfService(text, userID string) (*model.TermsOfService, *model.AppError) CreateUploadSession(us *model.UploadSession) (*model.UploadSession, *model.AppError) CreateUserAccessToken(token *model.UserAccessToken) (*model.UserAccessToken, *model.AppError) CreateUserAsAdmin(user *model.User, redirect string) (*model.User, *model.AppError) CreateUserFromSignup(user *model.User, redirect string) (*model.User, *model.AppError) CreateUserWithInviteId(user *model.User, inviteId, redirect string) (*model.User, *model.AppError) CreateUserWithToken(user *model.User, token *model.Token) (*model.User, *model.AppError) - CreateWebhookPost(userId string, channel *model.Channel, text, overrideUsername, overrideIconUrl, overrideIconEmoji string, props model.StringInterface, postType string, postRootId string) (*model.Post, *model.AppError) + CreateWebhookPost(userID string, channel *model.Channel, text, overrideUsername, overrideIconURL, overrideIconEmoji string, props model.StringInterface, postType string, postRootId string) (*model.Post, *model.AppError) DBHealthCheckDelete() error DBHealthCheckWrite() error DataRetention() einterfaces.DataRetentionInterface DeactivateGuests() *model.AppError - DeactivateMfa(userId string) *model.AppError - DeauthorizeOAuthAppForUser(userId, appId string) *model.AppError + DeactivateMfa(userID string) *model.AppError + DeauthorizeOAuthAppForUser(userID, appId string) *model.AppError DeleteAllExpiredPluginKeys() *model.AppError DeleteAllKeysForPlugin(pluginId string) *model.AppError DeleteBrandImage() *model.AppError - DeleteChannel(channel *model.Channel, userId string) *model.AppError - DeleteCommand(commandId string) *model.AppError + DeleteChannel(channel *model.Channel, userID string) *model.AppError + DeleteCommand(commandID string) *model.AppError DeleteEmoji(emoji *model.Emoji) *model.AppError - DeleteEphemeralPost(userId, postId string) + DeleteEphemeralPost(userID, postId string) DeleteFlaggedPosts(postId string) DeleteGroup(groupID string) (*model.Group, *model.AppError) DeleteGroupMember(groupID string, userID string) (*model.GroupMember, *model.AppError) DeleteGroupSyncable(groupID string, syncableID string, syncableType model.GroupSyncableType) (*model.GroupSyncable, *model.AppError) - DeleteIncomingWebhook(hookId string) *model.AppError + DeleteIncomingWebhook(hookID string) *model.AppError DeleteOAuthApp(appId string) *model.AppError - DeleteOutgoingWebhook(hookId string) *model.AppError + DeleteOutgoingWebhook(hookID string) *model.AppError DeletePluginKey(pluginId string, key string) *model.AppError DeletePost(postId, deleteByID string) (*model.Post, *model.AppError) DeletePostFiles(post *model.Post) - DeletePreferences(userId string, preferences model.Preferences) *model.AppError + DeletePreferences(userID string, preferences model.Preferences) *model.AppError DeleteReactionForPost(reaction *model.Reaction) *model.AppError DeleteScheme(schemeId string) (*model.Scheme, *model.AppError) - DeleteSidebarCategory(userId, teamId, categoryId string) *model.AppError + DeleteSidebarCategory(userID, teamID, categoryId string) *model.AppError DeleteToken(token *model.Token) *model.AppError - DisableAutoResponder(userId string, asAdmin bool) *model.AppError + DisableAutoResponder(userID string, asAdmin bool) *model.AppError DisableUserAccessToken(token *model.UserAccessToken) *model.AppError DoAppMigrations() DoCommandRequest(cmd *model.Command, p url.Values) (*model.Command, *model.CommandResponse, *model.AppError) @@ -489,8 +489,8 @@ type AppIface interface { DoGuestRolesCreationMigration() DoLocalRequest(rawURL string, body []byte) (*http.Response, *model.AppError) DoLogin(w http.ResponseWriter, r *http.Request, user *model.User, deviceId string, isMobile, isOAuthUser, isSaml bool) *model.AppError - DoPostAction(postId, actionId, userId, selectedOption string) (string, *model.AppError) - DoPostActionWithCookie(postId, actionId, userId, selectedOption string, cookie *model.PostActionCookie) (string, *model.AppError) + DoPostAction(postId, actionId, userID, selectedOption string) (string, *model.AppError) + DoPostActionWithCookie(postId, actionId, userID, selectedOption string, cookie *model.PostActionCookie) (string, *model.AppError) DoSystemConsoleRolesCreationMigration() DoUploadFile(now time.Time, rawTeamId string, rawChannelId string, rawUserId string, rawFilename string, data []byte) (*model.FileInfo, *model.AppError) DoUploadFileExpectModification(now time.Time, rawTeamId string, rawChannelId string, rawUserId string, rawFilename string, data []byte) (*model.FileInfo, []byte, *model.AppError) @@ -507,7 +507,7 @@ type AppIface interface { FillInChannelsProps(channelList *model.ChannelList) *model.AppError FilterUsersByVisible(viewer *model.User, otherUsers []*model.User) ([]*model.User, *model.AppError) FindTeamByName(name string) bool - GenerateMfaSecret(userId string) (*model.MfaSecret, *model.AppError) + GenerateMfaSecret(userID string) (*model.MfaSecret, *model.AppError) GeneratePublicLink(siteURL string, info *model.FileInfo) string GenerateSupportPacket() []model.FileData GetActivePluginManifests() ([]*model.Manifest, *model.AppError) @@ -524,43 +524,43 @@ type AppIface interface { GetAllTeams() ([]*model.Team, *model.AppError) GetAllTeamsPage(offset int, limit int) ([]*model.Team, *model.AppError) GetAllTeamsPageWithCount(offset int, limit int) (*model.TeamsWithCount, *model.AppError) - GetAnalytics(name string, teamId string) (model.AnalyticsRows, *model.AppError) - GetAudits(userId string, limit int) (model.Audits, *model.AppError) - GetAuditsPage(userId string, page int, perPage int) (model.Audits, *model.AppError) + GetAnalytics(name string, teamID string) (model.AnalyticsRows, *model.AppError) + GetAudits(userID string, limit int) (model.Audits, *model.AppError) + GetAuditsPage(userID string, page int, perPage int) (model.Audits, *model.AppError) GetAuthorizationCode(w http.ResponseWriter, r *http.Request, service string, props map[string]string, loginHint string) (string, *model.AppError) - GetAuthorizedAppsForUser(userId string, page, perPage int) ([]*model.OAuthApp, *model.AppError) + GetAuthorizedAppsForUser(userID string, page, perPage int) ([]*model.OAuthApp, *model.AppError) GetBrandImage() ([]byte, *model.AppError) GetBulkReactionsForPosts(postIds []string) (map[string][]*model.Reaction, *model.AppError) GetChannel(channelId string) (*model.Channel, *model.AppError) - GetChannelByName(channelName, teamId string, includeDeleted bool) (*model.Channel, *model.AppError) + GetChannelByName(channelName, teamID string, includeDeleted bool) (*model.Channel, *model.AppError) GetChannelByNameForTeamName(channelName, teamName string, includeDeleted bool) (*model.Channel, *model.AppError) - GetChannelCounts(teamId string, userId string) (*model.ChannelCounts, *model.AppError) + GetChannelCounts(teamID string, userID string) (*model.ChannelCounts, *model.AppError) GetChannelGuestCount(channelId string) (int64, *model.AppError) - GetChannelMember(channelId string, userId string) (*model.ChannelMember, *model.AppError) + GetChannelMember(channelId string, userID string) (*model.ChannelMember, *model.AppError) GetChannelMemberCount(channelId string) (int64, *model.AppError) - GetChannelMembersByIds(channelId string, userIds []string) (*model.ChannelMembers, *model.AppError) - GetChannelMembersForUser(teamId string, userId string) (*model.ChannelMembers, *model.AppError) - GetChannelMembersForUserWithPagination(teamId, userId string, page, perPage int) ([]*model.ChannelMember, *model.AppError) + GetChannelMembersByIds(channelId string, userIDs []string) (*model.ChannelMembers, *model.AppError) + GetChannelMembersForUser(teamID string, userID string) (*model.ChannelMembers, *model.AppError) + GetChannelMembersForUserWithPagination(teamID, userID string, page, perPage int) ([]*model.ChannelMember, *model.AppError) GetChannelMembersPage(channelId string, page, perPage int) (*model.ChannelMembers, *model.AppError) GetChannelMembersTimezones(channelId string) ([]string, *model.AppError) GetChannelPinnedPostCount(channelId string) (int64, *model.AppError) - GetChannelUnread(channelId, userId string) (*model.ChannelUnread, *model.AppError) - GetChannelsByNames(channelNames []string, teamId string) ([]*model.Channel, *model.AppError) + GetChannelUnread(channelId, userID string) (*model.ChannelUnread, *model.AppError) + GetChannelsByNames(channelNames []string, teamID string) ([]*model.Channel, *model.AppError) GetChannelsForScheme(scheme *model.Scheme, offset int, limit int) (model.ChannelList, *model.AppError) GetChannelsForSchemePage(scheme *model.Scheme, page int, perPage int) (model.ChannelList, *model.AppError) - GetChannelsForUser(teamId string, userId string, includeDeleted bool, lastDeleteAt int) (*model.ChannelList, *model.AppError) - GetChannelsUserNotIn(teamId string, userId string, offset int, limit int) (*model.ChannelList, *model.AppError) + GetChannelsForUser(teamID string, userID string, includeDeleted bool, lastDeleteAt int) (*model.ChannelList, *model.AppError) + GetChannelsUserNotIn(teamID string, userID string, offset int, limit int) (*model.ChannelList, *model.AppError) GetCloudSession(token string) (*model.Session, *model.AppError) GetClusterId() string GetClusterStatus() []*model.ClusterInfo - GetCommand(commandId string) (*model.Command, *model.AppError) + GetCommand(commandID string) (*model.Command, *model.AppError) GetComplianceFile(job *model.Compliance) ([]byte, *model.AppError) GetComplianceReport(reportId string) (*model.Compliance, *model.AppError) GetComplianceReports(page, perPage int) (model.Compliances, *model.AppError) GetCookieDomain() string GetDataRetentionPolicy() (*model.DataRetentionPolicy, *model.AppError) GetDefaultProfileImage(user *model.User) ([]byte, *model.AppError) - GetDeletedChannels(teamId string, offset int, limit int, userId string) (*model.ChannelList, *model.AppError) + GetDeletedChannels(teamID string, offset int, limit int, userID string) (*model.ChannelList, *model.AppError) GetEmoji(emojiId string) (*model.Emoji, *model.AppError) GetEmojiByName(emojiName string) (*model.Emoji, *model.AppError) GetEmojiImage(emojiId string) ([]byte, string, *model.AppError) @@ -571,30 +571,30 @@ type AppIface interface { GetFileInfos(page, perPage int, opt *model.GetFileInfosOptions) ([]*model.FileInfo, *model.AppError) GetFileInfosForPost(postId string, fromMaster bool) ([]*model.FileInfo, *model.AppError) GetFileInfosForPostWithMigration(postId string) ([]*model.FileInfo, *model.AppError) - GetFlaggedPosts(userId string, offset int, limit int) (*model.PostList, *model.AppError) - GetFlaggedPostsForChannel(userId, channelId string, offset int, limit int) (*model.PostList, *model.AppError) - GetFlaggedPostsForTeam(userId, teamId string, offset int, limit int) (*model.PostList, *model.AppError) + GetFlaggedPosts(userID string, offset int, limit int) (*model.PostList, *model.AppError) + GetFlaggedPostsForChannel(userID, channelId string, offset int, limit int) (*model.PostList, *model.AppError) + GetFlaggedPostsForTeam(userID, teamID string, offset int, limit int) (*model.PostList, *model.AppError) GetGroup(id string) (*model.Group, *model.AppError) GetGroupByName(name string, opts model.GroupSearchOpts) (*model.Group, *model.AppError) GetGroupByRemoteID(remoteID string, groupSource model.GroupSource) (*model.Group, *model.AppError) - GetGroupChannel(userIds []string) (*model.Channel, *model.AppError) + GetGroupChannel(userIDs []string) (*model.Channel, *model.AppError) GetGroupMemberCount(groupID string) (int64, *model.AppError) GetGroupMemberUsers(groupID string) ([]*model.User, *model.AppError) GetGroupMemberUsersPage(groupID string, page int, perPage int) ([]*model.User, int, *model.AppError) GetGroupSyncable(groupID string, syncableID string, syncableType model.GroupSyncableType) (*model.GroupSyncable, *model.AppError) GetGroupSyncables(groupID string, syncableType model.GroupSyncableType) ([]*model.GroupSyncable, *model.AppError) GetGroups(page, perPage int, opts model.GroupSearchOpts) ([]*model.Group, *model.AppError) - GetGroupsAssociatedToChannelsByTeam(teamId string, opts model.GroupSearchOpts) (map[string][]*model.GroupWithSchemeAdmin, *model.AppError) + GetGroupsAssociatedToChannelsByTeam(teamID string, opts model.GroupSearchOpts) (map[string][]*model.GroupWithSchemeAdmin, *model.AppError) GetGroupsByChannel(channelId string, opts model.GroupSearchOpts) ([]*model.GroupWithSchemeAdmin, int, *model.AppError) GetGroupsByIDs(groupIDs []string) ([]*model.Group, *model.AppError) GetGroupsBySource(groupSource model.GroupSource) ([]*model.Group, *model.AppError) - GetGroupsByUserId(userId string) ([]*model.Group, *model.AppError) - GetHubForUserId(userId string) *Hub - GetIncomingWebhook(hookId string) (*model.IncomingWebhook, *model.AppError) - GetIncomingWebhooksForTeamPage(teamId string, page, perPage int) ([]*model.IncomingWebhook, *model.AppError) - GetIncomingWebhooksForTeamPageByUser(teamId string, userId string, page, perPage int) ([]*model.IncomingWebhook, *model.AppError) + GetGroupsByUserId(userID string) ([]*model.Group, *model.AppError) + GetHubForUserId(userID string) *Hub + GetIncomingWebhook(hookID string) (*model.IncomingWebhook, *model.AppError) + GetIncomingWebhooksForTeamPage(teamID string, page, perPage int) ([]*model.IncomingWebhook, *model.AppError) + GetIncomingWebhooksForTeamPageByUser(teamID string, userID string, page, perPage int) ([]*model.IncomingWebhook, *model.AppError) GetIncomingWebhooksPage(page, perPage int) ([]*model.IncomingWebhook, *model.AppError) - GetIncomingWebhooksPageByUser(userId string, page, perPage int) ([]*model.IncomingWebhook, *model.AppError) + GetIncomingWebhooksPageByUser(userID string, page, perPage int) ([]*model.IncomingWebhook, *model.AppError) GetJob(id string) (*model.Job, *model.AppError) GetJobs(offset int, limit int) ([]*model.Job, *model.AppError) GetJobsByType(jobType string, offset int, limit int) ([]*model.Job, *model.AppError) @@ -606,30 +606,30 @@ type AppIface interface { GetMemberCountsByGroup(channelID string, includeTimezones bool) ([]*model.ChannelMemberCountByGroup, *model.AppError) GetMessageForNotification(post *model.Post, translateFunc i18n.TranslateFunc) string GetMultipleEmojiByName(names []string) ([]*model.Emoji, *model.AppError) - GetNewUsersForTeamPage(teamId string, page, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) + GetNewUsersForTeamPage(teamID string, page, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) GetNextPostIdFromPostList(postList *model.PostList) string GetNotificationNameFormat(user *model.User) string - GetNumberOfChannelsOnTeam(teamId string) (int, *model.AppError) + GetNumberOfChannelsOnTeam(teamID string) (int, *model.AppError) GetOAuthAccessTokenForCodeFlow(clientId, grantType, redirectUri, code, secret, refreshToken string) (*model.AccessResponse, *model.AppError) - GetOAuthAccessTokenForImplicitFlow(userId string, authRequest *model.AuthorizeRequest) (*model.Session, *model.AppError) + GetOAuthAccessTokenForImplicitFlow(userID string, authRequest *model.AuthorizeRequest) (*model.Session, *model.AppError) GetOAuthApp(appId string) (*model.OAuthApp, *model.AppError) GetOAuthApps(page, perPage int) ([]*model.OAuthApp, *model.AppError) - GetOAuthAppsByCreator(userId string, page, perPage int) ([]*model.OAuthApp, *model.AppError) - GetOAuthCodeRedirect(userId string, authRequest *model.AuthorizeRequest) (string, *model.AppError) - GetOAuthImplicitRedirect(userId string, authRequest *model.AuthorizeRequest) (string, *model.AppError) - GetOAuthLoginEndpoint(w http.ResponseWriter, r *http.Request, service, teamId, action, redirectTo, loginHint string, isMobile bool) (string, *model.AppError) - GetOAuthSignupEndpoint(w http.ResponseWriter, r *http.Request, service, teamId string) (string, *model.AppError) + GetOAuthAppsByCreator(userID string, page, perPage int) ([]*model.OAuthApp, *model.AppError) + GetOAuthCodeRedirect(userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError) + GetOAuthImplicitRedirect(userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError) + GetOAuthLoginEndpoint(w http.ResponseWriter, r *http.Request, service, teamID, action, redirectTo, loginHint string, isMobile bool) (string, *model.AppError) + GetOAuthSignupEndpoint(w http.ResponseWriter, r *http.Request, service, teamID string) (string, *model.AppError) GetOAuthStateToken(token string) (*model.Token, *model.AppError) GetOpenGraphMetadata(requestURL string) *opengraph.OpenGraph - GetOrCreateDirectChannel(userId, otherUserId string) (*model.Channel, *model.AppError) - GetOutgoingWebhook(hookId string) (*model.OutgoingWebhook, *model.AppError) - GetOutgoingWebhooksForChannelPageByUser(channelId string, userId string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError) - GetOutgoingWebhooksForTeamPage(teamId string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError) - GetOutgoingWebhooksForTeamPageByUser(teamId string, userId string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError) + GetOrCreateDirectChannel(userID, otherUserId string) (*model.Channel, *model.AppError) + GetOutgoingWebhook(hookID string) (*model.OutgoingWebhook, *model.AppError) + GetOutgoingWebhooksForChannelPageByUser(channelId string, userID string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError) + GetOutgoingWebhooksForTeamPage(teamID string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError) + GetOutgoingWebhooksForTeamPageByUser(teamID string, userID string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError) GetOutgoingWebhooksPage(page, perPage int) ([]*model.OutgoingWebhook, *model.AppError) - GetOutgoingWebhooksPageByUser(userId string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError) + GetOutgoingWebhooksPageByUser(userID string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError) GetPasswordRecoveryToken(token string) (*model.Token, *model.AppError) - GetPermalinkPost(postId string, userId string) (*model.PostList, *model.AppError) + GetPermalinkPost(postId string, userID string) (*model.PostList, *model.AppError) GetPinnedPosts(channelId string) (*model.PostList, *model.AppError) GetPluginKey(pluginId string, key string) ([]byte, *model.AppError) GetPlugins() (*model.PluginsResponse, *model.AppError) @@ -642,20 +642,20 @@ type AppIface interface { GetPostsAroundPost(before bool, options model.GetPostsOptions) (*model.PostList, *model.AppError) GetPostsBeforePost(options model.GetPostsOptions) (*model.PostList, *model.AppError) GetPostsEtag(channelId string, collapsedThreads bool) string - GetPostsForChannelAroundLastUnread(channelId, userId string, limitBefore, limitAfter int, skipFetchThreads bool, collapsedThreads, collapsedThreadsExtended bool) (*model.PostList, *model.AppError) + GetPostsForChannelAroundLastUnread(channelId, userID string, limitBefore, limitAfter int, skipFetchThreads bool, collapsedThreads, collapsedThreadsExtended bool) (*model.PostList, *model.AppError) GetPostsPage(options model.GetPostsOptions) (*model.PostList, *model.AppError) GetPostsSince(options model.GetPostsSinceOptions) (*model.PostList, *model.AppError) - GetPreferenceByCategoryAndNameForUser(userId string, category string, preferenceName string) (*model.Preference, *model.AppError) - GetPreferenceByCategoryForUser(userId string, category string) (model.Preferences, *model.AppError) - GetPreferencesForUser(userId string) (model.Preferences, *model.AppError) + GetPreferenceByCategoryAndNameForUser(userID string, category string, preferenceName string) (*model.Preference, *model.AppError) + GetPreferenceByCategoryForUser(userID string, category string) (model.Preferences, *model.AppError) + GetPreferencesForUser(userID string) (model.Preferences, *model.AppError) GetPrevPostIdFromPostList(postList *model.PostList) string - GetPrivateChannelsForTeam(teamId string, offset int, limit int) (*model.ChannelList, *model.AppError) + GetPrivateChannelsForTeam(teamID string, offset int, limit int) (*model.ChannelList, *model.AppError) GetProfileImage(user *model.User) ([]byte, bool, *model.AppError) - GetPublicChannelsByIdsForTeam(teamId string, channelIds []string) (*model.ChannelList, *model.AppError) - GetPublicChannelsForTeam(teamId string, offset int, limit int) (*model.ChannelList, *model.AppError) + GetPublicChannelsByIdsForTeam(teamID string, channelIds []string) (*model.ChannelList, *model.AppError) + GetPublicChannelsForTeam(teamID string, offset int, limit int) (*model.ChannelList, *model.AppError) GetReactionsForPost(postId string) ([]*model.Reaction, *model.AppError) - GetRecentlyActiveUsersForTeam(teamId string) (map[string]*model.User, *model.AppError) - GetRecentlyActiveUsersForTeamPage(teamId string, page, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) + GetRecentlyActiveUsersForTeam(teamID string) (map[string]*model.User, *model.AppError) + GetRecentlyActiveUsersForTeamPage(teamID string, page, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) GetRole(id string) (*model.Role, *model.AppError) GetRoleByName(name string) (*model.Role, *model.AppError) GetRolesByNames(names []string) ([]*model.Role, *model.AppError) @@ -665,55 +665,55 @@ type AppIface interface { GetSanitizeOptions(asAdmin bool) map[string]bool GetScheme(id string) (*model.Scheme, *model.AppError) GetSchemeByName(name string) (*model.Scheme, *model.AppError) - GetSchemeRolesForTeam(teamId string) (string, string, string, *model.AppError) + GetSchemeRolesForTeam(teamID string) (string, string, string, *model.AppError) GetSchemes(scope string, offset int, limit int) ([]*model.Scheme, *model.AppError) GetSchemesPage(scope string, page int, perPage int) ([]*model.Scheme, *model.AppError) GetSession(token string) (*model.Session, *model.AppError) GetSessionById(sessionId string) (*model.Session, *model.AppError) - GetSessions(userId string) ([]*model.Session, *model.AppError) - GetSidebarCategories(userId, teamId string) (*model.OrderedSidebarCategories, *model.AppError) + GetSessions(userID string) ([]*model.Session, *model.AppError) + GetSidebarCategories(userID, teamID string) (*model.OrderedSidebarCategories, *model.AppError) GetSidebarCategory(categoryId string) (*model.SidebarCategoryWithChannels, *model.AppError) - GetSidebarCategoryOrder(userId, teamId string) ([]string, *model.AppError) + GetSidebarCategoryOrder(userID, teamID string) ([]string, *model.AppError) GetSinglePost(postId string) (*model.Post, *model.AppError) GetSiteURL() string - GetStatus(userId string) (*model.Status, *model.AppError) - GetStatusFromCache(userId string) *model.Status - GetStatusesByIds(userIds []string) (map[string]interface{}, *model.AppError) + GetStatus(userID string) (*model.Status, *model.AppError) + GetStatusFromCache(userID string) *model.Status + GetStatusesByIds(userIDs []string) (map[string]interface{}, *model.AppError) GetT() goi18n.TranslateFunc - GetTeam(teamId string) (*model.Team, *model.AppError) + GetTeam(teamID string) (*model.Team, *model.AppError) GetTeamByInviteId(inviteId string) (*model.Team, *model.AppError) GetTeamByName(name string) (*model.Team, *model.AppError) GetTeamIcon(team *model.Team) ([]byte, *model.AppError) GetTeamIdFromQuery(query url.Values) (string, *model.AppError) - GetTeamMember(teamId, userId string) (*model.TeamMember, *model.AppError) - GetTeamMembers(teamId string, offset int, limit int, teamMembersGetOptions *model.TeamMembersGetOptions) ([]*model.TeamMember, *model.AppError) - GetTeamMembersByIds(teamId string, userIds []string, restrictions *model.ViewUsersRestrictions) ([]*model.TeamMember, *model.AppError) - GetTeamMembersForUser(userId string) ([]*model.TeamMember, *model.AppError) - GetTeamMembersForUserWithPagination(userId string, page, perPage int) ([]*model.TeamMember, *model.AppError) - GetTeamStats(teamId string, restrictions *model.ViewUsersRestrictions) (*model.TeamStats, *model.AppError) - GetTeamUnread(teamId, userId string) (*model.TeamUnread, *model.AppError) + GetTeamMember(teamID, userID string) (*model.TeamMember, *model.AppError) + GetTeamMembers(teamID string, offset int, limit int, teamMembersGetOptions *model.TeamMembersGetOptions) ([]*model.TeamMember, *model.AppError) + GetTeamMembersByIds(teamID string, userIDs []string, restrictions *model.ViewUsersRestrictions) ([]*model.TeamMember, *model.AppError) + GetTeamMembersForUser(userID string) ([]*model.TeamMember, *model.AppError) + GetTeamMembersForUserWithPagination(userID string, page, perPage int) ([]*model.TeamMember, *model.AppError) + GetTeamStats(teamID string, restrictions *model.ViewUsersRestrictions) (*model.TeamStats, *model.AppError) + GetTeamUnread(teamID, userID string) (*model.TeamUnread, *model.AppError) GetTeamsForScheme(scheme *model.Scheme, offset int, limit int) ([]*model.Team, *model.AppError) GetTeamsForSchemePage(scheme *model.Scheme, page int, perPage int) ([]*model.Team, *model.AppError) - GetTeamsForUser(userId string) ([]*model.Team, *model.AppError) - GetTeamsUnreadForUser(excludeTeamId string, userId string) ([]*model.TeamUnread, *model.AppError) + GetTeamsForUser(userID string) ([]*model.Team, *model.AppError) + GetTeamsUnreadForUser(excludeTeamId string, userID string) ([]*model.TeamUnread, *model.AppError) GetTermsOfService(id string) (*model.TermsOfService, *model.AppError) - GetThreadForUser(userId, teamId, threadId string, extended bool) (*model.ThreadResponse, *model.AppError) - GetThreadMembershipsForUser(userId, teamId string) ([]*model.ThreadMembership, error) - GetThreadsForUser(userId, teamId string, options model.GetUserThreadsOpts) (*model.Threads, *model.AppError) + GetThreadForUser(userID, teamID, threadId string, extended bool) (*model.ThreadResponse, *model.AppError) + GetThreadMembershipsForUser(userID, teamID string) ([]*model.ThreadMembership, error) + GetThreadsForUser(userID, teamID string, options model.GetUserThreadsOpts) (*model.Threads, *model.AppError) GetUploadSession(uploadId string) (*model.UploadSession, *model.AppError) - GetUploadSessionsForUser(userId string) ([]*model.UploadSession, *model.AppError) - GetUser(userId string) (*model.User, *model.AppError) - GetUserAccessToken(tokenId string, sanitize bool) (*model.UserAccessToken, *model.AppError) + GetUploadSessionsForUser(userID string) ([]*model.UploadSession, *model.AppError) + GetUser(userID string) (*model.User, *model.AppError) + GetUserAccessToken(tokenID string, sanitize bool) (*model.UserAccessToken, *model.AppError) GetUserAccessTokens(page, perPage int) ([]*model.UserAccessToken, *model.AppError) - GetUserAccessTokensForUser(userId string, page, perPage int) ([]*model.UserAccessToken, *model.AppError) + GetUserAccessTokensForUser(userID string, page, perPage int) ([]*model.UserAccessToken, *model.AppError) GetUserByAuth(authData *string, authService string) (*model.User, *model.AppError) GetUserByEmail(email string) (*model.User, *model.AppError) GetUserByUsername(username string) (*model.User, *model.AppError) GetUserForLogin(id, loginId string) (*model.User, *model.AppError) - GetUserTermsOfService(userId string) (*model.UserTermsOfService, *model.AppError) + GetUserTermsOfService(userID string) (*model.UserTermsOfService, *model.AppError) GetUsers(options *model.UserGetOptions) ([]*model.User, *model.AppError) GetUsersByGroupChannelIds(channelIds []string, asAdmin bool) (map[string][]*model.User, *model.AppError) - GetUsersByIds(userIds []string, options *store.UserGetByIdsOpts) ([]*model.User, *model.AppError) + GetUsersByIds(userIDs []string, options *store.UserGetByIdsOpts) ([]*model.User, *model.AppError) GetUsersByUsernames(usernames []string, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) GetUsersEtag(restrictionsHash string) string GetUsersInChannel(options *model.UserGetOptions) ([]*model.User, *model.AppError) @@ -722,33 +722,33 @@ type AppIface interface { GetUsersInChannelPage(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError) GetUsersInChannelPageByStatus(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError) GetUsersInTeam(options *model.UserGetOptions) ([]*model.User, *model.AppError) - GetUsersInTeamEtag(teamId string, restrictionsHash string) string + GetUsersInTeamEtag(teamID string, restrictionsHash string) string GetUsersInTeamPage(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError) - GetUsersNotInChannel(teamId string, channelId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) - GetUsersNotInChannelMap(teamId string, channelId string, groupConstrained bool, offset int, limit int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) (map[string]*model.User, *model.AppError) - GetUsersNotInChannelPage(teamId string, channelId string, groupConstrained bool, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) - GetUsersNotInTeam(teamId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) - GetUsersNotInTeamEtag(teamId string, restrictionsHash string) string - GetUsersNotInTeamPage(teamId string, groupConstrained bool, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) + GetUsersNotInChannel(teamID string, channelId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) + GetUsersNotInChannelMap(teamID string, channelId string, groupConstrained bool, offset int, limit int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) (map[string]*model.User, *model.AppError) + GetUsersNotInChannelPage(teamID string, channelId string, groupConstrained bool, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) + GetUsersNotInTeam(teamID string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) + GetUsersNotInTeamEtag(teamID string, restrictionsHash string) string + GetUsersNotInTeamPage(teamID string, groupConstrained bool, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) GetUsersPage(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError) GetUsersWithoutTeam(options *model.UserGetOptions) ([]*model.User, *model.AppError) GetUsersWithoutTeamPage(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError) GetVerifyEmailToken(token string) (*model.Token, *model.AppError) - GetViewUsersRestrictions(userId string) (*model.ViewUsersRestrictions, *model.AppError) + GetViewUsersRestrictions(userID string) (*model.ViewUsersRestrictions, *model.AppError) GetWarnMetricsStatus() (map[string]*model.WarnMetricStatus, *model.AppError) HTTPService() httpservice.HTTPService Handle404(w http.ResponseWriter, r *http.Request) HandleCommandResponse(command *model.Command, args *model.CommandArgs, response *model.CommandResponse, builtIn bool) (*model.CommandResponse, *model.AppError) HandleCommandResponsePost(command *model.Command, args *model.CommandArgs, response *model.CommandResponse, builtIn bool) (*model.Post, *model.AppError) - HandleCommandWebhook(hookId string, response *model.CommandResponse) *model.AppError + HandleCommandWebhook(hookID string, response *model.CommandResponse) *model.AppError HandleImages(previewPathList []string, thumbnailPathList []string, fileData [][]byte) - HandleIncomingWebhook(hookId string, req *model.IncomingWebhookRequest) *model.AppError + HandleIncomingWebhook(hookID string, req *model.IncomingWebhookRequest) *model.AppError HandleMessageExportConfig(cfg *model.Config, appCfg *model.Config) HasPermissionTo(askingUserId string, permission *model.Permission) bool HasPermissionToChannel(askingUserId string, channelId string, permission *model.Permission) bool HasPermissionToChannelByPost(askingUserId string, postId string, permission *model.Permission) bool - HasPermissionToTeam(askingUserId string, teamId string, permission *model.Permission) bool - HasPermissionToUser(askingUserId string, userId string) bool + HasPermissionToTeam(askingUserId string, teamID string, permission *model.Permission) bool + HasPermissionToUser(askingUserId string, userID string) bool HubStop() ImageProxy() *imageproxy.ImageProxy ImageProxyAdder() func(string) string @@ -759,12 +759,12 @@ type AppIface interface { InitServer() InstallPluginFromData(data model.PluginEventData) InvalidateAllEmailInvites() *model.AppError - InvalidateCacheForUser(userId string) - InvalidateWebConnSessionCacheForUser(userId string) - InviteGuestsToChannels(teamId string, guestsInvite *model.GuestsInvite, senderId string) *model.AppError - InviteGuestsToChannelsGracefully(teamId string, guestsInvite *model.GuestsInvite, senderId string) ([]*model.EmailInviteWithError, *model.AppError) - InviteNewUsersToTeam(emailList []string, teamId, senderId string) *model.AppError - InviteNewUsersToTeamGracefully(emailList []string, teamId, senderId string) ([]*model.EmailInviteWithError, *model.AppError) + InvalidateCacheForUser(userID string) + InvalidateWebConnSessionCacheForUser(userID string) + InviteGuestsToChannels(teamID string, guestsInvite *model.GuestsInvite, senderId string) *model.AppError + InviteGuestsToChannelsGracefully(teamID string, guestsInvite *model.GuestsInvite, senderId string) ([]*model.EmailInviteWithError, *model.AppError) + InviteNewUsersToTeam(emailList []string, teamID, senderId string) *model.AppError + InviteNewUsersToTeamGracefully(emailList []string, teamID, senderId string) ([]*model.EmailInviteWithError, *model.AppError) IpAddress() string IsFirstUserAccount() bool IsLeader() bool @@ -772,22 +772,22 @@ type AppIface interface { IsPhase2MigrationCompleted() *model.AppError IsUserAway(lastActivityAt int64) bool IsUserSignUpAllowed() *model.AppError - JoinChannel(channel *model.Channel, userId string) *model.AppError - JoinDefaultChannels(teamId string, user *model.User, shouldBeAdmin bool, userRequestorId string) *model.AppError + JoinChannel(channel *model.Channel, userID string) *model.AppError + JoinDefaultChannels(teamID string, user *model.User, shouldBeAdmin bool, userRequestorId string) *model.AppError JoinUserToTeam(team *model.Team, user *model.User, userRequestorId string) *model.AppError Ldap() einterfaces.LdapInterface - LeaveChannel(channelId string, userId string) *model.AppError + LeaveChannel(channelId string, userID string) *model.AppError LeaveTeam(team *model.Team, user *model.User, requestorId string) *model.AppError LimitedClientConfig() map[string]string - ListAllCommands(teamId string, T goi18n.TranslateFunc) ([]*model.Command, *model.AppError) + ListAllCommands(teamID string, T goi18n.TranslateFunc) ([]*model.Command, *model.AppError) ListDirectory(path string) ([]string, *model.AppError) ListImports() ([]string, *model.AppError) ListPluginKeys(pluginId string, page, perPage int) ([]string, *model.AppError) - ListTeamCommands(teamId string) ([]*model.Command, *model.AppError) + ListTeamCommands(teamID string) ([]*model.Command, *model.AppError) Log() *mlog.Logger - LoginByOAuth(service string, userData io.Reader, teamId string, tokenUser *model.User) (*model.User, *model.AppError) + LoginByOAuth(service string, userData io.Reader, teamID string, tokenUser *model.User) (*model.User, *model.AppError) MakePermissionError(permissions []*model.Permission) *model.AppError - MarkChannelsAsViewed(channelIds []string, userId string, currentSessionId string) (map[string]int64, *model.AppError) + MarkChannelsAsViewed(channelIds []string, userID string, currentSessionId string) (map[string]int64, *model.AppError) MaxPostSize() int MessageExport() einterfaces.MessageExportInterface Metrics() einterfaces.MetricsInterface @@ -801,26 +801,26 @@ type AppIface interface { NotifyAndSetWarnMetricAck(warnMetricId string, sender *model.User, forceAck bool, isBot bool) *model.AppError OpenInteractiveDialog(request model.OpenDialogRequest) *model.AppError OriginChecker() func(*http.Request) bool - PatchChannel(channel *model.Channel, patch *model.ChannelPatch, userId string) (*model.Channel, *model.AppError) + PatchChannel(channel *model.Channel, patch *model.ChannelPatch, userID string) (*model.Channel, *model.AppError) PatchPost(postId string, patch *model.PostPatch) (*model.Post, *model.AppError) PatchRole(role *model.Role, patch *model.RolePatch) (*model.Role, *model.AppError) PatchScheme(scheme *model.Scheme, patch *model.SchemePatch) (*model.Scheme, *model.AppError) - PatchTeam(teamId string, patch *model.TeamPatch) (*model.Team, *model.AppError) - PatchUser(userId string, patch *model.UserPatch, asAdmin bool) (*model.User, *model.AppError) + PatchTeam(teamID string, patch *model.TeamPatch) (*model.Team, *model.AppError) + PatchUser(userID string, patch *model.UserPatch, asAdmin bool) (*model.User, *model.AppError) Path() string PermanentDeleteAllUsers() *model.AppError PermanentDeleteChannel(channel *model.Channel) *model.AppError PermanentDeleteTeam(team *model.Team) *model.AppError - PermanentDeleteTeamId(teamId string) *model.AppError + PermanentDeleteTeamId(teamID string) *model.AppError PermanentDeleteUser(user *model.User) *model.AppError - PluginCommandsForTeam(teamId string) []*model.Command + PluginCommandsForTeam(teamID string) []*model.Command PluginContext() *plugin.Context PostActionCookieSecret() []byte PostAddToChannelMessage(user *model.User, addedUser *model.User, channel *model.Channel, postRootId string) *model.AppError PostPatchWithProxyRemovedFromImageURLs(patch *model.PostPatch) *model.PostPatch - PostUpdateChannelDisplayNameMessage(userId string, channel *model.Channel, oldChannelDisplayName, newChannelDisplayName string) *model.AppError - PostUpdateChannelHeaderMessage(userId string, channel *model.Channel, oldChannelHeader, newChannelHeader string) *model.AppError - PostUpdateChannelPurposeMessage(userId string, channel *model.Channel, oldChannelPurpose string, newChannelPurpose string) *model.AppError + PostUpdateChannelDisplayNameMessage(userID string, channel *model.Channel, oldChannelDisplayName, newChannelDisplayName string) *model.AppError + PostUpdateChannelHeaderMessage(userID string, channel *model.Channel, oldChannelHeader, newChannelHeader string) *model.AppError + PostUpdateChannelPurposeMessage(userID string, channel *model.Channel, oldChannelPurpose string, newChannelPurpose string) *model.AppError PostWithProxyAddedToImageURLs(post *model.Post) *model.Post PostWithProxyRemovedFromImageURLs(post *model.Post) *model.Post PreparePostForClient(originalPost *model.Post, isNewPost bool, isEditPost bool) *model.Post @@ -828,7 +828,7 @@ type AppIface interface { ProcessSlackText(text string) string Publish(message *model.WebSocketEvent) PublishSkipClusterSend(message *model.WebSocketEvent) - PublishUserTyping(userId, channelId, parentId string) *model.AppError + PublishUserTyping(userID, channelId, parentId string) *model.AppError PurgeBleveIndexes() *model.AppError PurgeElasticsearchIndexes() *model.AppError ReadFile(path string) ([]byte, *model.AppError) @@ -836,7 +836,7 @@ type AppIface interface { RegenCommandToken(cmd *model.Command) (*model.Command, *model.AppError) RegenOutgoingWebhookToken(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) RegenerateOAuthAppSecret(app *model.OAuthApp) (*model.OAuthApp, *model.AppError) - RegenerateTeamInviteId(teamId string) (*model.Team, *model.AppError) + RegenerateTeamInviteId(teamID string) (*model.Team, *model.AppError) RegisterPluginCommand(pluginId string, command *model.Command) error ReloadConfig() error RemoveAllDeactivatedMembersFromChannel(channel *model.Channel) *model.AppError @@ -850,24 +850,24 @@ type AppIface interface { RemoveSamlIdpCertificate() *model.AppError RemoveSamlPrivateCertificate() *model.AppError RemoveSamlPublicCertificate() *model.AppError - RemoveTeamIcon(teamId string) *model.AppError + RemoveTeamIcon(teamID string) *model.AppError RemoveTeamMemberFromTeam(teamMember *model.TeamMember, requestorId string) *model.AppError - RemoveUserFromChannel(userIdToRemove string, removerUserId string, channel *model.Channel) *model.AppError - RemoveUserFromTeam(teamId string, userId string, requestorId string) *model.AppError + RemoveUserFromChannel(userIDToRemove string, removerUserId string, channel *model.Channel) *model.AppError + RemoveUserFromTeam(teamID string, userID string, requestorId string) *model.AppError RemoveUsersFromChannelNotMemberOfTeam(remover *model.User, channel *model.Channel, team *model.Team) *model.AppError RequestId() string RequestLicenseAndAckWarnMetric(warnMetricId string, isBot bool) *model.AppError ResetPasswordFromToken(userSuppliedTokenString, newPassword string) *model.AppError ResetPermissionsSystem() *model.AppError - RestoreChannel(channel *model.Channel, userId string) (*model.Channel, *model.AppError) - RestoreTeam(teamId string) *model.AppError - RestrictUsersGetByPermissions(userId string, options *model.UserGetOptions) (*model.UserGetOptions, *model.AppError) - RestrictUsersSearchByPermissions(userId string, options *model.UserSearchOptions) (*model.UserSearchOptions, *model.AppError) + RestoreChannel(channel *model.Channel, userID string) (*model.Channel, *model.AppError) + RestoreTeam(teamID string) *model.AppError + RestrictUsersGetByPermissions(userID string, options *model.UserGetOptions) (*model.UserGetOptions, *model.AppError) + RestrictUsersSearchByPermissions(userID string, options *model.UserSearchOptions) (*model.UserSearchOptions, *model.AppError) RevokeAccessToken(token string) *model.AppError - RevokeAllSessions(userId string) *model.AppError + RevokeAllSessions(userID string) *model.AppError RevokeSession(session *model.Session) *model.AppError RevokeSessionById(sessionId string) *model.AppError - RevokeSessionsForDeviceId(userId string, deviceId string, currentSessionId string) *model.AppError + RevokeSessionsForDeviceId(userID string, deviceId string, currentSessionId string) *model.AppError RevokeUserAccessToken(token *model.UserAccessToken) *model.AppError RolesGrantPermission(roleNames []string, permissionId string) bool Saml() einterfaces.SamlInterface @@ -878,32 +878,32 @@ type AppIface interface { SaveBrandImage(imageData *multipart.FileHeader) *model.AppError SaveComplianceReport(job *model.Compliance) (*model.Compliance, *model.AppError) SaveReactionForPost(reaction *model.Reaction) (*model.Reaction, *model.AppError) - SaveUserTermsOfService(userId, termsOfServiceId string, accepted bool) *model.AppError + SaveUserTermsOfService(userID, termsOfServiceId string, accepted bool) *model.AppError SchemesIterator(scope string, batchSize int) func() []*model.Scheme - SearchArchivedChannels(teamId string, term string, userId string) (*model.ChannelList, *model.AppError) - SearchChannels(teamId string, term string) (*model.ChannelList, *model.AppError) - SearchChannelsForUser(userId, teamId, term string) (*model.ChannelList, *model.AppError) - SearchChannelsUserNotIn(teamId string, userId string, term string) (*model.ChannelList, *model.AppError) + SearchArchivedChannels(teamID string, term string, userID string) (*model.ChannelList, *model.AppError) + SearchChannels(teamID string, term string) (*model.ChannelList, *model.AppError) + SearchChannelsForUser(userID, teamID, term string) (*model.ChannelList, *model.AppError) + SearchChannelsUserNotIn(teamID string, userID string, term string) (*model.ChannelList, *model.AppError) SearchEmoji(name string, prefixOnly bool, limit int) ([]*model.Emoji, *model.AppError) SearchEngine() *searchengine.Broker - SearchGroupChannels(userId, term string) (*model.ChannelList, *model.AppError) - SearchPostsInTeam(teamId string, paramsList []*model.SearchParams) (*model.PostList, *model.AppError) - SearchPostsInTeamForUser(terms string, userId string, teamId string, isOrSearch bool, includeDeletedChannels bool, timeZoneOffset int, page, perPage int) (*model.PostSearchResults, *model.AppError) + SearchGroupChannels(userID, term string) (*model.ChannelList, *model.AppError) + SearchPostsInTeam(teamID string, paramsList []*model.SearchParams) (*model.PostList, *model.AppError) + SearchPostsInTeamForUser(terms string, userID string, teamID string, isOrSearch bool, includeDeletedChannels bool, timeZoneOffset int, page, perPage int) (*model.PostSearchResults, *model.AppError) SearchPrivateTeams(term string) ([]*model.Team, *model.AppError) SearchPublicTeams(term string) ([]*model.Team, *model.AppError) SearchUserAccessTokens(term string) ([]*model.UserAccessToken, *model.AppError) SearchUsers(props *model.UserSearch, options *model.UserSearchOptions) ([]*model.User, *model.AppError) SearchUsersInChannel(channelId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) SearchUsersInGroup(groupID string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) - SearchUsersInTeam(teamId, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) - SearchUsersNotInChannel(teamId string, channelId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) + SearchUsersInTeam(teamID, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) + SearchUsersNotInChannel(teamID string, channelId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) SearchUsersNotInTeam(notInTeamId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) SearchUsersWithoutTeam(term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) SendAckToPushProxy(ack *model.PushNotificationAck) error SendAutoResponse(channel *model.Channel, receiver *model.User, post *model.Post) (bool, *model.AppError) SendAutoResponseIfNecessary(channel *model.Channel, sender *model.User, post *model.Post) (bool, *model.AppError) SendEmailVerification(user *model.User, newEmail, redirect string) *model.AppError - SendEphemeralPost(userId string, post *model.Post) *model.Post + SendEphemeralPost(userID string, post *model.Post) *model.Post SendNotifications(post *model.Post, team *model.Team, channel *model.Channel, sender *model.User, parentPostList *model.PostList, setOnline bool) ([]string, error) SendPasswordReset(email string, siteURL string) (bool, *model.AppError) SendPaymentFailedEmail(failedPayment *model.FailedPayment) *model.AppError @@ -913,14 +913,14 @@ type AppIface interface { SessionCacheLength() int SessionHasPermissionTo(session model.Session, permission *model.Permission) bool SessionHasPermissionToAny(session model.Session, permissions []*model.Permission) bool - SessionHasPermissionToCategory(session model.Session, userId, teamId, categoryId string) bool + SessionHasPermissionToCategory(session model.Session, userID, teamID, categoryId string) bool SessionHasPermissionToChannel(session model.Session, channelId string, permission *model.Permission) bool SessionHasPermissionToChannelByPost(session model.Session, postId string, permission *model.Permission) bool - SessionHasPermissionToTeam(session model.Session, teamId string, permission *model.Permission) bool - SessionHasPermissionToUser(session model.Session, userId string) bool - SessionHasPermissionToUserOrBot(session model.Session, userId string) bool + SessionHasPermissionToTeam(session model.Session, teamID string, permission *model.Permission) bool + SessionHasPermissionToUser(session model.Session, userID string) bool + SessionHasPermissionToUserOrBot(session model.Session, userID string) bool SetAcceptLanguage(s string) - SetActiveChannel(userId string, channelId string) *model.AppError + SetActiveChannel(userID string, channelId string) *model.AppError SetAutoResponderStatus(user *model.User, oldNotifyProps model.StringMap) SetContext(c context.Context) SetDefaultProfileImage(user *model.User) *model.AppError @@ -931,26 +931,26 @@ type AppIface interface { SetPluginKeyWithExpiry(pluginId string, key string, value []byte, expireInSeconds int64) *model.AppError SetPluginKeyWithOptions(pluginId string, key string, value []byte, options model.PluginKVSetOptions) (bool, *model.AppError) SetPluginsEnvironment(pluginsEnvironment *plugin.Environment) - SetProfileImage(userId string, imageData *multipart.FileHeader) *model.AppError - SetProfileImageFromFile(userId string, file io.Reader) *model.AppError - SetProfileImageFromMultiPartFile(userId string, file multipart.File) *model.AppError + SetProfileImage(userID string, imageData *multipart.FileHeader) *model.AppError + SetProfileImageFromFile(userID string, file io.Reader) *model.AppError + SetProfileImageFromMultiPartFile(userID string, file multipart.File) *model.AppError SetRequestId(s string) SetSamlIdpCertificateFromMetadata(data []byte) *model.AppError SetSearchEngine(se *searchengine.Broker) SetServer(srv *Server) SetSession(s *model.Session) - SetStatusAwayIfNeeded(userId string, manual bool) - SetStatusDoNotDisturb(userId string) - SetStatusOffline(userId string, manual bool) - SetStatusOnline(userId string, manual bool) - SetStatusOutOfOffice(userId string) + SetStatusAwayIfNeeded(userID string, manual bool) + SetStatusDoNotDisturb(userID string) + SetStatusOffline(userID string, manual bool) + SetStatusOnline(userID string, manual bool) + SetStatusOutOfOffice(userID string) SetT(t goi18n.TranslateFunc) - SetTeamIcon(teamId string, imageData *multipart.FileHeader) *model.AppError + SetTeamIcon(teamID string, imageData *multipart.FileHeader) *model.AppError SetTeamIconFromFile(team *model.Team, file io.Reader) *model.AppError - SetTeamIconFromMultiPartFile(teamId string, file multipart.File) *model.AppError + SetTeamIconFromMultiPartFile(teamID string, file multipart.File) *model.AppError SetUserAgent(s string) SlackImport(fileData multipart.File, fileSize int64, teamID string) (*model.AppError, *bytes.Buffer) - SoftDeleteTeam(teamId string) *model.AppError + SoftDeleteTeam(teamID string) *model.AppError Srv() *Server SubmitInteractiveDialog(request model.SubmitDialogRequest) (*model.SubmitDialogResponse, *model.AppError) SwitchEmailToLdap(email, password, code, ldapLoginId, ldapPassword string) (string, *model.AppError) @@ -964,72 +964,72 @@ type AppIface interface { TeamMembersToRemove(teamID *string) ([]*model.TeamMember, *model.AppError) TelemetryId() string TestElasticsearch(cfg *model.Config) *model.AppError - TestEmail(userId string, cfg *model.Config) *model.AppError + TestEmail(userID string, cfg *model.Config) *model.AppError TestFilesStoreConnection() *model.AppError TestFilesStoreConnectionWithConfig(cfg *model.FileSettings) *model.AppError TestLdap() *model.AppError TestSiteURL(siteURL string) *model.AppError Timezones() *timezones.Timezones - ToggleMuteChannel(channelId, userId string) (*model.ChannelMember, *model.AppError) + ToggleMuteChannel(channelId, userID string) (*model.ChannelMember, *model.AppError) TotalWebsocketConnections() int TriggerWebhook(payload *model.OutgoingWebhookPayload, hook *model.OutgoingWebhook, post *model.Post, channel *model.Channel) - UnregisterPluginCommand(pluginId, teamId, trigger string) + UnregisterPluginCommand(pluginId, teamID, trigger string) UnregisterPluginCommands(pluginId string) UpdateActive(user *model.User, active bool) (*model.User, *model.AppError) - UpdateChannelLastViewedAt(channelIds []string, userId string) *model.AppError - UpdateChannelMemberNotifyProps(data map[string]string, channelId string, userId string) (*model.ChannelMember, *model.AppError) - UpdateChannelMemberRoles(channelId string, userId string, newRoles string) (*model.ChannelMember, *model.AppError) - UpdateChannelMemberSchemeRoles(channelId string, userId string, isSchemeGuest bool, isSchemeUser bool, isSchemeAdmin bool) (*model.ChannelMember, *model.AppError) + UpdateChannelLastViewedAt(channelIds []string, userID string) *model.AppError + UpdateChannelMemberNotifyProps(data map[string]string, channelId string, userID string) (*model.ChannelMember, *model.AppError) + UpdateChannelMemberRoles(channelId string, userID string, newRoles string) (*model.ChannelMember, *model.AppError) + UpdateChannelMemberSchemeRoles(channelId string, userID string, isSchemeGuest bool, isSchemeUser bool, isSchemeAdmin bool) (*model.ChannelMember, *model.AppError) UpdateChannelPrivacy(oldChannel *model.Channel, user *model.User) (*model.Channel, *model.AppError) UpdateCommand(oldCmd, updatedCmd *model.Command) (*model.Command, *model.AppError) UpdateConfig(f func(*model.Config)) - UpdateEphemeralPost(userId string, post *model.Post) *model.Post + UpdateEphemeralPost(userID string, post *model.Post) *model.Post UpdateGroup(group *model.Group) (*model.Group, *model.AppError) UpdateGroupSyncable(groupSyncable *model.GroupSyncable) (*model.GroupSyncable, *model.AppError) UpdateHashedPassword(user *model.User, newHashedPassword string) *model.AppError - UpdateHashedPasswordByUserId(userId, newHashedPassword string) *model.AppError + UpdateHashedPasswordByUserId(userID, newHashedPassword string) *model.AppError UpdateIncomingWebhook(oldHook, updatedHook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) UpdateLastActivityAtIfNeeded(session model.Session) - UpdateMfa(activate bool, userId, token string) *model.AppError - UpdateMobileAppBadge(userId string) + UpdateMfa(activate bool, userID, token string) *model.AppError + UpdateMobileAppBadge(userID string) UpdateOAuthUserAttrs(userData io.Reader, user *model.User, provider einterfaces.OauthProvider, service string, tokenUser *model.User) *model.AppError UpdateOauthApp(oldApp, updatedApp *model.OAuthApp) (*model.OAuthApp, *model.AppError) UpdateOutgoingWebhook(oldHook, updatedHook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) UpdatePassword(user *model.User, newPassword string) *model.AppError - UpdatePasswordAsUser(userId, currentPassword, newPassword string) *model.AppError - UpdatePasswordByUserIdSendEmail(userId, newPassword, method string) *model.AppError + UpdatePasswordAsUser(userID, currentPassword, newPassword string) *model.AppError + UpdatePasswordByUserIdSendEmail(userID, newPassword, method string) *model.AppError UpdatePasswordSendEmail(user *model.User, newPassword, method string) *model.AppError UpdatePost(post *model.Post, safeUpdate bool) (*model.Post, *model.AppError) - UpdatePreferences(userId string, preferences model.Preferences) *model.AppError + UpdatePreferences(userID string, preferences model.Preferences) *model.AppError UpdateRole(role *model.Role) (*model.Role, *model.AppError) UpdateScheme(scheme *model.Scheme) (*model.Scheme, *model.AppError) - UpdateSessionsIsGuest(userId string, isGuest bool) - UpdateSidebarCategories(userId, teamId string, categories []*model.SidebarCategoryWithChannels) ([]*model.SidebarCategoryWithChannels, *model.AppError) - UpdateSidebarCategoryOrder(userId, teamId string, categoryOrder []string) *model.AppError + UpdateSessionsIsGuest(userID string, isGuest bool) + UpdateSidebarCategories(userID, teamID string, categories []*model.SidebarCategoryWithChannels) ([]*model.SidebarCategoryWithChannels, *model.AppError) + UpdateSidebarCategoryOrder(userID, teamID string, categoryOrder []string) *model.AppError UpdateTeam(team *model.Team) (*model.Team, *model.AppError) - UpdateTeamMemberRoles(teamId string, userId string, newRoles string) (*model.TeamMember, *model.AppError) - UpdateTeamMemberSchemeRoles(teamId string, userId string, isSchemeGuest bool, isSchemeUser bool, isSchemeAdmin bool) (*model.TeamMember, *model.AppError) - UpdateTeamPrivacy(teamId string, teamType string, allowOpenInvite bool) *model.AppError + UpdateTeamMemberRoles(teamID string, userID string, newRoles string) (*model.TeamMember, *model.AppError) + UpdateTeamMemberSchemeRoles(teamID string, userID string, isSchemeGuest bool, isSchemeUser bool, isSchemeAdmin bool) (*model.TeamMember, *model.AppError) + UpdateTeamPrivacy(teamID string, teamType string, allowOpenInvite bool) *model.AppError UpdateTeamScheme(team *model.Team) (*model.Team, *model.AppError) - UpdateThreadFollowForUser(userId, threadId string, state bool) *model.AppError - UpdateThreadReadForUser(userId, teamId, threadId string, timestamp int64) *model.AppError - UpdateThreadsReadForUser(userId, teamId string) *model.AppError + UpdateThreadFollowForUser(userID, threadId string, state bool) *model.AppError + UpdateThreadReadForUser(userID, teamID, threadId string, timestamp int64) *model.AppError + UpdateThreadsReadForUser(userID, teamID string) *model.AppError UpdateUser(user *model.User, sendNotifications bool) (*model.User, *model.AppError) - UpdateUserActive(userId string, active bool) *model.AppError + UpdateUserActive(userID string, active bool) *model.AppError UpdateUserAsUser(user *model.User, asAdmin bool) (*model.User, *model.AppError) - UpdateUserAuth(userId string, userAuth *model.UserAuth) (*model.UserAuth, *model.AppError) - UpdateUserNotifyProps(userId string, props map[string]string, sendNotifications bool) (*model.User, *model.AppError) - UpdateUserRoles(userId string, newRoles string, sendWebSocketEvent bool) (*model.User, *model.AppError) + UpdateUserAuth(userID string, userAuth *model.UserAuth) (*model.UserAuth, *model.AppError) + UpdateUserNotifyProps(userID string, props map[string]string, sendNotifications bool) (*model.User, *model.AppError) + UpdateUserRoles(userID string, newRoles string, sendWebSocketEvent bool) (*model.User, *model.AppError) UploadData(us *model.UploadSession, rd io.Reader) (*model.FileInfo, *model.AppError) UploadEmojiImage(id string, imageData *multipart.FileHeader) *model.AppError - UploadMultipartFiles(teamId string, channelId string, userId string, fileHeaders []*multipart.FileHeader, clientIds []string, now time.Time) (*model.FileUploadResponse, *model.AppError) + UploadMultipartFiles(teamID string, channelId string, userID string, fileHeaders []*multipart.FileHeader, clientIds []string, now time.Time) (*model.FileUploadResponse, *model.AppError) UpsertGroupMember(groupID string, userID string) (*model.GroupMember, *model.AppError) UpsertGroupSyncable(groupSyncable *model.GroupSyncable) (*model.GroupSyncable, *model.AppError) UserAgent() string - UserCanSeeOtherUser(userId string, otherUserId string) (bool, *model.AppError) + UserCanSeeOtherUser(userID string, otherUserId string) (bool, *model.AppError) VerifyEmailFromToken(userSuppliedTokenString string) *model.AppError - VerifyUserEmail(userId, email string) *model.AppError - ViewChannel(view *model.ChannelView, userId string, currentSessionId string) (map[string]int64, *model.AppError) - WaitForChannelMembership(channelId string, userId string) + VerifyUserEmail(userID, email string) *model.AppError + ViewChannel(view *model.ChannelView, userID string, currentSessionId string) (map[string]int64, *model.AppError) + WaitForChannelMembership(channelId string, userID string) WriteFile(fr io.Reader, path string) (int64, *model.AppError) } diff --git a/app/audit.go b/app/audit.go index 9291298cff..bf3c1448b9 100644 --- a/app/audit.go +++ b/app/audit.go @@ -32,8 +32,8 @@ var ( LevelCLI = mlog.LvlAuditCLI ) -func (a *App) GetAudits(userId string, limit int) (model.Audits, *model.AppError) { - audits, err := a.Srv().Store.Audit().Get(userId, 0, limit) +func (a *App) GetAudits(userID string, limit int) (model.Audits, *model.AppError) { + audits, err := a.Srv().Store.Audit().Get(userID, 0, limit) if err != nil { var outErr *store.ErrOutOfBounds switch { @@ -46,8 +46,8 @@ func (a *App) GetAudits(userId string, limit int) (model.Audits, *model.AppError return audits, nil } -func (a *App) GetAuditsPage(userId string, page int, perPage int) (model.Audits, *model.AppError) { - audits, err := a.Srv().Store.Audit().Get(userId, page*perPage, perPage) +func (a *App) GetAuditsPage(userID string, page int, perPage int) (model.Audits, *model.AppError) { + audits, err := a.Srv().Store.Audit().Get(userID, page*perPage, perPage) if err != nil { var outErr *store.ErrOutOfBounds switch { diff --git a/app/authorization.go b/app/authorization.go index 05d32c5a81..efba02cc16 100644 --- a/app/authorization.go +++ b/app/authorization.go @@ -36,15 +36,15 @@ func (a *App) SessionHasPermissionToAny(session model.Session, permissions []*mo return false } -func (a *App) SessionHasPermissionToTeam(session model.Session, teamId string, permission *model.Permission) bool { - if teamId == "" { +func (a *App) SessionHasPermissionToTeam(session model.Session, teamID string, permission *model.Permission) bool { + if teamID == "" { return false } if session.IsUnrestricted() { return true } - teamMember := session.GetTeamByTeamId(teamId) + teamMember := session.GetTeamByTeamId(teamID) if teamMember != nil { if a.RolesGrantPermission(teamMember.GetRoles(), permission.Id) { return true @@ -104,23 +104,23 @@ func (a *App) SessionHasPermissionToChannelByPost(session model.Session, postId return a.SessionHasPermissionTo(session, permission) } -func (a *App) SessionHasPermissionToCategory(session model.Session, userId, teamId, categoryId string) bool { +func (a *App) SessionHasPermissionToCategory(session model.Session, userID, teamID, categoryId string) bool { if a.SessionHasPermissionTo(session, model.PERMISSION_EDIT_OTHER_USERS) { return true } category, err := a.GetSidebarCategory(categoryId) - return err == nil && category != nil && category.UserId == session.UserId && category.UserId == userId && category.TeamId == teamId + return err == nil && category != nil && category.UserId == session.UserId && category.UserId == userID && category.TeamId == teamID } -func (a *App) SessionHasPermissionToUser(session model.Session, userId string) bool { - if userId == "" { +func (a *App) SessionHasPermissionToUser(session model.Session, userID string) bool { + if userID == "" { return false } if session.IsUnrestricted() { return true } - if session.UserId == userId { + if session.UserId == userID { return true } @@ -131,15 +131,15 @@ func (a *App) SessionHasPermissionToUser(session model.Session, userId string) b return false } -func (a *App) SessionHasPermissionToUserOrBot(session model.Session, userId string) bool { +func (a *App) SessionHasPermissionToUserOrBot(session model.Session, userID string) bool { if session.IsUnrestricted() { return true } - if a.SessionHasPermissionToUser(session, userId) { + if a.SessionHasPermissionToUser(session, userID) { return true } - if err := a.SessionHasPermissionToManageBot(session, userId); err == nil { + if err := a.SessionHasPermissionToManageBot(session, userID); err == nil { return true } @@ -157,11 +157,11 @@ func (a *App) HasPermissionTo(askingUserId string, permission *model.Permission) return a.RolesGrantPermission(roles, permission.Id) } -func (a *App) HasPermissionToTeam(askingUserId string, teamId string, permission *model.Permission) bool { - if teamId == "" || askingUserId == "" { +func (a *App) HasPermissionToTeam(askingUserId string, teamID string, permission *model.Permission) bool { + if teamID == "" || askingUserId == "" { return false } - teamMember, _ := a.GetTeamMember(teamId, askingUserId) + teamMember, _ := a.GetTeamMember(teamID, askingUserId) if teamMember != nil && teamMember.DeleteAt == 0 { if a.RolesGrantPermission(teamMember.GetRoles(), permission.Id) { return true @@ -206,8 +206,8 @@ func (a *App) HasPermissionToChannelByPost(askingUserId string, postId string, p return a.HasPermissionTo(askingUserId, permission) } -func (a *App) HasPermissionToUser(askingUserId string, userId string) bool { - if askingUserId == userId { +func (a *App) HasPermissionToUser(askingUserId string, userID string) bool { + if askingUserId == userID { return true } diff --git a/app/auto_responder.go b/app/auto_responder.go index 273b53e7bf..a10fcdb3d0 100644 --- a/app/auto_responder.go +++ b/app/auto_responder.go @@ -76,8 +76,8 @@ func (a *App) SetAutoResponderStatus(user *model.User, oldNotifyProps model.Stri } } -func (a *App) DisableAutoResponder(userId string, asAdmin bool) *model.AppError { - user, err := a.GetUser(userId) +func (a *App) DisableAutoResponder(userID string, asAdmin bool) *model.AppError { + user, err := a.GetUser(userID) if err != nil { return err } @@ -89,7 +89,7 @@ func (a *App) DisableAutoResponder(userId string, asAdmin bool) *model.AppError patch.NotifyProps = user.NotifyProps patch.NotifyProps[model.AUTO_RESPONDER_ACTIVE_NOTIFY_PROP] = "false" - _, err := a.PatchUser(userId, patch, asAdmin) + _, err := a.PatchUser(userID, patch, asAdmin) if err != nil { return err } diff --git a/app/bot.go b/app/bot.go index 6591c73533..7225c9b7c7 100644 --- a/app/bot.go +++ b/app/bot.go @@ -335,11 +335,11 @@ func (a *App) UpdateBotOwner(botUserId, newOwnerId string) (*model.Bot, *model.A } // disableUserBots disables all bots owned by the given user. -func (a *App) disableUserBots(userId string) *model.AppError { +func (a *App) disableUserBots(userID string) *model.AppError { perPage := 20 for { options := &model.BotGetOptions{ - OwnerId: userId, + OwnerId: userID, IncludeDeleted: false, OnlyOrphaned: false, Page: 0, @@ -368,10 +368,10 @@ func (a *App) disableUserBots(userId string) *model.AppError { return nil } -func (a *App) notifySysadminsBotOwnerDeactivated(userId string) *model.AppError { +func (a *App) notifySysadminsBotOwnerDeactivated(userID string) *model.AppError { perPage := 25 botOptions := &model.BotGetOptions{ - OwnerId: userId, + OwnerId: userID, IncludeDeleted: false, OnlyOrphaned: false, Page: 0, @@ -423,7 +423,7 @@ func (a *App) notifySysadminsBotOwnerDeactivated(userId string) *model.AppError } // user being disabled - user, err := a.GetUser(userId) + user, err := a.GetUser(userID) if err != nil { return err } diff --git a/app/channel.go b/app/channel.go index 9dac823779..109e9a800d 100644 --- a/app/channel.go +++ b/app/channel.go @@ -63,7 +63,7 @@ func (a *App) DefaultChannelNames() []string { return names } -func (a *App) JoinDefaultChannels(teamId string, user *model.User, shouldBeAdmin bool, userRequestorId string) *model.AppError { +func (a *App) JoinDefaultChannels(teamID string, user *model.User, shouldBeAdmin bool, userRequestorId string) *model.AppError { var requestor *model.User var nErr error if userRequestorId != "" { @@ -81,7 +81,7 @@ func (a *App) JoinDefaultChannels(teamId string, user *model.User, shouldBeAdmin var err *model.AppError for _, channelName := range a.DefaultChannelNames() { - channel, channelErr := a.Srv().Store.Channel().GetByName(teamId, channelName, true) + channel, channelErr := a.Srv().Store.Channel().GetByName(teamID, channelName, true) if channelErr != nil { var nfErr *store.ErrNotFound switch { @@ -170,7 +170,7 @@ func (a *App) postJoinMessageForDefaultChannel(user *model.User, requestor *mode return nil } -func (a *App) CreateChannelWithUser(channel *model.Channel, userId string) (*model.Channel, *model.AppError) { +func (a *App) CreateChannelWithUser(channel *model.Channel, userID string) (*model.Channel, *model.AppError) { if channel.IsGroupOrDirect() { return nil, model.NewAppError("CreateChannelWithUser", "api.channel.create_channel.direct_channel.app_error", nil, "", http.StatusBadRequest) } @@ -189,7 +189,7 @@ func (a *App) CreateChannelWithUser(channel *model.Channel, userId string) (*mod return nil, model.NewAppError("CreateChannelWithUser", "api.channel.create_channel.max_channel_limit.app_error", map[string]interface{}{"MaxChannelsPerTeam": *a.Config().TeamSettings.MaxChannelsPerTeam}, "", http.StatusBadRequest) } - channel.CreatorId = userId + channel.CreatorId = userID rchannel, err := a.CreateChannel(channel, true) if err != nil { @@ -197,13 +197,13 @@ func (a *App) CreateChannelWithUser(channel *model.Channel, userId string) (*mod } var user *model.User - if user, err = a.GetUser(userId); err != nil { + if user, err = a.GetUser(userID); err != nil { return nil, err } a.postJoinChannelMessage(user, channel) - message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_CHANNEL_CREATED, "", "", userId, nil) + message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_CHANNEL_CREATED, "", "", userID, nil) message.Add("channel_id", channel.Id) message.Add("team_id", channel.TeamId) a.Publish(message) @@ -320,13 +320,13 @@ func (a *App) CreateChannel(channel *model.Channel, addMember bool) (*model.Chan return sc, nil } -func (a *App) GetOrCreateDirectChannel(userId, otherUserId string) (*model.Channel, *model.AppError) { - channel, nErr := a.Srv().Store.Channel().GetByName("", model.GetDMNameFromIds(userId, otherUserId), true) +func (a *App) GetOrCreateDirectChannel(userID, otherUserId string) (*model.Channel, *model.AppError) { + channel, nErr := a.Srv().Store.Channel().GetByName("", model.GetDMNameFromIds(userID, otherUserId), true) if nErr != nil { var nfErr *store.ErrNotFound if errors.As(nErr, &nfErr) { var err *model.AppError - channel, err = a.createDirectChannel(userId, otherUserId) + channel, err = a.createDirectChannel(userID, otherUserId) if err != nil { if err.Id == store.ChannelExistsError { return channel, nil @@ -334,9 +334,9 @@ func (a *App) GetOrCreateDirectChannel(userId, otherUserId string) (*model.Chann return nil, err } - a.WaitForChannelMembership(channel.Id, userId) + a.WaitForChannelMembership(channel.Id, userID) - a.InvalidateCacheForUser(userId) + a.InvalidateCacheForUser(userID) a.InvalidateCacheForUser(otherUserId) if pluginsEnvironment := a.GetPluginsEnvironment(); pluginsEnvironment != nil { @@ -360,11 +360,11 @@ func (a *App) GetOrCreateDirectChannel(userId, otherUserId string) (*model.Chann return channel, nil } -func (a *App) createDirectChannel(userId string, otherUserId string) (*model.Channel, *model.AppError) { +func (a *App) createDirectChannel(userID string, otherUserId string) (*model.Channel, *model.AppError) { uc1 := make(chan store.StoreResult, 1) uc2 := make(chan store.StoreResult, 1) go func() { - user, err := a.Srv().Store.User().Get(userId) + user, err := a.Srv().Store.User().Get(userID) uc1 <- store.StoreResult{Data: user, NErr: err} close(uc1) }() @@ -376,7 +376,7 @@ func (a *App) createDirectChannel(userId string, otherUserId string) (*model.Cha result := <-uc1 if result.NErr != nil { - return nil, model.NewAppError("CreateDirectChannel", "api.channel.create_direct_channel.invalid_user.app_error", nil, userId, http.StatusBadRequest) + return nil, model.NewAppError("CreateDirectChannel", "api.channel.create_direct_channel.invalid_user.app_error", nil, userID, http.StatusBadRequest) } user := result.Data.(*model.User) @@ -418,10 +418,10 @@ func (a *App) createDirectChannel(userId string, otherUserId string) (*model.Cha } } - if err := a.Srv().Store.ChannelMemberHistory().LogJoinEvent(userId, channel.Id, model.GetMillis()); err != nil { + if err := a.Srv().Store.ChannelMemberHistory().LogJoinEvent(userID, channel.Id, model.GetMillis()); err != nil { return nil, model.NewAppError("CreateDirectChannel", "app.channel_member_history.log_join_event.internal_error", nil, err.Error(), http.StatusInternalServerError) } - if userId != otherUserId { + if userID != otherUserId { if err := a.Srv().Store.ChannelMemberHistory().LogJoinEvent(otherUserId, channel.Id, model.GetMillis()); err != nil { return nil, model.NewAppError("CreateDirectChannel", "app.channel_member_history.log_join_event.internal_error", nil, err.Error(), http.StatusInternalServerError) } @@ -430,7 +430,7 @@ func (a *App) createDirectChannel(userId string, otherUserId string) (*model.Cha return channel, nil } -func (a *App) WaitForChannelMembership(channelId string, userId string) { +func (a *App) WaitForChannelMembership(channelId string, userID string) { if len(a.Config().SqlSettings.DataSourceReplicas) == 0 { return } @@ -441,7 +441,7 @@ func (a *App) WaitForChannelMembership(channelId string, userId string) { time.Sleep(100 * time.Millisecond) - _, err := a.Srv().Store.Channel().GetMember(channelId, userId) + _, err := a.Srv().Store.Channel().GetMember(channelId, userID) // If the membership was found then return if err == nil { @@ -455,11 +455,11 @@ func (a *App) WaitForChannelMembership(channelId string, userId string) { } } - mlog.Error("WaitForChannelMembership giving up", mlog.String("channel_id", channelId), mlog.String("user_id", userId)) + mlog.Error("WaitForChannelMembership giving up", mlog.String("channel_id", channelId), mlog.String("user_id", userID)) } -func (a *App) CreateGroupChannel(userIds []string, creatorId string) (*model.Channel, *model.AppError) { - channel, err := a.createGroupChannel(userIds) +func (a *App) CreateGroupChannel(userIDs []string, creatorId string) (*model.Channel, *model.AppError) { + channel, err := a.createGroupChannel(userIDs) if err != nil { if err.Id == store.ChannelExistsError { return channel, nil @@ -467,37 +467,37 @@ func (a *App) CreateGroupChannel(userIds []string, creatorId string) (*model.Cha return nil, err } - for _, userId := range userIds { - if userId == creatorId { + for _, userID := range userIDs { + if userID == creatorId { a.WaitForChannelMembership(channel.Id, creatorId) } - a.InvalidateCacheForUser(userId) + a.InvalidateCacheForUser(userID) } message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_GROUP_ADDED, "", channel.Id, "", nil) - message.Add("teammate_ids", model.ArrayToJson(userIds)) + message.Add("teammate_ids", model.ArrayToJson(userIDs)) a.Publish(message) return channel, nil } -func (a *App) createGroupChannel(userIds []string) (*model.Channel, *model.AppError) { - if len(userIds) > model.CHANNEL_GROUP_MAX_USERS || len(userIds) < model.CHANNEL_GROUP_MIN_USERS { +func (a *App) createGroupChannel(userIDs []string) (*model.Channel, *model.AppError) { + if len(userIDs) > model.CHANNEL_GROUP_MAX_USERS || len(userIDs) < model.CHANNEL_GROUP_MIN_USERS { return nil, model.NewAppError("CreateGroupChannel", "api.channel.create_group.bad_size.app_error", nil, "", http.StatusBadRequest) } - users, err := a.Srv().Store.User().GetProfileByIds(userIds, nil, true) + users, err := a.Srv().Store.User().GetProfileByIds(userIDs, nil, true) if err != nil { return nil, model.NewAppError("createGroupChannel", "app.user.get_profiles.app_error", nil, err.Error(), http.StatusInternalServerError) } - if len(users) != len(userIds) { - return nil, model.NewAppError("CreateGroupChannel", "api.channel.create_group.bad_user.app_error", nil, "user_ids="+model.ArrayToJson(userIds), http.StatusBadRequest) + if len(users) != len(userIDs) { + return nil, model.NewAppError("CreateGroupChannel", "api.channel.create_group.bad_user.app_error", nil, "user_ids="+model.ArrayToJson(userIDs), http.StatusBadRequest) } group := &model.Channel{ - Name: model.GetGroupNameFromUserIds(userIds), + Name: model.GetGroupNameFromUserIds(userIDs), DisplayName: model.GetGroupDisplayNameFromUsers(users, true), Type: model.CHANNEL_GROUP, } @@ -561,21 +561,21 @@ func (a *App) createGroupChannel(userIds []string) (*model.Channel, *model.AppEr return channel, nil } -func (a *App) GetGroupChannel(userIds []string) (*model.Channel, *model.AppError) { - if len(userIds) > model.CHANNEL_GROUP_MAX_USERS || len(userIds) < model.CHANNEL_GROUP_MIN_USERS { +func (a *App) GetGroupChannel(userIDs []string) (*model.Channel, *model.AppError) { + if len(userIDs) > model.CHANNEL_GROUP_MAX_USERS || len(userIDs) < model.CHANNEL_GROUP_MIN_USERS { return nil, model.NewAppError("GetGroupChannel", "api.channel.create_group.bad_size.app_error", nil, "", http.StatusBadRequest) } - users, err := a.Srv().Store.User().GetProfileByIds(userIds, nil, true) + users, err := a.Srv().Store.User().GetProfileByIds(userIDs, nil, true) if err != nil { return nil, model.NewAppError("GetGroupChannel", "app.user.get_profiles.app_error", nil, err.Error(), http.StatusInternalServerError) } - if len(users) != len(userIds) { - return nil, model.NewAppError("GetGroupChannel", "api.channel.create_group.bad_user.app_error", nil, "user_ids="+model.ArrayToJson(userIds), http.StatusBadRequest) + if len(users) != len(userIDs) { + return nil, model.NewAppError("GetGroupChannel", "api.channel.create_group.bad_user.app_error", nil, "user_ids="+model.ArrayToJson(userIDs), http.StatusBadRequest) } - channel, appErr := a.GetChannelByName(model.GetGroupNameFromUserIds(userIds), "", true) + channel, appErr := a.GetChannelByName(model.GetGroupNameFromUserIds(userIDs), "", true) if appErr != nil { return nil, appErr } @@ -697,7 +697,7 @@ func (a *App) postChannelPrivacyMessage(user *model.User, channel *model.Channel return nil } -func (a *App) RestoreChannel(channel *model.Channel, userId string) (*model.Channel, *model.AppError) { +func (a *App) RestoreChannel(channel *model.Channel, userID string) (*model.Channel, *model.AppError) { if channel.DeleteAt == 0 { return nil, model.NewAppError("restoreChannel", "api.channel.restore_channel.restored.app_error", nil, "", http.StatusBadRequest) } @@ -712,7 +712,7 @@ func (a *App) RestoreChannel(channel *model.Channel, userId string) (*model.Chan message.Add("channel_id", channel.Id) a.Publish(message) - user, nErr := a.Srv().Store.User().Get(userId) + user, nErr := a.Srv().Store.User().Get(userID) if nErr != nil { var nfErr *store.ErrNotFound switch { @@ -730,7 +730,7 @@ func (a *App) RestoreChannel(channel *model.Channel, userId string) (*model.Chan ChannelId: channel.Id, Message: T("api.channel.restore_channel.unarchived", map[string]interface{}{"Username": user.Username}), Type: model.POST_CHANNEL_RESTORED, - UserId: userId, + UserId: userID, Props: model.StringInterface{ "username": user.Username, }, @@ -744,7 +744,7 @@ func (a *App) RestoreChannel(channel *model.Channel, userId string) (*model.Chan return channel, nil } -func (a *App) PatchChannel(channel *model.Channel, patch *model.ChannelPatch, userId string) (*model.Channel, *model.AppError) { +func (a *App) PatchChannel(channel *model.Channel, patch *model.ChannelPatch, userID string) (*model.Channel, *model.AppError) { oldChannelDisplayName := channel.DisplayName oldChannelHeader := channel.Header oldChannelPurpose := channel.Purpose @@ -756,19 +756,19 @@ func (a *App) PatchChannel(channel *model.Channel, patch *model.ChannelPatch, us } if oldChannelDisplayName != channel.DisplayName { - if err = a.PostUpdateChannelDisplayNameMessage(userId, channel, oldChannelDisplayName, channel.DisplayName); err != nil { + if err = a.PostUpdateChannelDisplayNameMessage(userID, channel, oldChannelDisplayName, channel.DisplayName); err != nil { mlog.Warn(err.Error()) } } if channel.Header != oldChannelHeader { - if err = a.PostUpdateChannelHeaderMessage(userId, channel, oldChannelHeader, channel.Header); err != nil { + if err = a.PostUpdateChannelHeaderMessage(userID, channel, oldChannelHeader, channel.Header); err != nil { mlog.Warn(err.Error()) } } if channel.Purpose != oldChannelPurpose { - if err = a.PostUpdateChannelPurposeMessage(userId, channel, oldChannelPurpose, channel.Purpose); err != nil { + if err = a.PostUpdateChannelPurposeMessage(userID, channel, oldChannelPurpose, channel.Purpose); err != nil { mlog.Warn(err.Error()) } } @@ -801,8 +801,8 @@ func (a *App) GetSchemeRolesForChannel(channelId string) (guestRoleName, userRol } // GetTeamSchemeChannelRoles Checks if a team has an override scheme and returns the scheme channel role names or default channel role names. -func (a *App) GetTeamSchemeChannelRoles(teamId string) (guestRoleName, userRoleName, adminRoleName string, err *model.AppError) { - team, err := a.GetTeam(teamId) +func (a *App) GetTeamSchemeChannelRoles(teamID string) (guestRoleName, userRoleName, adminRoleName string, err *model.AppError) { + team, err := a.GetTeam(teamID) if err != nil { return } @@ -1040,10 +1040,10 @@ func buildChannelModerations(channelType string, memberRole *model.Role, guestRo return channelModerations } -func (a *App) UpdateChannelMemberRoles(channelId string, userId string, newRoles string) (*model.ChannelMember, *model.AppError) { +func (a *App) UpdateChannelMemberRoles(channelId string, userID string, newRoles string) (*model.ChannelMember, *model.AppError) { var member *model.ChannelMember var err *model.AppError - if member, err = a.GetChannelMember(channelId, userId); err != nil { + if member, err = a.GetChannelMember(channelId, userID); err != nil { return nil, err } @@ -1099,8 +1099,8 @@ func (a *App) UpdateChannelMemberRoles(channelId string, userId string, newRoles return a.updateChannelMember(member) } -func (a *App) UpdateChannelMemberSchemeRoles(channelId string, userId string, isSchemeGuest bool, isSchemeUser bool, isSchemeAdmin bool) (*model.ChannelMember, *model.AppError) { - member, err := a.GetChannelMember(channelId, userId) +func (a *App) UpdateChannelMemberSchemeRoles(channelId string, userID string, isSchemeGuest bool, isSchemeUser bool, isSchemeAdmin bool) (*model.ChannelMember, *model.AppError) { + member, err := a.GetChannelMember(channelId, userID) if err != nil { return nil, err } @@ -1121,10 +1121,10 @@ func (a *App) UpdateChannelMemberSchemeRoles(channelId string, userId string, is return a.updateChannelMember(member) } -func (a *App) UpdateChannelMemberNotifyProps(data map[string]string, channelId string, userId string) (*model.ChannelMember, *model.AppError) { +func (a *App) UpdateChannelMemberNotifyProps(data map[string]string, channelId string, userID string) (*model.ChannelMember, *model.AppError) { var member *model.ChannelMember var err *model.AppError - if member, err = a.GetChannelMember(channelId, userId); err != nil { + if member, err = a.GetChannelMember(channelId, userID); err != nil { return nil, err } @@ -1184,7 +1184,7 @@ func (a *App) updateChannelMember(member *model.ChannelMember) (*model.ChannelMe return member, nil } -func (a *App) DeleteChannel(channel *model.Channel, userId string) *model.AppError { +func (a *App) DeleteChannel(channel *model.Channel, userID string) *model.AppError { ihc := make(chan store.StoreResult, 1) ohc := make(chan store.StoreResult, 1) @@ -1201,9 +1201,9 @@ func (a *App) DeleteChannel(channel *model.Channel, userId string) *model.AppErr }() var user *model.User - if userId != "" { + if userID != "" { var nErr error - user, nErr = a.Srv().Store.User().Get(userId) + user, nErr = a.Srv().Store.User().Get(userID) if nErr != nil { var nfErr *store.ErrNotFound switch { @@ -1245,7 +1245,7 @@ func (a *App) DeleteChannel(channel *model.Channel, userId string) *model.AppErr ChannelId: channel.Id, Message: fmt.Sprintf(T("api.channel.delete_channel.archived"), user.Username), Type: model.POST_CHANNEL_DELETED, - UserId: userId, + UserId: userID, Props: model.StringInterface{ "username": user.Username, }, @@ -1372,8 +1372,8 @@ func (a *App) AddUserToChannel(user *model.User, channel *model.Channel) (*model return newMember, nil } -func (a *App) AddChannelMember(userId string, channel *model.Channel, userRequestorId string, postRootId string) (*model.ChannelMember, *model.AppError) { - if member, err := a.Srv().Store.Channel().GetMember(channel.Id, userId); err != nil { +func (a *App) AddChannelMember(userID string, channel *model.Channel, userRequestorId string, postRootId string) (*model.ChannelMember, *model.AppError) { + if member, err := a.Srv().Store.Channel().GetMember(channel.Id, userID); err != nil { var nfErr *store.ErrNotFound if !errors.As(err, &nfErr) { return nil, model.NewAppError("AddChannelMember", "app.channel.get_member.app_error", nil, err.Error(), http.StatusInternalServerError) @@ -1385,7 +1385,7 @@ func (a *App) AddChannelMember(userId string, channel *model.Channel, userReques var user *model.User var err *model.AppError - if user, err = a.GetUser(userId); err != nil { + if user, err = a.GetUser(userID); err != nil { return nil, err } @@ -1411,7 +1411,7 @@ func (a *App) AddChannelMember(userId string, channel *model.Channel, userReques }) } - if userRequestorId == "" || userId == userRequestorId { + if userRequestorId == "" || userID == userRequestorId { a.postJoinChannelMessage(user, channel) } else { a.Srv().Go(func() { @@ -1422,12 +1422,12 @@ func (a *App) AddChannelMember(userId string, channel *model.Channel, userReques return cm, nil } -func (a *App) AddDirectChannels(teamId string, user *model.User) *model.AppError { +func (a *App) AddDirectChannels(teamID string, user *model.User) *model.AppError { var profiles []*model.User - options := &model.UserGetOptions{InTeamId: teamId, Page: 0, PerPage: 100} + options := &model.UserGetOptions{InTeamId: teamID, Page: 0, PerPage: 100} profiles, err := a.Srv().Store.User().GetProfiles(options) if err != nil { - return model.NewAppError("AddDirectChannels", "api.user.add_direct_channels_and_forget.failed.error", map[string]interface{}{"UserId": user.Id, "TeamId": teamId, "Error": err.Error()}, "", http.StatusInternalServerError) + return model.NewAppError("AddDirectChannels", "api.user.add_direct_channels_and_forget.failed.error", map[string]interface{}{"UserId": user.Id, "TeamId": teamID, "Error": err.Error()}, "", http.StatusInternalServerError) } var preferences model.Preferences @@ -1452,14 +1452,14 @@ func (a *App) AddDirectChannels(teamId string, user *model.User) *model.AppError } if err := a.Srv().Store.Preference().Save(&preferences); err != nil { - return model.NewAppError("AddDirectChannels", "api.user.add_direct_channels_and_forget.failed.error", map[string]interface{}{"UserId": user.Id, "TeamId": teamId, "Error": err.Error()}, "", http.StatusInternalServerError) + return model.NewAppError("AddDirectChannels", "api.user.add_direct_channels_and_forget.failed.error", map[string]interface{}{"UserId": user.Id, "TeamId": teamID, "Error": err.Error()}, "", http.StatusInternalServerError) } return nil } -func (a *App) PostUpdateChannelHeaderMessage(userId string, channel *model.Channel, oldChannelHeader, newChannelHeader string) *model.AppError { - user, err := a.Srv().Store.User().Get(userId) +func (a *App) PostUpdateChannelHeaderMessage(userID string, channel *model.Channel, oldChannelHeader, newChannelHeader string) *model.AppError { + user, err := a.Srv().Store.User().Get(userID) if err != nil { return model.NewAppError("PostUpdateChannelHeaderMessage", "api.channel.post_update_channel_header_message_and_forget.retrieve_user.error", nil, err.Error(), http.StatusBadRequest) } @@ -1477,7 +1477,7 @@ func (a *App) PostUpdateChannelHeaderMessage(userId string, channel *model.Chann ChannelId: channel.Id, Message: message, Type: model.POST_HEADER_CHANGE, - UserId: userId, + UserId: userID, Props: model.StringInterface{ "username": user.Username, "old_header": oldChannelHeader, @@ -1492,8 +1492,8 @@ func (a *App) PostUpdateChannelHeaderMessage(userId string, channel *model.Chann return nil } -func (a *App) PostUpdateChannelPurposeMessage(userId string, channel *model.Channel, oldChannelPurpose string, newChannelPurpose string) *model.AppError { - user, err := a.Srv().Store.User().Get(userId) +func (a *App) PostUpdateChannelPurposeMessage(userID string, channel *model.Channel, oldChannelPurpose string, newChannelPurpose string) *model.AppError { + user, err := a.Srv().Store.User().Get(userID) if err != nil { return model.NewAppError("PostUpdateChannelPurposeMessage", "app.channel.post_update_channel_purpose_message.retrieve_user.error", nil, err.Error(), http.StatusBadRequest) } @@ -1511,7 +1511,7 @@ func (a *App) PostUpdateChannelPurposeMessage(userId string, channel *model.Chan ChannelId: channel.Id, Message: message, Type: model.POST_PURPOSE_CHANGE, - UserId: userId, + UserId: userID, Props: model.StringInterface{ "username": user.Username, "old_purpose": oldChannelPurpose, @@ -1525,8 +1525,8 @@ func (a *App) PostUpdateChannelPurposeMessage(userId string, channel *model.Chan return nil } -func (a *App) PostUpdateChannelDisplayNameMessage(userId string, channel *model.Channel, oldChannelDisplayName, newChannelDisplayName string) *model.AppError { - user, err := a.Srv().Store.User().Get(userId) +func (a *App) PostUpdateChannelDisplayNameMessage(userID string, channel *model.Channel, oldChannelDisplayName, newChannelDisplayName string) *model.AppError { + user, err := a.Srv().Store.User().Get(userID) if err != nil { return model.NewAppError("PostUpdateChannelDisplayNameMessage", "api.channel.post_update_channel_displayname_message_and_forget.retrieve_user.error", nil, err.Error(), http.StatusBadRequest) } @@ -1537,7 +1537,7 @@ func (a *App) PostUpdateChannelDisplayNameMessage(userId string, channel *model. ChannelId: channel.Id, Message: message, Type: model.POST_DISPLAYNAME_CHANGE, - UserId: userId, + UserId: userID, Props: model.StringInterface{ "username": user.Username, "old_displayname": oldChannelDisplayName, @@ -1566,14 +1566,14 @@ func (a *App) GetChannel(channelId string) (*model.Channel, *model.AppError) { return channel, nil } -func (a *App) GetChannelByName(channelName, teamId string, includeDeleted bool) (*model.Channel, *model.AppError) { +func (a *App) GetChannelByName(channelName, teamID string, includeDeleted bool) (*model.Channel, *model.AppError) { var channel *model.Channel var err error if includeDeleted { - channel, err = a.Srv().Store.Channel().GetByNameIncludeDeleted(teamId, channelName, false) + channel, err = a.Srv().Store.Channel().GetByNameIncludeDeleted(teamID, channelName, false) } else { - channel, err = a.Srv().Store.Channel().GetByName(teamId, channelName, false) + channel, err = a.Srv().Store.Channel().GetByName(teamID, channelName, false) } if err != nil { @@ -1589,8 +1589,8 @@ func (a *App) GetChannelByName(channelName, teamId string, includeDeleted bool) return channel, nil } -func (a *App) GetChannelsByNames(channelNames []string, teamId string) ([]*model.Channel, *model.AppError) { - channels, err := a.Srv().Store.Channel().GetByNames(teamId, channelNames, true) +func (a *App) GetChannelsByNames(channelNames []string, teamID string) ([]*model.Channel, *model.AppError) { + channels, err := a.Srv().Store.Channel().GetByNames(teamID, channelNames, true) if err != nil { return nil, model.NewAppError("GetChannelsByNames", "app.channel.get_by_name.existing.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -1633,8 +1633,8 @@ func (a *App) GetChannelByNameForTeamName(channelName, teamName string, includeD return result, nil } -func (a *App) GetChannelsForUser(teamId string, userId string, includeDeleted bool, lastDeleteAt int) (*model.ChannelList, *model.AppError) { - list, err := a.Srv().Store.Channel().GetChannels(teamId, userId, includeDeleted, lastDeleteAt) +func (a *App) GetChannelsForUser(teamID string, userID string, includeDeleted bool, lastDeleteAt int) (*model.ChannelList, *model.AppError) { + list, err := a.Srv().Store.Channel().GetChannels(teamID, userID, includeDeleted, lastDeleteAt) if err != nil { var nfErr *store.ErrNotFound switch { @@ -1682,8 +1682,8 @@ func (a *App) GetAllChannelsCount(opts model.ChannelSearchOpts) (int64, *model.A return count, nil } -func (a *App) GetDeletedChannels(teamId string, offset int, limit int, userId string) (*model.ChannelList, *model.AppError) { - list, err := a.Srv().Store.Channel().GetDeleted(teamId, offset, limit, userId) +func (a *App) GetDeletedChannels(teamID string, offset int, limit int, userID string) (*model.ChannelList, *model.AppError) { + list, err := a.Srv().Store.Channel().GetDeleted(teamID, offset, limit, userID) if err != nil { var nfErr *store.ErrNotFound switch { @@ -1697,16 +1697,16 @@ func (a *App) GetDeletedChannels(teamId string, offset int, limit int, userId st return list, nil } -func (a *App) GetChannelsUserNotIn(teamId string, userId string, offset int, limit int) (*model.ChannelList, *model.AppError) { - channels, err := a.Srv().Store.Channel().GetMoreChannels(teamId, userId, offset, limit) +func (a *App) GetChannelsUserNotIn(teamID string, userID string, offset int, limit int) (*model.ChannelList, *model.AppError) { + channels, err := a.Srv().Store.Channel().GetMoreChannels(teamID, userID, offset, limit) if err != nil { return nil, model.NewAppError("GetChannelsUserNotIn", "app.channel.get_more_channels.get.app_error", nil, err.Error(), http.StatusInternalServerError) } return channels, nil } -func (a *App) GetPublicChannelsByIdsForTeam(teamId string, channelIds []string) (*model.ChannelList, *model.AppError) { - list, err := a.Srv().Store.Channel().GetPublicChannelsByIdsForTeam(teamId, channelIds) +func (a *App) GetPublicChannelsByIdsForTeam(teamID string, channelIds []string) (*model.ChannelList, *model.AppError) { + list, err := a.Srv().Store.Channel().GetPublicChannelsByIdsForTeam(teamID, channelIds) if err != nil { var nfErr *store.ErrNotFound switch { @@ -1720,8 +1720,8 @@ func (a *App) GetPublicChannelsByIdsForTeam(teamId string, channelIds []string) return list, nil } -func (a *App) GetPublicChannelsForTeam(teamId string, offset int, limit int) (*model.ChannelList, *model.AppError) { - list, err := a.Srv().Store.Channel().GetPublicChannelsForTeam(teamId, offset, limit) +func (a *App) GetPublicChannelsForTeam(teamID string, offset int, limit int) (*model.ChannelList, *model.AppError) { + list, err := a.Srv().Store.Channel().GetPublicChannelsForTeam(teamID, offset, limit) if err != nil { return nil, model.NewAppError("GetPublicChannelsForTeam", "app.channel.get_public_channels.get.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -1729,8 +1729,8 @@ func (a *App) GetPublicChannelsForTeam(teamId string, offset int, limit int) (*m return list, nil } -func (a *App) GetPrivateChannelsForTeam(teamId string, offset int, limit int) (*model.ChannelList, *model.AppError) { - list, err := a.Srv().Store.Channel().GetPrivateChannelsForTeam(teamId, offset, limit) +func (a *App) GetPrivateChannelsForTeam(teamID string, offset int, limit int) (*model.ChannelList, *model.AppError) { + list, err := a.Srv().Store.Channel().GetPrivateChannelsForTeam(teamID, offset, limit) if err != nil { return nil, model.NewAppError("GetPrivateChannelsForTeam", "app.channel.get_private_channels.get.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -1738,8 +1738,8 @@ func (a *App) GetPrivateChannelsForTeam(teamId string, offset int, limit int) (* return list, nil } -func (a *App) GetChannelMember(channelId string, userId string) (*model.ChannelMember, *model.AppError) { - channelMember, err := a.Srv().Store.Channel().GetMember(channelId, userId) +func (a *App) GetChannelMember(channelId string, userID string) (*model.ChannelMember, *model.AppError) { + channelMember, err := a.Srv().Store.Channel().GetMember(channelId, userID) if err != nil { var nfErr *store.ErrNotFound switch { @@ -1779,8 +1779,8 @@ func (a *App) GetChannelMembersTimezones(channelId string) ([]string, *model.App return model.RemoveDuplicateStrings(timezones), nil } -func (a *App) GetChannelMembersByIds(channelId string, userIds []string) (*model.ChannelMembers, *model.AppError) { - members, err := a.Srv().Store.Channel().GetMembersByIds(channelId, userIds) +func (a *App) GetChannelMembersByIds(channelId string, userIDs []string) (*model.ChannelMembers, *model.AppError) { + members, err := a.Srv().Store.Channel().GetMembersByIds(channelId, userIDs) if err != nil { return nil, model.NewAppError("GetChannelMembersByIds", "app.channel.get_members_by_ids.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -1788,8 +1788,8 @@ func (a *App) GetChannelMembersByIds(channelId string, userIds []string) (*model return members, nil } -func (a *App) GetChannelMembersForUser(teamId string, userId string) (*model.ChannelMembers, *model.AppError) { - channelMembers, err := a.Srv().Store.Channel().GetMembersForUser(teamId, userId) +func (a *App) GetChannelMembersForUser(teamID string, userID string) (*model.ChannelMembers, *model.AppError) { + channelMembers, err := a.Srv().Store.Channel().GetMembersForUser(teamID, userID) if err != nil { return nil, model.NewAppError("GetChannelMembersForUser", "app.channel.get_members.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -1797,8 +1797,8 @@ func (a *App) GetChannelMembersForUser(teamId string, userId string) (*model.Cha return channelMembers, nil } -func (a *App) GetChannelMembersForUserWithPagination(teamId, userId string, page, perPage int) ([]*model.ChannelMember, *model.AppError) { - m, err := a.Srv().Store.Channel().GetMembersForUserWithPagination(teamId, userId, page, perPage) +func (a *App) GetChannelMembersForUserWithPagination(teamID, userID string, page, perPage int) ([]*model.ChannelMember, *model.AppError) { + m, err := a.Srv().Store.Channel().GetMembersForUserWithPagination(teamID, userID, page, perPage) if err != nil { return nil, model.NewAppError("GetChannelMembersForUserWithPagination", "app.channel.get_members.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -1840,8 +1840,8 @@ func (a *App) GetChannelPinnedPostCount(channelId string) (int64, *model.AppErro return count, nil } -func (a *App) GetChannelCounts(teamId string, userId string) (*model.ChannelCounts, *model.AppError) { - counts, err := a.Srv().Store.Channel().GetChannelCounts(teamId, userId) +func (a *App) GetChannelCounts(teamID string, userID string) (*model.ChannelCounts, *model.AppError) { + counts, err := a.Srv().Store.Channel().GetChannelCounts(teamID, userID) if err != nil { return nil, model.NewAppError("SqlChannelStore.GetChannelCounts", "app.channel.get_channel_counts.get.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -1849,8 +1849,8 @@ func (a *App) GetChannelCounts(teamId string, userId string) (*model.ChannelCoun return counts, nil } -func (a *App) GetChannelUnread(channelId, userId string) (*model.ChannelUnread, *model.AppError) { - channelUnread, err := a.Srv().Store.Channel().GetChannelUnread(channelId, userId) +func (a *App) GetChannelUnread(channelId, userID string) (*model.ChannelUnread, *model.AppError) { + channelUnread, err := a.Srv().Store.Channel().GetChannelUnread(channelId, userID) if err != nil { var nfErr *store.ErrNotFound switch { @@ -1868,16 +1868,16 @@ func (a *App) GetChannelUnread(channelId, userId string) (*model.ChannelUnread, return channelUnread, nil } -func (a *App) JoinChannel(channel *model.Channel, userId string) *model.AppError { +func (a *App) JoinChannel(channel *model.Channel, userID string) *model.AppError { userChan := make(chan store.StoreResult, 1) memberChan := make(chan store.StoreResult, 1) go func() { - user, err := a.Srv().Store.User().Get(userId) + user, err := a.Srv().Store.User().Get(userID) userChan <- store.StoreResult{Data: user, NErr: err} close(userChan) }() go func() { - member, err := a.Srv().Store.Channel().GetMember(channel.Id, userId) + member, err := a.Srv().Store.Channel().GetMember(channel.Id, userID) memberChan <- store.StoreResult{Data: member, NErr: err} close(memberChan) }() @@ -1971,7 +1971,7 @@ func (a *App) postJoinTeamMessage(user *model.User, channel *model.Channel) *mod return nil } -func (a *App) LeaveChannel(channelId string, userId string) *model.AppError { +func (a *App) LeaveChannel(channelId string, userID string) *model.AppError { sc := make(chan store.StoreResult, 1) go func() { channel, err := a.Srv().Store.Channel().Get(channelId, true) @@ -1981,7 +1981,7 @@ func (a *App) LeaveChannel(channelId string, userId string) *model.AppError { uc := make(chan store.StoreResult, 1) go func() { - user, err := a.Srv().Store.User().Get(userId) + user, err := a.Srv().Store.User().Get(userID) uc <- store.StoreResult{Data: user, NErr: err} close(uc) }() @@ -2032,7 +2032,7 @@ func (a *App) LeaveChannel(channelId string, userId string) *model.AppError { return err } - if err := a.removeUserFromChannel(userId, userId, channel); err != nil { + if err := a.removeUserFromChannel(userID, userID, channel); err != nil { return err } @@ -2142,8 +2142,8 @@ func (a *App) postRemoveFromChannelMessage(removerUserId string, removedUser *mo return nil } -func (a *App) removeUserFromChannel(userIdToRemove string, removerUserId string, channel *model.Channel) *model.AppError { - user, nErr := a.Srv().Store.User().Get(userIdToRemove) +func (a *App) removeUserFromChannel(userIDToRemove string, removerUserId string, channel *model.Channel) *model.AppError { + user, nErr := a.Srv().Store.User().Get(userIDToRemove) if nErr != nil { var nfErr *store.ErrNotFound switch { @@ -2161,8 +2161,8 @@ func (a *App) removeUserFromChannel(userIdToRemove string, removerUserId string, } } - if channel.IsGroupConstrained() && userIdToRemove != removerUserId && !user.IsBot { - nonMembers, err := a.FilterNonGroupChannelMembers([]string{userIdToRemove}, channel) + if channel.IsGroupConstrained() && userIDToRemove != removerUserId && !user.IsBot { + nonMembers, err := a.FilterNonGroupChannelMembers([]string{userIDToRemove}, channel) if err != nil { return model.NewAppError("removeUserFromChannel", "api.channel.remove_user_from_channel.app_error", nil, "", http.StatusInternalServerError) } @@ -2171,25 +2171,25 @@ func (a *App) removeUserFromChannel(userIdToRemove string, removerUserId string, } } - cm, err := a.GetChannelMember(channel.Id, userIdToRemove) + cm, err := a.GetChannelMember(channel.Id, userIDToRemove) if err != nil { return err } - if err := a.Srv().Store.Channel().RemoveMember(channel.Id, userIdToRemove); err != nil { + if err := a.Srv().Store.Channel().RemoveMember(channel.Id, userIDToRemove); err != nil { return model.NewAppError("removeUserFromChannel", "app.channel.remove_member.app_error", nil, err.Error(), http.StatusInternalServerError) } - if err := a.Srv().Store.ChannelMemberHistory().LogLeaveEvent(userIdToRemove, channel.Id, model.GetMillis()); err != nil { + if err := a.Srv().Store.ChannelMemberHistory().LogLeaveEvent(userIDToRemove, channel.Id, model.GetMillis()); err != nil { return model.NewAppError("removeUserFromChannel", "app.channel_member_history.log_leave_event.internal_error", nil, err.Error(), http.StatusInternalServerError) } if isGuest { - currentMembers, err := a.GetChannelMembersForUser(channel.TeamId, userIdToRemove) + currentMembers, err := a.GetChannelMembersForUser(channel.TeamId, userIDToRemove) if err != nil { return err } if len(*currentMembers) == 0 { - teamMember, err := a.GetTeamMember(channel.TeamId, userIdToRemove) + teamMember, err := a.GetTeamMember(channel.TeamId, userIDToRemove) if err != nil { return model.NewAppError("removeUserFromChannel", "api.team.remove_user_from_team.missing.app_error", nil, err.Error(), http.StatusBadRequest) } @@ -2200,7 +2200,7 @@ func (a *App) removeUserFromChannel(userIdToRemove string, removerUserId string, } } - a.InvalidateCacheForUser(userIdToRemove) + a.InvalidateCacheForUser(userIDToRemove) a.invalidateCacheForChannelMembers(channel.Id) if pluginsEnvironment := a.GetPluginsEnvironment(); pluginsEnvironment != nil { @@ -2219,12 +2219,12 @@ func (a *App) removeUserFromChannel(userIdToRemove string, removerUserId string, } message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_USER_REMOVED, "", channel.Id, "", nil) - message.Add("user_id", userIdToRemove) + message.Add("user_id", userIDToRemove) message.Add("remover_id", removerUserId) a.Publish(message) // because the removed user no longer belongs to the channel we need to send a separate websocket event - userMsg := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_USER_REMOVED, "", "", userIdToRemove, nil) + userMsg := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_USER_REMOVED, "", "", userIDToRemove, nil) userMsg.Add("channel_id", channel.Id) userMsg.Add("remover_id", removerUserId) a.Publish(userMsg) @@ -2232,19 +2232,19 @@ func (a *App) removeUserFromChannel(userIdToRemove string, removerUserId string, return nil } -func (a *App) RemoveUserFromChannel(userIdToRemove string, removerUserId string, channel *model.Channel) *model.AppError { +func (a *App) RemoveUserFromChannel(userIDToRemove string, removerUserId string, channel *model.Channel) *model.AppError { var err *model.AppError - if err = a.removeUserFromChannel(userIdToRemove, removerUserId, channel); err != nil { + if err = a.removeUserFromChannel(userIDToRemove, removerUserId, channel); err != nil { return err } var user *model.User - if user, err = a.GetUser(userIdToRemove); err != nil { + if user, err = a.GetUser(userIDToRemove); err != nil { return err } - if userIdToRemove == removerUserId { + if userIDToRemove == removerUserId { a.postLeaveChannelMessage(user, channel) } else { a.Srv().Go(func() { @@ -2255,9 +2255,9 @@ func (a *App) RemoveUserFromChannel(userIdToRemove string, removerUserId string, return nil } -func (a *App) GetNumberOfChannelsOnTeam(teamId string) (int, *model.AppError) { +func (a *App) GetNumberOfChannelsOnTeam(teamID string) (int, *model.AppError) { // Get total number of channels on current team - list, err := a.Srv().Store.Channel().GetTeamChannels(teamId) + list, err := a.Srv().Store.Channel().GetTeamChannels(teamID) if err != nil { var nfErr *store.ErrNotFound switch { @@ -2270,13 +2270,13 @@ func (a *App) GetNumberOfChannelsOnTeam(teamId string) (int, *model.AppError) { return len(*list), nil } -func (a *App) SetActiveChannel(userId string, channelId string) *model.AppError { - status, err := a.GetStatus(userId) +func (a *App) SetActiveChannel(userID string, channelId string) *model.AppError { + status, err := a.GetStatus(userID) oldStatus := model.STATUS_OFFLINE if err != nil { - status = &model.Status{UserId: userId, Status: model.STATUS_ONLINE, Manual: false, LastActivityAt: model.GetMillis(), ActiveChannel: channelId} + status = &model.Status{UserId: userID, Status: model.STATUS_ONLINE, Manual: false, LastActivityAt: model.GetMillis(), ActiveChannel: channelId} } else { oldStatus = status.Status status.ActiveChannel = channelId @@ -2295,8 +2295,8 @@ func (a *App) SetActiveChannel(userId string, channelId string) *model.AppError return nil } -func (a *App) UpdateChannelLastViewedAt(channelIds []string, userId string) *model.AppError { - if _, err := a.Srv().Store.Channel().UpdateLastViewedAt(channelIds, userId, *a.Config().ServiceSettings.ThreadAutoFollow); err != nil { +func (a *App) UpdateChannelLastViewedAt(channelIds []string, userID string) *model.AppError { + if _, err := a.Srv().Store.Channel().UpdateLastViewedAt(channelIds, userID, *a.Config().ServiceSettings.ThreadAutoFollow); err != nil { var invErr *store.ErrInvalidInput switch { case errors.As(err, &invErr): @@ -2308,7 +2308,7 @@ func (a *App) UpdateChannelLastViewedAt(channelIds []string, userId string) *mod if *a.Config().ServiceSettings.EnableChannelViewedMessages { for _, channelId := range channelIds { - message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_CHANNEL_VIEWED, "", "", userId, nil) + message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_CHANNEL_VIEWED, "", "", userID, nil) message.Add("channel_id", channelId) a.Publish(message) } @@ -2369,11 +2369,11 @@ func (a *App) MarkChannelAsUnreadFromPost(postID string, userID string) (*model. return channelUnread, nil } -func (a *App) AutocompleteChannels(teamId string, term string) (*model.ChannelList, *model.AppError) { +func (a *App) AutocompleteChannels(teamID string, term string) (*model.ChannelList, *model.AppError) { includeDeleted := *a.Config().TeamSettings.ExperimentalViewArchivedChannels term = strings.TrimSpace(term) - channelList, err := a.Srv().Store.Channel().AutocompleteInTeam(teamId, term, includeDeleted) + channelList, err := a.Srv().Store.Channel().AutocompleteInTeam(teamID, term, includeDeleted) if err != nil { return nil, model.NewAppError("AutocompleteChannels", "app.channel.search.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -2381,12 +2381,12 @@ func (a *App) AutocompleteChannels(teamId string, term string) (*model.ChannelLi return channelList, nil } -func (a *App) AutocompleteChannelsForSearch(teamId string, userId string, term string) (*model.ChannelList, *model.AppError) { +func (a *App) AutocompleteChannelsForSearch(teamID string, userID string, term string) (*model.ChannelList, *model.AppError) { includeDeleted := *a.Config().TeamSettings.ExperimentalViewArchivedChannels term = strings.TrimSpace(term) - channelList, err := a.Srv().Store.Channel().AutocompleteInTeamForSearch(teamId, userId, term, includeDeleted) + channelList, err := a.Srv().Store.Channel().AutocompleteInTeamForSearch(teamID, userID, term, includeDeleted) if err != nil { return nil, model.NewAppError("AutocompleteChannelsForSearch", "app.channel.search.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -2423,12 +2423,12 @@ func (a *App) SearchAllChannels(term string, opts model.ChannelSearchOpts) (*mod return channelList, totalCount, nil } -func (a *App) SearchChannels(teamId string, term string) (*model.ChannelList, *model.AppError) { +func (a *App) SearchChannels(teamID string, term string) (*model.ChannelList, *model.AppError) { includeDeleted := *a.Config().TeamSettings.ExperimentalViewArchivedChannels term = strings.TrimSpace(term) - channelList, err := a.Srv().Store.Channel().SearchInTeam(teamId, term, includeDeleted) + channelList, err := a.Srv().Store.Channel().SearchInTeam(teamID, term, includeDeleted) if err != nil { return nil, model.NewAppError("SearchChannels", "app.channel.search.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -2436,10 +2436,10 @@ func (a *App) SearchChannels(teamId string, term string) (*model.ChannelList, *m return channelList, nil } -func (a *App) SearchArchivedChannels(teamId string, term string, userId string) (*model.ChannelList, *model.AppError) { +func (a *App) SearchArchivedChannels(teamID string, term string, userID string) (*model.ChannelList, *model.AppError) { term = strings.TrimSpace(term) - channelList, err := a.Srv().Store.Channel().SearchArchivedInTeam(teamId, term, userId) + channelList, err := a.Srv().Store.Channel().SearchArchivedInTeam(teamID, term, userID) if err != nil { return nil, model.NewAppError("SearchArchivedChannels", "app.channel.search.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -2447,12 +2447,12 @@ func (a *App) SearchArchivedChannels(teamId string, term string, userId string) return channelList, nil } -func (a *App) SearchChannelsForUser(userId, teamId, term string) (*model.ChannelList, *model.AppError) { +func (a *App) SearchChannelsForUser(userID, teamID, term string) (*model.ChannelList, *model.AppError) { includeDeleted := *a.Config().TeamSettings.ExperimentalViewArchivedChannels term = strings.TrimSpace(term) - channelList, err := a.Srv().Store.Channel().SearchForUserInTeam(userId, teamId, term, includeDeleted) + channelList, err := a.Srv().Store.Channel().SearchForUserInTeam(userID, teamID, term, includeDeleted) if err != nil { return nil, model.NewAppError("SearchChannelsForUser", "app.channel.search.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -2460,21 +2460,21 @@ func (a *App) SearchChannelsForUser(userId, teamId, term string) (*model.Channel return channelList, nil } -func (a *App) SearchGroupChannels(userId, term string) (*model.ChannelList, *model.AppError) { +func (a *App) SearchGroupChannels(userID, term string) (*model.ChannelList, *model.AppError) { if term == "" { return &model.ChannelList{}, nil } - channelList, err := a.Srv().Store.Channel().SearchGroupChannels(userId, term) + channelList, err := a.Srv().Store.Channel().SearchGroupChannels(userID, term) if err != nil { return nil, model.NewAppError("SearchGroupChannels", "app.channel.search_group_channels.app_error", nil, err.Error(), http.StatusInternalServerError) } return channelList, nil } -func (a *App) SearchChannelsUserNotIn(teamId string, userId string, term string) (*model.ChannelList, *model.AppError) { +func (a *App) SearchChannelsUserNotIn(teamID string, userID string, term string) (*model.ChannelList, *model.AppError) { term = strings.TrimSpace(term) - channelList, err := a.Srv().Store.Channel().SearchMore(userId, teamId, term) + channelList, err := a.Srv().Store.Channel().SearchMore(userID, teamID, term) if err != nil { return nil, model.NewAppError("SearchChannelsUserNotIn", "app.channel.search.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -2482,7 +2482,7 @@ func (a *App) SearchChannelsUserNotIn(teamId string, userId string, term string) return channelList, nil } -func (a *App) MarkChannelsAsViewed(channelIds []string, userId string, currentSessionId string) (map[string]int64, *model.AppError) { +func (a *App) MarkChannelsAsViewed(channelIds []string, userID string, currentSessionId string) (map[string]int64, *model.AppError) { // I start looking for channels with notifications before I mark it as read, to clear the push notifications if needed channelsToClearPushNotifications := []string{} if *a.Config().EmailSettings.SendPushNotifications { @@ -2493,7 +2493,7 @@ func (a *App) MarkChannelsAsViewed(channelIds []string, userId string, currentSe continue } - member, err := a.Srv().Store.Channel().GetMember(channelId, userId) + member, err := a.Srv().Store.Channel().GetMember(channelId, userID) if err != nil { mlog.Warn("Failed to get membership", mlog.Err(err)) continue @@ -2501,21 +2501,21 @@ func (a *App) MarkChannelsAsViewed(channelIds []string, userId string, currentSe notify := member.NotifyProps[model.PUSH_NOTIFY_PROP] if notify == model.CHANNEL_NOTIFY_DEFAULT { - user, err := a.GetUser(userId) + user, err := a.GetUser(userID) if err != nil { - mlog.Warn("Failed to get user", mlog.String("user_id", userId), mlog.Err(err)) + mlog.Warn("Failed to get user", mlog.String("user_id", userID), mlog.Err(err)) continue } notify = user.NotifyProps[model.PUSH_NOTIFY_PROP] } if notify == model.USER_NOTIFY_ALL { - if count, err := a.Srv().Store.User().GetAnyUnreadPostCountForChannel(userId, channelId); err == nil { + if count, err := a.Srv().Store.User().GetAnyUnreadPostCountForChannel(userID, channelId); err == nil { if count > 0 { channelsToClearPushNotifications = append(channelsToClearPushNotifications, channelId) } } } else if notify == model.USER_NOTIFY_MENTION || channel.Type == model.CHANNEL_DIRECT { - if count, err := a.Srv().Store.User().GetUnreadCountForChannel(userId, channelId); err == nil { + if count, err := a.Srv().Store.User().GetUnreadCountForChannel(userID, channelId); err == nil { if count > 0 { channelsToClearPushNotifications = append(channelsToClearPushNotifications, channelId) } @@ -2523,7 +2523,7 @@ func (a *App) MarkChannelsAsViewed(channelIds []string, userId string, currentSe } } } - times, err := a.Srv().Store.Channel().UpdateLastViewedAt(channelIds, userId, *a.Config().ServiceSettings.ThreadAutoFollow) + times, err := a.Srv().Store.Channel().UpdateLastViewedAt(channelIds, userID, *a.Config().ServiceSettings.ThreadAutoFollow) if err != nil { var invErr *store.ErrInvalidInput switch { @@ -2536,19 +2536,19 @@ func (a *App) MarkChannelsAsViewed(channelIds []string, userId string, currentSe if *a.Config().ServiceSettings.EnableChannelViewedMessages { for _, channelId := range channelIds { - message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_CHANNEL_VIEWED, "", "", userId, nil) + message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_CHANNEL_VIEWED, "", "", userID, nil) message.Add("channel_id", channelId) a.Publish(message) } } for _, channelId := range channelsToClearPushNotifications { - a.clearPushNotification(currentSessionId, userId, channelId) + a.clearPushNotification(currentSessionId, userID, channelId) } return times, nil } -func (a *App) ViewChannel(view *model.ChannelView, userId string, currentSessionId string) (map[string]int64, *model.AppError) { - if err := a.SetActiveChannel(userId, view.ChannelId); err != nil { +func (a *App) ViewChannel(view *model.ChannelView, userID string, currentSessionId string) (map[string]int64, *model.AppError) { + if err := a.SetActiveChannel(userID, view.ChannelId); err != nil { return nil, err } @@ -2566,7 +2566,7 @@ func (a *App) ViewChannel(view *model.ChannelView, userId string, currentSession return map[string]int64{}, nil } - return a.MarkChannelsAsViewed(channelIds, userId, currentSessionId) + return a.MarkChannelsAsViewed(channelIds, userID, currentSessionId) } func (a *App) PermanentDeleteChannel(channel *model.Channel) *model.AppError { @@ -2760,8 +2760,8 @@ func (a *App) RemoveUsersFromChannelNotMemberOfTeam(remover *model.User, channel if remover != nil { removerId = remover.Id } - for userId := range channelMemberMap { - if err := a.removeUserFromChannel(userId, removerId, channel); err != nil { + for userID := range channelMemberMap { + if err := a.removeUserFromChannel(userID, removerId, channel); err != nil { return err } } @@ -2780,8 +2780,8 @@ func (a *App) GetPinnedPosts(channelId string) (*model.PostList, *model.AppError return posts, nil } -func (a *App) ToggleMuteChannel(channelId, userId string) (*model.ChannelMember, *model.AppError) { - member, nErr := a.Srv().Store.Channel().GetMember(channelId, userId) +func (a *App) ToggleMuteChannel(channelId, userID string) (*model.ChannelMember, *model.AppError) { + member, nErr := a.Srv().Store.Channel().GetMember(channelId, userID) if nErr != nil { var appErr *model.AppError var nfErr *store.ErrNotFound @@ -2807,8 +2807,8 @@ func (a *App) ToggleMuteChannel(channelId, userId string) (*model.ChannelMember, return member, nil } -func (a *App) setChannelsMuted(channelIds []string, userId string, muted bool) ([]*model.ChannelMember, *model.AppError) { - members, nErr := a.Srv().Store.Channel().GetMembersByChannelIds(channelIds, userId) +func (a *App) setChannelsMuted(channelIds []string, userID string, muted bool) ([]*model.ChannelMember, *model.AppError) { + members, nErr := a.Srv().Store.Channel().GetMembersByChannelIds(channelIds, userID) if nErr != nil { var appErr *model.AppError switch { @@ -2871,7 +2871,7 @@ func (a *App) FillInChannelsProps(channelList *model.ChannelList) *model.AppErro channelsByTeam[channel.TeamId] = append(channelsByTeam[channel.TeamId], channel) } - for teamId, channelList := range channelsByTeam { + for teamID, channelList := range channelsByTeam { allChannelMentions := make(map[string]bool) channelMentions := make(map[*model.Channel][]string, len(channelList)) @@ -2890,7 +2890,7 @@ func (a *App) FillInChannelsProps(channelList *model.ChannelList) *model.AppErro } if len(allChannelMentionNames) > 0 { - mentionedChannels, err := a.GetChannelsByNames(allChannelMentionNames, teamId) + mentionedChannels, err := a.GetChannelsByNames(allChannelMentionNames, teamID) if err != nil { return err } diff --git a/app/channel_category.go b/app/channel_category.go index 54a654970d..f609e85c85 100644 --- a/app/channel_category.go +++ b/app/channel_category.go @@ -13,8 +13,8 @@ import ( "github.com/mattermost/mattermost-server/v5/store" ) -func (a *App) createInitialSidebarCategories(userId, teamId string) *model.AppError { - nErr := a.Srv().Store.Channel().CreateInitialSidebarCategories(userId, teamId) +func (a *App) createInitialSidebarCategories(userID, teamID string) *model.AppError { + nErr := a.Srv().Store.Channel().CreateInitialSidebarCategories(userID, teamID) if nErr != nil { return model.NewAppError("createInitialSidebarCategories", "app.channel.create_initial_sidebar_categories.internal_error", nil, nErr.Error(), http.StatusInternalServerError) @@ -23,17 +23,17 @@ func (a *App) createInitialSidebarCategories(userId, teamId string) *model.AppEr return nil } -func (a *App) GetSidebarCategories(userId, teamId string) (*model.OrderedSidebarCategories, *model.AppError) { - categories, err := a.Srv().Store.Channel().GetSidebarCategories(userId, teamId) +func (a *App) GetSidebarCategories(userID, teamID string) (*model.OrderedSidebarCategories, *model.AppError) { + categories, err := a.Srv().Store.Channel().GetSidebarCategories(userID, teamID) if err == nil && len(categories.Categories) == 0 { // A user must always have categories, so migration must not have happened yet, and we should run it ourselves - appErr := a.createInitialSidebarCategories(userId, teamId) + appErr := a.createInitialSidebarCategories(userID, teamID) if appErr != nil { return nil, appErr } - categories, err = a.waitForSidebarCategories(userId, teamId) + categories, err = a.waitForSidebarCategories(userID, teamID) } if err != nil { @@ -51,10 +51,10 @@ func (a *App) GetSidebarCategories(userId, teamId string) (*model.OrderedSidebar // waitForSidebarCategories is used to get a user's sidebar categories after they've been created since there may be // replication lag if any database replicas exist. It will wait until results are available to return them. -func (a *App) waitForSidebarCategories(userId, teamId string) (*model.OrderedSidebarCategories, error) { +func (a *App) waitForSidebarCategories(userID, teamID string) (*model.OrderedSidebarCategories, error) { if len(a.Config().SqlSettings.DataSourceReplicas) == 0 { // The categories should be available immediately on a single database - return a.Srv().Store.Channel().GetSidebarCategories(userId, teamId) + return a.Srv().Store.Channel().GetSidebarCategories(userID, teamID) } now := model.GetMillis() @@ -62,7 +62,7 @@ func (a *App) waitForSidebarCategories(userId, teamId string) (*model.OrderedSid for model.GetMillis()-now < 12000 { time.Sleep(100 * time.Millisecond) - categories, err := a.Srv().Store.Channel().GetSidebarCategories(userId, teamId) + categories, err := a.Srv().Store.Channel().GetSidebarCategories(userID, teamID) if err != nil || len(categories.Categories) > 0 { // We've found something, so return @@ -70,13 +70,13 @@ func (a *App) waitForSidebarCategories(userId, teamId string) (*model.OrderedSid } } - mlog.Error("waitForSidebarCategories giving up", mlog.String("user_id", userId), mlog.String("team_id", teamId)) + mlog.Error("waitForSidebarCategories giving up", mlog.String("user_id", userID), mlog.String("team_id", teamID)) return &model.OrderedSidebarCategories{}, nil } -func (a *App) GetSidebarCategoryOrder(userId, teamId string) ([]string, *model.AppError) { - categories, err := a.Srv().Store.Channel().GetSidebarCategoryOrder(userId, teamId) +func (a *App) GetSidebarCategoryOrder(userID, teamID string) ([]string, *model.AppError) { + categories, err := a.Srv().Store.Channel().GetSidebarCategoryOrder(userID, teamID) if err != nil { var nfErr *store.ErrNotFound switch { @@ -105,8 +105,8 @@ func (a *App) GetSidebarCategory(categoryId string) (*model.SidebarCategoryWithC return category, nil } -func (a *App) CreateSidebarCategory(userId, teamId string, newCategory *model.SidebarCategoryWithChannels) (*model.SidebarCategoryWithChannels, *model.AppError) { - category, err := a.Srv().Store.Channel().CreateSidebarCategory(userId, teamId, newCategory) +func (a *App) CreateSidebarCategory(userID, teamID string, newCategory *model.SidebarCategoryWithChannels) (*model.SidebarCategoryWithChannels, *model.AppError) { + category, err := a.Srv().Store.Channel().CreateSidebarCategory(userID, teamID, newCategory) if err != nil { var nfErr *store.ErrNotFound switch { @@ -116,14 +116,14 @@ func (a *App) CreateSidebarCategory(userId, teamId string, newCategory *model.Si return nil, model.NewAppError("CreateSidebarCategory", "app.channel.sidebar_categories.app_error", nil, err.Error(), http.StatusInternalServerError) } } - message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_SIDEBAR_CATEGORY_CREATED, teamId, "", userId, nil) + message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_SIDEBAR_CATEGORY_CREATED, teamID, "", userID, nil) message.Add("category_id", category.Id) a.Publish(message) return category, nil } -func (a *App) UpdateSidebarCategoryOrder(userId, teamId string, categoryOrder []string) *model.AppError { - err := a.Srv().Store.Channel().UpdateSidebarCategoryOrder(userId, teamId, categoryOrder) +func (a *App) UpdateSidebarCategoryOrder(userID, teamID string, categoryOrder []string) *model.AppError { + err := a.Srv().Store.Channel().UpdateSidebarCategoryOrder(userID, teamID, categoryOrder) if err != nil { var nfErr *store.ErrNotFound var invErr *store.ErrInvalidInput @@ -136,27 +136,27 @@ func (a *App) UpdateSidebarCategoryOrder(userId, teamId string, categoryOrder [] return model.NewAppError("UpdateSidebarCategoryOrder", "app.channel.sidebar_categories.app_error", nil, err.Error(), http.StatusInternalServerError) } } - message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_SIDEBAR_CATEGORY_ORDER_UPDATED, teamId, "", userId, nil) + message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_SIDEBAR_CATEGORY_ORDER_UPDATED, teamID, "", userID, nil) message.Add("order", categoryOrder) a.Publish(message) return nil } -func (a *App) UpdateSidebarCategories(userId, teamId string, categories []*model.SidebarCategoryWithChannels) ([]*model.SidebarCategoryWithChannels, *model.AppError) { - updatedCategories, originalCategories, err := a.Srv().Store.Channel().UpdateSidebarCategories(userId, teamId, categories) +func (a *App) UpdateSidebarCategories(userID, teamID string, categories []*model.SidebarCategoryWithChannels) ([]*model.SidebarCategoryWithChannels, *model.AppError) { + updatedCategories, originalCategories, err := a.Srv().Store.Channel().UpdateSidebarCategories(userID, teamID, categories) if err != nil { return nil, model.NewAppError("UpdateSidebarCategories", "app.channel.sidebar_categories.app_error", nil, err.Error(), http.StatusInternalServerError) } - message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_SIDEBAR_CATEGORY_UPDATED, teamId, "", userId, nil) + message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_SIDEBAR_CATEGORY_UPDATED, teamID, "", userID, nil) a.Publish(message) - a.muteChannelsForUpdatedCategories(userId, updatedCategories, originalCategories) + a.muteChannelsForUpdatedCategories(userID, updatedCategories, originalCategories) return updatedCategories, nil } -func (a *App) muteChannelsForUpdatedCategories(userId string, updatedCategories []*model.SidebarCategoryWithChannels, originalCategories []*model.SidebarCategoryWithChannels) { +func (a *App) muteChannelsForUpdatedCategories(userID string, updatedCategories []*model.SidebarCategoryWithChannels, originalCategories []*model.SidebarCategoryWithChannels) { var channelsToMute []string var channelsToUnmute []string @@ -204,22 +204,22 @@ func (a *App) muteChannelsForUpdatedCategories(userId string, updatedCategories } if len(channelsToMute) > 0 { - _, err := a.setChannelsMuted(channelsToMute, userId, true) + _, err := a.setChannelsMuted(channelsToMute, userID, true) if err != nil { mlog.Error( "Failed to mute channels to match category", - mlog.String("user_id", userId), + mlog.String("user_id", userID), mlog.Err(err), ) } } if len(channelsToUnmute) > 0 { - _, err := a.setChannelsMuted(channelsToUnmute, userId, false) + _, err := a.setChannelsMuted(channelsToUnmute, userID, false) if err != nil { mlog.Error( "Failed to unmute channels to match category", - mlog.String("user_id", userId), + mlog.String("user_id", userID), mlog.Err(err), ) } @@ -261,7 +261,7 @@ func diffChannelsBetweenCategories(updatedCategories []*model.SidebarCategoryWit return channelsDiff } -func (a *App) DeleteSidebarCategory(userId, teamId, categoryId string) *model.AppError { +func (a *App) DeleteSidebarCategory(userID, teamID, categoryId string) *model.AppError { err := a.Srv().Store.Channel().DeleteSidebarCategory(categoryId) if err != nil { var invErr *store.ErrInvalidInput @@ -273,7 +273,7 @@ func (a *App) DeleteSidebarCategory(userId, teamId, categoryId string) *model.Ap } } - message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_SIDEBAR_CATEGORY_DELETED, teamId, "", userId, nil) + message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_SIDEBAR_CATEGORY_DELETED, teamID, "", userID, nil) message.Add("category_id", categoryId) a.Publish(message) diff --git a/app/command.go b/app/command.go index 4b5f207aee..7ad907a225 100644 --- a/app/command.go +++ b/app/command.go @@ -42,8 +42,8 @@ func GetCommandProvider(name string) CommandProvider { return nil } -// @openTracingParams teamId, skipSlackParsing -func (a *App) CreateCommandPost(post *model.Post, teamId string, response *model.CommandResponse, skipSlackParsing bool) (*model.Post, *model.AppError) { +// @openTracingParams teamID, skipSlackParsing +func (a *App) CreateCommandPost(post *model.Post, teamID string, response *model.CommandResponse, skipSlackParsing bool) (*model.Post, *model.AppError) { if skipSlackParsing { post.Message = response.Text } else { @@ -73,13 +73,13 @@ func (a *App) CreateCommandPost(post *model.Post, teamId string, response *model return post, nil } -// @openTracingParams teamId +// @openTracingParams teamID // previous ListCommands now ListAutocompleteCommands -func (a *App) ListAutocompleteCommands(teamId string, T goi18n.TranslateFunc) ([]*model.Command, *model.AppError) { +func (a *App) ListAutocompleteCommands(teamID string, T goi18n.TranslateFunc) ([]*model.Command, *model.AppError) { commands := make([]*model.Command, 0, 32) seen := make(map[string]bool) - for _, cmd := range a.PluginCommandsForTeam(teamId) { + for _, cmd := range a.PluginCommandsForTeam(teamID) { if cmd.AutoComplete && !seen[cmd.Trigger] { seen[cmd.Trigger] = true commands = append(commands, cmd) @@ -87,7 +87,7 @@ func (a *App) ListAutocompleteCommands(teamId string, T goi18n.TranslateFunc) ([ } if *a.Config().ServiceSettings.EnableCommands { - teamCmds, err := a.Srv().Store.Command().GetByTeam(teamId) + teamCmds, err := a.Srv().Store.Command().GetByTeam(teamID) if err != nil { return nil, model.NewAppError("ListAutocompleteCommands", "app.command.listautocompletecommands.internal_error", nil, err.Error(), http.StatusInternalServerError) } @@ -115,12 +115,12 @@ func (a *App) ListAutocompleteCommands(teamId string, T goi18n.TranslateFunc) ([ return commands, nil } -func (a *App) ListTeamCommands(teamId string) ([]*model.Command, *model.AppError) { +func (a *App) ListTeamCommands(teamID string) ([]*model.Command, *model.AppError) { if !*a.Config().ServiceSettings.EnableCommands { return nil, model.NewAppError("ListTeamCommands", "api.command.disabled.app_error", nil, "", http.StatusNotImplemented) } - teamCmds, err := a.Srv().Store.Command().GetByTeam(teamId) + teamCmds, err := a.Srv().Store.Command().GetByTeam(teamID) if err != nil { return nil, model.NewAppError("ListTeamCommands", "app.command.listteamcommands.internal_error", nil, err.Error(), http.StatusInternalServerError) } @@ -128,7 +128,7 @@ func (a *App) ListTeamCommands(teamId string) ([]*model.Command, *model.AppError return teamCmds, nil } -func (a *App) ListAllCommands(teamId string, T goi18n.TranslateFunc) ([]*model.Command, *model.AppError) { +func (a *App) ListAllCommands(teamID string, T goi18n.TranslateFunc) ([]*model.Command, *model.AppError) { commands := make([]*model.Command, 0, 32) seen := make(map[string]bool) for _, value := range commandProviders { @@ -142,7 +142,7 @@ func (a *App) ListAllCommands(teamId string, T goi18n.TranslateFunc) ([]*model.C } } - for _, cmd := range a.PluginCommandsForTeam(teamId) { + for _, cmd := range a.PluginCommandsForTeam(teamID) { if !seen[cmd.Trigger] { seen[cmd.Trigger] = true commands = append(commands, cmd) @@ -150,7 +150,7 @@ func (a *App) ListAllCommands(teamId string, T goi18n.TranslateFunc) ([]*model.C } if *a.Config().ServiceSettings.EnableCommands { - teamCmds, err := a.Srv().Store.Command().GetByTeam(teamId) + teamCmds, err := a.Srv().Store.Command().GetByTeam(teamID) if err != nil { return nil, model.NewAppError("ListAllCommands", "app.command.listallcommands.internal_error", nil, err.Error(), http.StatusInternalServerError) } @@ -218,7 +218,7 @@ func (a *App) ExecuteCommand(args *model.CommandArgs) (*model.CommandResponse, * // MentionsToTeamMembers returns all the @ mentions found in message that // belong to users in the specified team, linking them to their users -func (a *App) MentionsToTeamMembers(message, teamId string) model.UserMentionMap { +func (a *App) MentionsToTeamMembers(message, teamID string) model.UserMentionMap { type mentionMapItem struct { Name string Id string @@ -254,7 +254,7 @@ func (a *App) MentionsToTeamMembers(message, teamId string) model.UserMentionMap continue } - _, err := a.GetTeamMember(teamId, userFromTrimmed.Id) + _, err := a.GetTeamMember(teamID, userFromTrimmed.Id) if err != nil { // The user is not in the team, so we should ignore it return @@ -267,7 +267,7 @@ func (a *App) MentionsToTeamMembers(message, teamId string) model.UserMentionMap return } - _, err := a.GetTeamMember(teamId, user.Id) + _, err := a.GetTeamMember(teamID, user.Id) if err != nil { // The user is not in the team, so we should ignore it return @@ -290,7 +290,7 @@ func (a *App) MentionsToTeamMembers(message, teamId string) model.UserMentionMap // MentionsToPublicChannels returns all the mentions to public channels, // linking them to their channels -func (a *App) MentionsToPublicChannels(message, teamId string) model.ChannelMentionMap { +func (a *App) MentionsToPublicChannels(message, teamID string) model.ChannelMentionMap { type mentionMapItem struct { Name string Id string @@ -304,7 +304,7 @@ func (a *App) MentionsToPublicChannels(message, teamId string) model.ChannelMent wg.Add(1) go func(channelName string) { defer wg.Done() - channel, err := a.GetChannelByName(channelName, teamId, false) + channel, err := a.GetChannelByName(channelName, teamID, false) if err != nil { return } @@ -655,17 +655,17 @@ func (a *App) createCommand(cmd *model.Command) (*model.Command, *model.AppError return command, nil } -func (a *App) GetCommand(commandId string) (*model.Command, *model.AppError) { +func (a *App) GetCommand(commandID string) (*model.Command, *model.AppError) { if !*a.Config().ServiceSettings.EnableCommands { return nil, model.NewAppError("GetCommand", "api.command.disabled.app_error", nil, "", http.StatusNotImplemented) } - command, err := a.Srv().Store.Command().Get(commandId) + command, err := a.Srv().Store.Command().Get(commandID) if err != nil { var nfErr *store.ErrNotFound switch { case errors.As(err, &nfErr): - return nil, model.NewAppError("SqlCommandStore.Get", "store.sql_command.get.missing.app_error", map[string]interface{}{"command_id": commandId}, "", http.StatusNotFound) + return nil, model.NewAppError("SqlCommandStore.Get", "store.sql_command.get.missing.app_error", map[string]interface{}{"command_id": commandID}, "", http.StatusNotFound) default: return nil, model.NewAppError("GetCommand", "app.command.getcommand.internal_error", nil, err.Error(), http.StatusInternalServerError) } @@ -749,12 +749,12 @@ func (a *App) RegenCommandToken(cmd *model.Command) (*model.Command, *model.AppE return command, nil } -func (a *App) DeleteCommand(commandId string) *model.AppError { +func (a *App) DeleteCommand(commandID string) *model.AppError { if !*a.Config().ServiceSettings.EnableCommands { return model.NewAppError("DeleteCommand", "api.command.disabled.app_error", nil, "", http.StatusNotImplemented) } - err := a.Srv().Store.Command().Delete(commandId, model.GetMillis()) + err := a.Srv().Store.Command().Delete(commandID, model.GetMillis()) if err != nil { return model.NewAppError("DeleteCommand", "app.command.deletecommand.internal_error", nil, err.Error(), http.StatusInternalServerError) } diff --git a/app/email.go b/app/email.go index f9a1bf2d7c..498d169b2b 100644 --- a/app/email.go +++ b/app/email.go @@ -188,7 +188,7 @@ func (es *EmailService) SendSignInChangeEmail(email, method, locale, siteURL str return nil } -func (es *EmailService) sendWelcomeEmail(userId string, email string, verified bool, locale, siteURL, redirect string) *model.AppError { +func (es *EmailService) sendWelcomeEmail(userID string, email string, verified bool, locale, siteURL, redirect string) *model.AppError { if !*es.srv.Config().EmailSettings.SendEmailNotifications && !*es.srv.Config().EmailSettings.RequireEmailVerification { return model.NewAppError("SendWelcomeEmail", "api.user.send_welcome_email_and_forget.failed.error", nil, "Send Email Notifications and Require Email Verification is disabled in the system console", http.StatusInternalServerError) } @@ -216,7 +216,7 @@ func (es *EmailService) sendWelcomeEmail(userId string, email string, verified b } if !verified && *es.srv.Config().EmailSettings.RequireEmailVerification { - token, err := es.CreateVerifyEmailToken(userId, email) + token, err := es.CreateVerifyEmailToken(userID, email) if err != nil { return err } @@ -568,12 +568,12 @@ func (es *EmailService) sendMailWithEmbeddedFiles(to, subject, htmlBody string, return mailservice.SendMailWithEmbeddedFilesUsingConfig(to, subject, htmlBody, embeddedFiles, config, license != nil && *license.Features.Compliance, "") } -func (es *EmailService) CreateVerifyEmailToken(userId string, newEmail string) (*model.Token, *model.AppError) { +func (es *EmailService) CreateVerifyEmailToken(userID string, newEmail string) (*model.Token, *model.AppError) { tokenExtra := struct { UserId string Email string }{ - userId, + userID, newEmail, } jsonData, err := json.Marshal(tokenExtra) diff --git a/app/email_batching.go b/app/email_batching.go index bcae659000..d0f469df78 100644 --- a/app/email_batching.go +++ b/app/email_batching.go @@ -48,7 +48,7 @@ func (es *EmailService) AddNotificationEmailToBatch(user *model.User, post *mode } type batchedNotification struct { - userId string + userID string post *model.Post teamName string } @@ -85,7 +85,7 @@ func (job *EmailBatchingJob) Start() { func (job *EmailBatchingJob) Add(user *model.User, post *model.Post, team *model.Team) bool { notification := &batchedNotification{ - userId: user.Id, + userID: user.Id, post: post, teamName: team.Name, } @@ -116,12 +116,12 @@ func (job *EmailBatchingJob) handleNewNotifications() { for receiving { select { case notification := <-job.newNotifications: - userId := notification.userId + userID := notification.userID - if _, ok := job.pendingNotifications[userId]; !ok { - job.pendingNotifications[userId] = []*batchedNotification{notification} + if _, ok := job.pendingNotifications[userID]; !ok { + job.pendingNotifications[userID] = []*batchedNotification{notification} } else { - job.pendingNotifications[userId] = append(job.pendingNotifications[userId], notification) + job.pendingNotifications[userID] = append(job.pendingNotifications[userID], notification) } default: receiving = false @@ -130,7 +130,7 @@ func (job *EmailBatchingJob) handleNewNotifications() { } func (job *EmailBatchingJob) checkPendingNotifications(now time.Time, handler func(string, []*batchedNotification)) { - for userId, notifications := range job.pendingNotifications { + for userID, notifications := range job.pendingNotifications { batchStartTime := notifications[0].post.CreateAt inspectedTeamNames := make(map[string]string) for _, notification := range notifications { @@ -151,7 +151,7 @@ func (job *EmailBatchingJob) checkPendingNotifications(now time.Time, handler fu // if the user has viewed any channels in this team since the notification was queued, delete // all queued notifications - channelMembers, err := job.server.Store.Channel().GetMembersForUser(inspectedTeamNames[notification.teamName], userId) + channelMembers, err := job.server.Store.Channel().GetMembersForUser(inspectedTeamNames[notification.teamName], userID) if err != nil { mlog.Error("Unable to find ChannelMembers for user", mlog.Err(err)) continue @@ -159,8 +159,8 @@ func (job *EmailBatchingJob) checkPendingNotifications(now time.Time, handler fu for _, channelMember := range *channelMembers { if channelMember.LastViewedAt >= batchStartTime { - mlog.Debug("Deleted notifications for user", mlog.String("user_id", userId)) - delete(job.pendingNotifications, userId) + mlog.Debug("Deleted notifications for user", mlog.String("user_id", userID)) + delete(job.pendingNotifications, userID) break } } @@ -168,7 +168,7 @@ func (job *EmailBatchingJob) checkPendingNotifications(now time.Time, handler fu // get how long we need to wait to send notifications to the user var interval int64 - preference, err := job.server.Store.Preference().Get(userId, model.PREFERENCE_CATEGORY_NOTIFICATIONS, model.PREFERENCE_NAME_EMAIL_INTERVAL) + preference, err := job.server.Store.Preference().Get(userID, model.PREFERENCE_CATEGORY_NOTIFICATIONS, model.PREFERENCE_NAME_EMAIL_INTERVAL) if err != nil { // use the default batching interval if an error ocurrs while fetching user preferences interval, _ = strconv.ParseInt(model.PREFERENCE_EMAIL_INTERVAL_BATCHING_SECONDS, 10, 64) @@ -182,19 +182,19 @@ func (job *EmailBatchingJob) checkPendingNotifications(now time.Time, handler fu } // send the email notification if there are notifications to send AND it's been long enough - if len(job.pendingNotifications[userId]) > 0 && now.Sub(time.Unix(batchStartTime/1000, 0)) > time.Duration(interval)*time.Second { - job.server.Go(func(userId string, notifications []*batchedNotification) func() { + if len(job.pendingNotifications[userID]) > 0 && now.Sub(time.Unix(batchStartTime/1000, 0)) > time.Duration(interval)*time.Second { + job.server.Go(func(userID string, notifications []*batchedNotification) func() { return func() { - handler(userId, notifications) + handler(userID, notifications) } - }(userId, job.pendingNotifications[userId])) - delete(job.pendingNotifications, userId) + }(userID, job.pendingNotifications[userID])) + delete(job.pendingNotifications, userID) } } } -func (es *EmailService) sendBatchedEmailNotification(userId string, notifications []*batchedNotification) { - user, err := es.srv.Store.User().Get(userId) +func (es *EmailService) sendBatchedEmailNotification(userID string, notifications []*batchedNotification) { + user, err := es.srv.Store.User().Get(userID) if err != nil { mlog.Warn("Unable to find recipient for batched email notification") return diff --git a/app/export.go b/app/export.go index 73bb8aaa2c..6c8dca719c 100644 --- a/app/export.go +++ b/app/export.go @@ -256,10 +256,10 @@ func (a *App) exportAllUsers(writer io.Writer) *model.AppError { return nil } -func (a *App) buildUserTeamAndChannelMemberships(userId string) (*[]UserTeamImportData, *model.AppError) { +func (a *App) buildUserTeamAndChannelMemberships(userID string) (*[]UserTeamImportData, *model.AppError) { var memberships []UserTeamImportData - members, err := a.Srv().Store.Team().GetTeamMembersForExport(userId) + members, err := a.Srv().Store.Team().GetTeamMembersForExport(userID) if err != nil { return nil, model.NewAppError("buildUserTeamAndChannelMemberships", "app.team.get_members.app_error", nil, err.Error(), http.StatusInternalServerError) @@ -274,7 +274,7 @@ func (a *App) buildUserTeamAndChannelMemberships(userId string) (*[]UserTeamImpo memberData := ImportUserTeamDataFromTeamMember(member) // Do the Channel Memberships. - channelMembers, err := a.buildUserChannelMemberships(userId, member.TeamId) + channelMembers, err := a.buildUserChannelMemberships(userID, member.TeamId) if err != nil { return nil, err } @@ -293,16 +293,16 @@ func (a *App) buildUserTeamAndChannelMemberships(userId string) (*[]UserTeamImpo return &memberships, nil } -func (a *App) buildUserChannelMemberships(userId string, teamId string) (*[]UserChannelImportData, *model.AppError) { +func (a *App) buildUserChannelMemberships(userID string, teamID string) (*[]UserChannelImportData, *model.AppError) { var memberships []UserChannelImportData - members, nErr := a.Srv().Store.Channel().GetChannelMembersForExport(userId, teamId) + members, nErr := a.Srv().Store.Channel().GetChannelMembersForExport(userID, teamID) if nErr != nil { return nil, model.NewAppError("buildUserChannelMemberships", "app.channel.get_members.app_error", nil, nErr.Error(), http.StatusInternalServerError) } category := model.PREFERENCE_CATEGORY_FAVORITE_CHANNEL - preferences, err := a.GetPreferenceByCategoryForUser(userId, category) + preferences, err := a.GetPreferenceByCategoryForUser(userID, category) if err != nil && err.StatusCode != http.StatusNotFound { return nil, err } diff --git a/app/file.go b/app/file.go index fbdb098dcd..082c8d20dc 100644 --- a/app/file.go +++ b/app/file.go @@ -250,9 +250,9 @@ func (a *App) RemoveDirectory(path string) *model.AppError { return nil } -func (a *App) getInfoForFilename(post *model.Post, teamId, channelId, userId, oldId, filename string) *model.FileInfo { +func (a *App) getInfoForFilename(post *model.Post, teamID, channelId, userID, oldId, filename string) *model.FileInfo { name, _ := url.QueryUnescape(filename) - pathPrefix := fmt.Sprintf("teams/%s/channels/%s/users/%s/%s/", teamId, channelId, userId, oldId) + pathPrefix := fmt.Sprintf("teams/%s/channels/%s/users/%s/%s/", teamID, channelId, userID, oldId) path := pathPrefix + name // Open the file and populate the fields of the FileInfo @@ -324,8 +324,8 @@ func (a *App) findTeamIdForFilename(post *model.Post, id, filename string) strin var fileMigrationLock sync.Mutex var oldFilenameMatchExp *regexp.Regexp = regexp.MustCompile(`^\/([a-z\d]{26})\/([a-z\d]{26})\/([a-z\d]{26})\/([^\/]+)$`) -// Parse the path from the Filename of the form /{channelId}/{userId}/{uid}/{nameWithExtension} -func parseOldFilenames(filenames []string, channelId, userId string) [][]string { +// Parse the path from the Filename of the form /{channelId}/{userID}/{uid}/{nameWithExtension} +func parseOldFilenames(filenames []string, channelId, userID string) [][]string { parsed := [][]string{} for _, filename := range filenames { matches := oldFilenameMatchExp.FindStringSubmatch(filename) @@ -335,8 +335,8 @@ func parseOldFilenames(filenames []string, channelId, userId string) [][]string } if matches[1] != channelId { mlog.Error("ChannelId in Filename does not match", mlog.String("channel_id", channelId), mlog.String("matched", matches[1])) - } else if matches[2] != userId { - mlog.Error("UserId in Filename does not match", mlog.String("user_id", userId), mlog.String("matched", matches[2])) + } else if matches[2] != userID { + mlog.Error("UserId in Filename does not match", mlog.String("user_id", userID), mlog.String("matched", matches[2])) } else { parsed = append(parsed, matches[1:]) } @@ -373,17 +373,17 @@ func (a *App) MigrateFilenamesToFileInfos(post *model.Post) []*model.FileInfo { } // Find the team that was used to make this post since its part of the file path that isn't saved in the Filename - var teamId string + var teamID string if channel.TeamId == "" { // This post was made in a cross-team DM channel, so we need to find where its files were saved - teamId = a.findTeamIdForFilename(post, parsedFilenames[0][2], parsedFilenames[0][3]) + teamID = a.findTeamIdForFilename(post, parsedFilenames[0][2], parsedFilenames[0][3]) } else { - teamId = channel.TeamId + teamID = channel.TeamId } // Create FileInfo objects for this post infos := make([]*model.FileInfo, 0, len(filenames)) - if teamId == "" { + if teamID == "" { mlog.Error( "Unable to find team id for files when migrating post to use FileInfos", mlog.String("filenames", strings.Join(filenames, ",")), @@ -391,7 +391,7 @@ func (a *App) MigrateFilenamesToFileInfos(post *model.Post) []*model.FileInfo { ) } else { for _, parsed := range parsedFilenames { - info := a.getInfoForFilename(post, teamId, parsed[0], parsed[1], parsed[2], parsed[3]) + info := a.getInfoForFilename(post, teamID, parsed[0], parsed[1], parsed[2], parsed[3]) if info == nil { continue } @@ -476,7 +476,7 @@ func GeneratePublicLinkHash(fileId, salt string) string { return base64.RawURLEncoding.EncodeToString(hash.Sum(nil)) } -func (a *App) UploadMultipartFiles(teamId string, channelId string, userId string, fileHeaders []*multipart.FileHeader, clientIds []string, now time.Time) (*model.FileUploadResponse, *model.AppError) { +func (a *App) UploadMultipartFiles(teamID string, channelId string, userID string, fileHeaders []*multipart.FileHeader, clientIds []string, now time.Time) (*model.FileUploadResponse, *model.AppError) { files := make([]io.ReadCloser, len(fileHeaders)) filenames := make([]string, len(fileHeaders)) @@ -494,13 +494,13 @@ func (a *App) UploadMultipartFiles(teamId string, channelId string, userId strin filenames[i] = fileHeader.Filename } - return a.UploadFiles(teamId, channelId, userId, files, filenames, clientIds, now) + return a.UploadFiles(teamID, channelId, userID, files, filenames, clientIds, now) } // Uploads some files to the given team and channel as the given user. files and filenames should have // the same length. clientIds should either not be provided or have the same length as files and filenames. // The provided files should be closed by the caller so that they are not leaked. -func (a *App) UploadFiles(teamId string, channelId string, userId string, files []io.ReadCloser, filenames []string, clientIds []string, now time.Time) (*model.FileUploadResponse, *model.AppError) { +func (a *App) UploadFiles(teamID string, channelId string, userID string, files []io.ReadCloser, filenames []string, clientIds []string, now time.Time) (*model.FileUploadResponse, *model.AppError) { if *a.Config().FileSettings.DriverName == "" { return nil, model.NewAppError("UploadFiles", "api.file.upload_file.storage.app_error", nil, "", http.StatusNotImplemented) } @@ -523,7 +523,7 @@ func (a *App) UploadFiles(teamId string, channelId string, userId string, files io.Copy(buf, file) data := buf.Bytes() - info, data, err := a.DoUploadFileExpectModification(now, teamId, channelId, userId, filenames[i], data) + info, data, err := a.DoUploadFileExpectModification(now, teamID, channelId, userID, filenames[i], data) if err != nil { return nil, err } @@ -575,15 +575,15 @@ func (a *App) DoUploadFile(now time.Time, rawTeamId string, rawChannelId string, return info, err } -func UploadFileSetTeamId(teamId string) func(t *UploadFileTask) { +func UploadFileSetTeamId(teamID string) func(t *UploadFileTask) { return func(t *UploadFileTask) { - t.TeamId = filepath.Base(teamId) + t.TeamId = filepath.Base(teamID) } } -func UploadFileSetUserId(userId string) func(t *UploadFileTask) { +func UploadFileSetUserId(userID string) func(t *UploadFileTask) { return func(t *UploadFileTask) { - t.UserId = filepath.Base(userId) + t.UserId = filepath.Base(userID) } } @@ -940,9 +940,9 @@ func (t UploadFileTask) newAppError(id string, details interface{}, httpStatus i func (a *App) DoUploadFileExpectModification(now time.Time, rawTeamId string, rawChannelId string, rawUserId string, rawFilename string, data []byte) (*model.FileInfo, []byte, *model.AppError) { filename := filepath.Base(rawFilename) - teamId := filepath.Base(rawTeamId) + teamID := filepath.Base(rawTeamId) channelId := filepath.Base(rawChannelId) - userId := filepath.Base(rawUserId) + userID := filepath.Base(rawUserId) info, err := model.GetInfoForBytes(filename, bytes.NewReader(data), len(data)) if err != nil { @@ -959,10 +959,10 @@ func (a *App) DoUploadFileExpectModification(now time.Time, rawTeamId string, ra } info.Id = model.NewId() - info.CreatorId = userId + info.CreatorId = userID info.CreateAt = now.UnixNano() / int64(time.Millisecond) - pathPrefix := now.Format("20060102") + "/teams/" + teamId + "/channels/" + channelId + "/users/" + userId + "/" + info.Id + "/" + pathPrefix := now.Format("20060102") + "/teams/" + teamID + "/channels/" + channelId + "/users/" + userID + "/" + info.Id + "/" info.Path = pathPrefix + filename if info.IsImage() { @@ -1223,7 +1223,7 @@ func (a *App) GetFile(fileId string) ([]byte, *model.AppError) { return data, nil } -func (a *App) CopyFileInfos(userId string, fileIds []string) ([]string, *model.AppError) { +func (a *App) CopyFileInfos(userID string, fileIds []string) ([]string, *model.AppError) { var newFileIds []string now := model.GetMillis() @@ -1241,7 +1241,7 @@ func (a *App) CopyFileInfos(userId string, fileIds []string) ([]string, *model.A } fileInfo.Id = model.NewId() - fileInfo.CreatorId = userId + fileInfo.CreatorId = userID fileInfo.CreateAt = now fileInfo.UpdateAt = now fileInfo.PostId = "" diff --git a/app/file_bench_test.go b/app/file_bench_test.go index 0d75efe19d..8bf3d7a8dc 100644 --- a/app/file_bench_test.go +++ b/app/file_bench_test.go @@ -61,9 +61,9 @@ func BenchmarkUploadFile(b *testing.B) { defer th.TearDown() // disable logging in the benchmark, as best we can th.App.Log().SetConsoleLevel(mlog.LevelError) - teamId := model.NewId() + teamID := model.NewId() channelId := model.NewId() - userId := model.NewId() + userID := model.NewId() mb := func(i int) int { return (i + 512*1024) / (1024 * 1024) @@ -86,8 +86,8 @@ func BenchmarkUploadFile(b *testing.B) { { title: "raw-ish DoUploadFile", f: func(b *testing.B, n int, data []byte, ext string) { - info1, err := th.App.DoUploadFile(time.Now(), teamId, channelId, - userId, fmt.Sprintf("BenchmarkDoUploadFile-%d%s", n, ext), data) + info1, err := th.App.DoUploadFile(time.Now(), teamID, channelId, + userID, fmt.Sprintf("BenchmarkDoUploadFile-%d%s", n, ext), data) if err != nil { b.Fatal(err) } @@ -102,8 +102,8 @@ func BenchmarkUploadFile(b *testing.B) { info, aerr := th.App.UploadFileX(channelId, fmt.Sprintf("BenchmarkUploadFileTask-%d%s", n, ext), bytes.NewReader(data), - UploadFileSetTeamId(teamId), - UploadFileSetUserId(userId), + UploadFileSetTeamId(teamID), + UploadFileSetUserId(userID), UploadFileSetTimestamp(time.Now()), UploadFileSetContentLength(int64(len(data))), UploadFileSetRaw()) @@ -120,8 +120,8 @@ func BenchmarkUploadFile(b *testing.B) { info, aerr := th.App.UploadFileX(channelId, fmt.Sprintf("BenchmarkUploadFileTask-%d%s", n, ext), bytes.NewReader(data), - UploadFileSetTeamId(teamId), - UploadFileSetUserId(userId), + UploadFileSetTeamId(teamID), + UploadFileSetUserId(userID), UploadFileSetTimestamp(time.Now()), UploadFileSetContentLength(-1), UploadFileSetRaw()) @@ -135,7 +135,7 @@ func BenchmarkUploadFile(b *testing.B) { { title: "image UploadFiles", f: func(b *testing.B, n int, data []byte, ext string) { - resp, err := th.App.UploadFiles(teamId, channelId, userId, + resp, err := th.App.UploadFiles(teamID, channelId, userID, []io.ReadCloser{ioutil.NopCloser(bytes.NewReader(data))}, []string{fmt.Sprintf("BenchmarkDoUploadFiles-%d%s", n, ext)}, []string{}, @@ -153,8 +153,8 @@ func BenchmarkUploadFile(b *testing.B) { info, aerr := th.App.UploadFileX(channelId, fmt.Sprintf("BenchmarkUploadFileTask-%d%s", n, ext), bytes.NewReader(data), - UploadFileSetTeamId(teamId), - UploadFileSetUserId(userId), + UploadFileSetTeamId(teamID), + UploadFileSetUserId(userID), UploadFileSetTimestamp(time.Now()), UploadFileSetContentLength(int64(len(data)))) if aerr != nil { @@ -170,8 +170,8 @@ func BenchmarkUploadFile(b *testing.B) { info, aerr := th.App.UploadFileX(channelId, fmt.Sprintf("BenchmarkUploadFileTask-%d%s", n, ext), bytes.NewReader(data), - UploadFileSetTeamId(teamId), - UploadFileSetUserId(userId), + UploadFileSetTeamId(teamID), + UploadFileSetUserId(userID), UploadFileSetTimestamp(time.Now()), UploadFileSetContentLength(int64(len(data)))) if aerr != nil { diff --git a/app/file_test.go b/app/file_test.go index 88c1b4b703..5feaa01ed3 100644 --- a/app/file_test.go +++ b/app/file_test.go @@ -43,50 +43,50 @@ func TestDoUploadFile(t *testing.T) { th := Setup(t) defer th.TearDown() - teamId := model.NewId() + teamID := model.NewId() channelId := model.NewId() - userId := model.NewId() + userID := model.NewId() filename := "test" data := []byte("abcd") - info1, err := th.App.DoUploadFile(time.Date(2007, 2, 4, 1, 2, 3, 4, time.Local), teamId, channelId, userId, filename, data) + info1, err := th.App.DoUploadFile(time.Date(2007, 2, 4, 1, 2, 3, 4, time.Local), teamID, channelId, userID, filename, data) require.Nil(t, err, "DoUploadFile should succeed with valid data") defer func() { th.App.Srv().Store.FileInfo().PermanentDelete(info1.Id) th.App.RemoveFile(info1.Path) }() - value := fmt.Sprintf("20070204/teams/%v/channels/%v/users/%v/%v/%v", teamId, channelId, userId, info1.Id, filename) + value := fmt.Sprintf("20070204/teams/%v/channels/%v/users/%v/%v/%v", teamID, channelId, userID, info1.Id, filename) assert.Equal(t, value, info1.Path, "stored file at incorrect path") - info2, err := th.App.DoUploadFile(time.Date(2007, 2, 4, 1, 2, 3, 4, time.Local), teamId, channelId, userId, filename, data) + info2, err := th.App.DoUploadFile(time.Date(2007, 2, 4, 1, 2, 3, 4, time.Local), teamID, channelId, userID, filename, data) require.Nil(t, err, "DoUploadFile should succeed with valid data") defer func() { th.App.Srv().Store.FileInfo().PermanentDelete(info2.Id) th.App.RemoveFile(info2.Path) }() - value = fmt.Sprintf("20070204/teams/%v/channels/%v/users/%v/%v/%v", teamId, channelId, userId, info2.Id, filename) + value = fmt.Sprintf("20070204/teams/%v/channels/%v/users/%v/%v/%v", teamID, channelId, userID, info2.Id, filename) assert.Equal(t, value, info2.Path, "stored file at incorrect path") - info3, err := th.App.DoUploadFile(time.Date(2008, 3, 5, 1, 2, 3, 4, time.Local), teamId, channelId, userId, filename, data) + info3, err := th.App.DoUploadFile(time.Date(2008, 3, 5, 1, 2, 3, 4, time.Local), teamID, channelId, userID, filename, data) require.Nil(t, err, "DoUploadFile should succeed with valid data") defer func() { th.App.Srv().Store.FileInfo().PermanentDelete(info3.Id) th.App.RemoveFile(info3.Path) }() - value = fmt.Sprintf("20080305/teams/%v/channels/%v/users/%v/%v/%v", teamId, channelId, userId, info3.Id, filename) + value = fmt.Sprintf("20080305/teams/%v/channels/%v/users/%v/%v/%v", teamID, channelId, userID, info3.Id, filename) assert.Equal(t, value, info3.Path, "stored file at incorrect path") - info4, err := th.App.DoUploadFile(time.Date(2009, 3, 5, 1, 2, 3, 4, time.Local), "../../"+teamId, "../../"+channelId, "../../"+userId, "../../"+filename, data) + info4, err := th.App.DoUploadFile(time.Date(2009, 3, 5, 1, 2, 3, 4, time.Local), "../../"+teamID, "../../"+channelId, "../../"+userID, "../../"+filename, data) require.Nil(t, err, "DoUploadFile should succeed with valid data") defer func() { th.App.Srv().Store.FileInfo().PermanentDelete(info4.Id) th.App.RemoveFile(info4.Path) }() - value = fmt.Sprintf("20090305/teams/%v/channels/%v/users/%v/%v/%v", teamId, channelId, userId, info4.Id, filename) + value = fmt.Sprintf("20090305/teams/%v/channels/%v/users/%v/%v/%v", teamID, channelId, userID, info4.Id, filename) assert.Equal(t, value, info4.Path, "stored file at incorrect path") } @@ -127,21 +127,21 @@ func TestParseOldFilenames(t *testing.T) { description string filenames []string channelId string - userId string + userID string expected [][]string }{ { description: "Empty input should result in empty output", filenames: []string{}, channelId: th.BasicChannel.Id, - userId: th.BasicUser.Id, + userID: th.BasicUser.Id, expected: [][]string{}, }, { description: "Filename with invalid format should not parse", filenames: []string{"/path/to/some/file.png"}, channelId: th.BasicChannel.Id, - userId: th.BasicUser.Id, + userID: th.BasicUser.Id, expected: [][]string{}, }, { @@ -150,7 +150,7 @@ func TestParseOldFilenames(t *testing.T) { fmt.Sprintf("/%v/%v/%v/file.png", model.NewId(), th.BasicUser.Id, fileId), }, channelId: th.BasicChannel.Id, - userId: th.BasicUser.Id, + userID: th.BasicUser.Id, expected: [][]string{}, }, { @@ -159,7 +159,7 @@ func TestParseOldFilenames(t *testing.T) { fmt.Sprintf("/%v/%v/%v/file.png", th.BasicChannel.Id, model.NewId(), fileId), }, channelId: th.BasicChannel.Id, - userId: th.BasicUser.Id, + userID: th.BasicUser.Id, expected: [][]string{}, }, { @@ -168,7 +168,7 @@ func TestParseOldFilenames(t *testing.T) { fmt.Sprintf("/%v/%v/%v/../../../file.png", th.BasicChannel.Id, th.BasicUser.Id, fileId), }, channelId: th.BasicChannel.Id, - userId: th.BasicUser.Id, + userID: th.BasicUser.Id, expected: [][]string{}, }, { @@ -178,7 +178,7 @@ func TestParseOldFilenames(t *testing.T) { fmt.Sprintf("/%v/%v/%v/file.png", th.BasicChannel.Id, th.BasicUser.Id, fileId), }, channelId: th.BasicChannel.Id, - userId: th.BasicUser.Id, + userID: th.BasicUser.Id, expected: [][]string{ { th.BasicChannel.Id, @@ -194,7 +194,7 @@ func TestParseOldFilenames(t *testing.T) { fmt.Sprintf("/%v/%v/%v/file.png", th.BasicChannel.Id, th.BasicUser.Id, fileId), }, channelId: th.BasicChannel.Id, - userId: th.BasicUser.Id, + userID: th.BasicUser.Id, expected: [][]string{ { th.BasicChannel.Id, @@ -208,7 +208,7 @@ func TestParseOldFilenames(t *testing.T) { for _, test := range tests { t.Run(test.description, func(tt *testing.T) { - result := parseOldFilenames(test.filenames, test.channelId, test.userId) + result := parseOldFilenames(test.filenames, test.channelId, test.userID) require.Equal(tt, result, test.expected) }) } @@ -219,9 +219,9 @@ func TestGetInfoForFilename(t *testing.T) { defer th.TearDown() post := th.BasicPost - teamId := th.BasicTeam.Id + teamID := th.BasicTeam.Id - info := th.App.getInfoForFilename(post, teamId, post.ChannelId, post.UserId, "someid", "somefile.png") + info := th.App.getInfoForFilename(post, teamID, post.ChannelId, post.UserId, "someid", "somefile.png") assert.Nil(t, info, "Test non-existent file") } @@ -229,14 +229,14 @@ func TestFindTeamIdForFilename(t *testing.T) { th := Setup(t).InitBasic() defer th.TearDown() - teamId := th.App.findTeamIdForFilename(th.BasicPost, "someid", "somefile.png") - assert.Equal(t, th.BasicTeam.Id, teamId) + teamID := th.App.findTeamIdForFilename(th.BasicPost, "someid", "somefile.png") + assert.Equal(t, th.BasicTeam.Id, teamID) _, err := th.App.CreateTeamWithUser(&model.Team{Email: th.BasicUser.Email, Name: "zz" + model.NewId(), DisplayName: "Joram's Test Team", Type: model.TEAM_OPEN}, th.BasicUser.Id) require.Nil(t, err) - teamId = th.App.findTeamIdForFilename(th.BasicPost, "someid", "somefile.png") - assert.Equal(t, "", teamId) + teamID = th.App.findTeamIdForFilename(th.BasicPost, "someid", "somefile.png") + assert.Equal(t, "", teamID) } func TestMigrateFilenamesToFileInfos(t *testing.T) { @@ -294,20 +294,20 @@ func TestCopyFileInfos(t *testing.T) { th := Setup(t) defer th.TearDown() - teamId := model.NewId() + teamID := model.NewId() channelId := model.NewId() - userId := model.NewId() + userID := model.NewId() filename := "test" data := []byte("abcd") - info1, err := th.App.DoUploadFile(time.Date(2007, 2, 4, 1, 2, 3, 4, time.Local), teamId, channelId, userId, filename, data) + info1, err := th.App.DoUploadFile(time.Date(2007, 2, 4, 1, 2, 3, 4, time.Local), teamID, channelId, userID, filename, data) require.Nil(t, err) defer func() { th.App.Srv().Store.FileInfo().PermanentDelete(info1.Id) th.App.RemoveFile(info1.Path) }() - infoIds, err := th.App.CopyFileInfos(userId, []string{info1.Id}) + infoIds, err := th.App.CopyFileInfos(userID, []string{info1.Id}) require.Nil(t, err) info2, err := th.App.GetFileInfo(infoIds[0]) diff --git a/app/group.go b/app/group.go index 8cda73f115..be9180238e 100644 --- a/app/group.go +++ b/app/group.go @@ -65,8 +65,8 @@ func (a *App) GetGroupsBySource(groupSource model.GroupSource) ([]*model.Group, return groups, nil } -func (a *App) GetGroupsByUserId(userId string) ([]*model.Group, *model.AppError) { - groups, err := a.Srv().Store.Group().GetByUser(userId) +func (a *App) GetGroupsByUserId(userID string) ([]*model.Group, *model.AppError) { + groups, err := a.Srv().Store.Group().GetByUser(userID) if err != nil { return nil, model.NewAppError("GetGroupsByUserId", "app.select_error", nil, err.Error(), http.StatusInternalServerError) } @@ -450,13 +450,13 @@ func (a *App) GetGroupsByChannel(channelId string, opts model.GroupSearchOpts) ( } // GetGroupsByTeam returns the paged list and the total count of group associated to the given team. -func (a *App) GetGroupsByTeam(teamId string, opts model.GroupSearchOpts) ([]*model.GroupWithSchemeAdmin, int, *model.AppError) { - groups, err := a.Srv().Store.Group().GetGroupsByTeam(teamId, opts) +func (a *App) GetGroupsByTeam(teamID string, opts model.GroupSearchOpts) ([]*model.GroupWithSchemeAdmin, int, *model.AppError) { + groups, err := a.Srv().Store.Group().GetGroupsByTeam(teamID, opts) if err != nil { return nil, 0, model.NewAppError("GetGroupsByTeam", "app.select_error", nil, err.Error(), http.StatusInternalServerError) } - count, err := a.Srv().Store.Group().CountGroupsByTeam(teamId, opts) + count, err := a.Srv().Store.Group().CountGroupsByTeam(teamID, opts) if err != nil { return nil, 0, model.NewAppError("GetGroupsByTeam", "app.select_error", nil, err.Error(), http.StatusInternalServerError) } @@ -464,8 +464,8 @@ func (a *App) GetGroupsByTeam(teamId string, opts model.GroupSearchOpts) ([]*mod return groups, int(count), nil } -func (a *App) GetGroupsAssociatedToChannelsByTeam(teamId string, opts model.GroupSearchOpts) (map[string][]*model.GroupWithSchemeAdmin, *model.AppError) { - groupsAssociatedByChannelId, err := a.Srv().Store.Group().GetGroupsAssociatedToChannelsByTeam(teamId, opts) +func (a *App) GetGroupsAssociatedToChannelsByTeam(teamID string, opts model.GroupSearchOpts) (map[string][]*model.GroupWithSchemeAdmin, *model.AppError) { + groupsAssociatedByChannelId, err := a.Srv().Store.Group().GetGroupsAssociatedToChannelsByTeam(teamID, opts) if err != nil { return nil, model.NewAppError("GetGroupsAssociatedToChannelsByTeam", "app.select_error", nil, err.Error(), http.StatusInternalServerError) } diff --git a/app/import_functions.go b/app/import_functions.go index 64decad021..aa417e1547 100644 --- a/app/import_functions.go +++ b/app/import_functions.go @@ -1016,7 +1016,7 @@ func (a *App) importReaction(data *ReactionImportData, post *model.Post) *model. return nil } -func (a *App) importReplies(data []ReplyImportData, post *model.Post, teamId string) *model.AppError { +func (a *App) importReplies(data []ReplyImportData, post *model.Post, teamID string) *model.AppError { var err *model.AppError usernames := []string{} for _, replyData := range data { @@ -1064,7 +1064,7 @@ func (a *App) importReplies(data []ReplyImportData, post *model.Post, teamId str reply.Message = *replyData.Message reply.CreateAt = *replyData.CreateAt - fileIds, err := a.uploadAttachments(replyData.Attachments, reply, teamId) + fileIds, err := a.uploadAttachments(replyData.Attachments, reply, teamID) if err != nil { return err } @@ -1112,7 +1112,7 @@ func (a *App) importReplies(data []ReplyImportData, post *model.Post, teamId str return nil } -func (a *App) importAttachment(data *AttachmentImportData, post *model.Post, teamId string) (*model.FileInfo, *model.AppError) { +func (a *App) importAttachment(data *AttachmentImportData, post *model.Post, teamID string) (*model.FileInfo, *model.AppError) { file, err := os.Open(*data.Path) if file == nil || err != nil { return nil, model.NewAppError("BulkImport", "app.import.attachment.bad_file.error", map[string]interface{}{"FilePath": *data.Path}, "", http.StatusBadRequest) @@ -1145,7 +1145,7 @@ func (a *App) importAttachment(data *AttachmentImportData, post *model.Post, tea } } } - fileInfo, appErr := a.DoUploadFile(timestamp, teamId, post.ChannelId, post.UserId, file.Name(), buf.Bytes()) + fileInfo, appErr := a.DoUploadFile(timestamp, teamID, post.ChannelId, post.UserId, file.Name(), buf.Bytes()) if appErr != nil { mlog.Error("Failed to upload file:", mlog.Err(appErr)) return nil, appErr @@ -1197,8 +1197,8 @@ func (a *App) getTeamsByNames(names []string) (map[string]*model.Team, *model.Ap return teams, nil } -func (a *App) getChannelsByNames(names []string, teamId string) (map[string]*model.Channel, *model.AppError) { - allChannels, err := a.Srv().Store.Channel().GetByNames(teamId, names, true) +func (a *App) getChannelsByNames(names []string, teamID string) (map[string]*model.Channel, *model.AppError) { + allChannels, err := a.Srv().Store.Channel().GetByNames(teamID, names, true) if err != nil { return nil, model.NewAppError("BulkImport", "app.import.get_teams_by_names.some_teams_not_found.error", nil, err.Error(), http.StatusBadRequest) } @@ -1421,14 +1421,14 @@ func (a *App) importMultiplePostLines(lines []LineImportWorkerData, dryRun bool) } // uploadAttachments imports new attachments and returns current attachments of the post as a map -func (a *App) uploadAttachments(attachments *[]AttachmentImportData, post *model.Post, teamId string) (map[string]bool, *model.AppError) { +func (a *App) uploadAttachments(attachments *[]AttachmentImportData, post *model.Post, teamID string) (map[string]bool, *model.AppError) { if attachments == nil { return nil, nil } fileIds := make(map[string]bool) for _, attachment := range *attachments { attachment := attachment - fileInfo, err := a.importAttachment(&attachment, post, teamId) + fileInfo, err := a.importAttachment(&attachment, post, teamID) if err != nil { return nil, err } @@ -1455,25 +1455,25 @@ func (a *App) importDirectChannel(data *DirectChannelImportData, dryRun bool) *m return nil } - var userIds []string + var userIDs []string userMap, err := a.getUsersByUsernames(*data.Members) if err != nil { return err } for _, user := range *data.Members { - userIds = append(userIds, userMap[user].Id) + userIDs = append(userIDs, userMap[user].Id) } var channel *model.Channel - if len(userIds) == 2 { - ch, err := a.createDirectChannel(userIds[0], userIds[1]) + if len(userIDs) == 2 { + ch, err := a.createDirectChannel(userIDs[0], userIDs[1]) if err != nil && err.Id != store.ChannelExistsError { return model.NewAppError("BulkImport", "app.import.import_direct_channel.create_direct_channel.error", nil, err.Error(), http.StatusBadRequest) } channel = ch } else { - ch, err := a.createGroupChannel(userIds) + ch, err := a.createGroupChannel(userIDs) if err != nil && err.Id != store.ChannelExistsError { return model.NewAppError("BulkImport", "app.import.import_direct_channel.create_group_channel.error", nil, err.Error(), http.StatusBadRequest) } @@ -1482,9 +1482,9 @@ func (a *App) importDirectChannel(data *DirectChannelImportData, dryRun bool) *m var preferences model.Preferences - for _, userId := range userIds { + for _, userID := range userIDs { preferences = append(preferences, model.Preference{ - UserId: userId, + UserId: userID, Category: model.PREFERENCE_CATEGORY_DIRECT_CHANNEL_SHOW, Name: channel.Id, Value: "true", @@ -1562,23 +1562,23 @@ func (a *App) importMultipleDirectPostLines(lines []LineImportWorkerData, dryRun postsForOverwriteMap := map[string]int{} for _, line := range lines { - var userIds []string + var userIDs []string var err *model.AppError for _, username := range *line.DirectPost.ChannelMembers { user := users[username] - userIds = append(userIds, user.Id) + userIDs = append(userIDs, user.Id) } var channel *model.Channel var ch *model.Channel - if len(userIds) == 2 { - ch, err = a.GetOrCreateDirectChannel(userIds[0], userIds[1]) + if len(userIDs) == 2 { + ch, err = a.GetOrCreateDirectChannel(userIDs[0], userIDs[1]) if err != nil && err.Id != store.ChannelExistsError { return line.LineNumber, model.NewAppError("BulkImport", "app.import.import_direct_post.create_direct_channel.error", nil, err.Error(), http.StatusBadRequest) } channel = ch } else { - ch, err = a.createGroupChannel(userIds) + ch, err = a.createGroupChannel(userIDs) if err != nil && err.Id != store.ChannelExistsError { return line.LineNumber, model.NewAppError("BulkImport", "app.import.import_direct_post.create_group_channel.error", nil, err.Error(), http.StatusBadRequest) } diff --git a/app/import_functions_test.go b/app/import_functions_test.go index ccb426c6ad..13321eac9d 100644 --- a/app/import_functions_test.go +++ b/app/import_functions_test.go @@ -3094,12 +3094,12 @@ func TestImportImportDirectChannel(t *testing.T) { AssertChannelCount(t, th.App, model.CHANNEL_GROUP, groupChannelCount+1) // Get the channel to check that the header was updated. - userIds := []string{ + userIDs := []string{ th.BasicUser.Id, th.BasicUser2.Id, user3.Id, } - channel, appErr := th.App.createGroupChannel(userIds) + channel, appErr := th.App.createGroupChannel(userIDs) require.Equal(t, appErr.Id, store.ChannelExistsError) require.Equal(t, channel.Header, *data.Header) @@ -3395,12 +3395,12 @@ func TestImportImportDirectPost(t *testing.T) { // Get the channel. var groupChannel *model.Channel - userIds := []string{ + userIDs := []string{ th.BasicUser.Id, th.BasicUser2.Id, user3.Id, } - channel, appErr = th.App.createGroupChannel(userIds) + channel, appErr = th.App.createGroupChannel(userIDs) require.Equal(t, appErr.Id, store.ChannelExistsError) groupChannel = channel @@ -3889,12 +3889,12 @@ func TestImportAttachment(t *testing.T) { testImage := filepath.Join(testsDir, "test.png") invalidPath := "some-invalid-path" - userId := model.NewId() + userID := model.NewId() data := AttachmentImportData{Path: &testImage} - _, err := th.App.importAttachment(&data, &model.Post{UserId: userId, ChannelId: "some-channel"}, "some-team") + _, err := th.App.importAttachment(&data, &model.Post{UserId: userID, ChannelId: "some-channel"}, "some-team") assert.Nil(t, err, "sample run without errors") - attachments := GetAttachments(userId, th, t) + attachments := GetAttachments(userID, th, t) assert.Len(t, attachments, 1) data = AttachmentImportData{Path: &invalidPath} diff --git a/app/import_test.go b/app/import_test.go index 6bb0e9d20d..8fab679c07 100644 --- a/app/import_test.go +++ b/app/import_test.go @@ -36,18 +36,18 @@ func ptrBool(b bool) *bool { return &b } -func checkPreference(t *testing.T, a *App, userId string, category string, name string, value string) { - preferences, err := a.Srv().Store.Preference().GetCategory(userId, category) - require.Nilf(t, err, "Failed to get preferences for user %v with category %v", userId, category) +func checkPreference(t *testing.T, a *App, userID string, category string, name string, value string) { + preferences, err := a.Srv().Store.Preference().GetCategory(userID, category) + require.Nilf(t, err, "Failed to get preferences for user %v with category %v", userID, category) found := false for _, preference := range preferences { if preference.Name == name { found = true - require.Equal(t, preference.Value, value, "Preference for user %v in category %v with name %v has value %v, expected %v", userId, category, name, preference.Value, value) + require.Equal(t, preference.Value, value, "Preference for user %v in category %v with name %v has value %v, expected %v", userID, category, name, preference.Value, value) break } } - require.Truef(t, found, "Did not find preference for user %v in category %v with name %v", userId, category, name) + require.Truef(t, found, "Did not find preference for user %v in category %v with name %v", userID, category, name) } func checkNotifyProp(t *testing.T, user *model.User, key string, value string) { @@ -249,8 +249,8 @@ func TestImportProcessImportDataFileVersionLine(t *testing.T) { require.NotNil(t, err, "Expected error on invalid version line.") } -func GetAttachments(userId string, th *TestHelper, t *testing.T) []*model.FileInfo { - fileInfos, err := th.App.Srv().Store.FileInfo().GetForUser(userId) +func GetAttachments(userID string, th *TestHelper, t *testing.T) []*model.FileInfo { + fileInfos, err := th.App.Srv().Store.FileInfo().GetForUser(userID) require.Nil(t, err) return fileInfos } diff --git a/app/integration_action.go b/app/integration_action.go index 566c9ea73b..f2bbd71017 100644 --- a/app/integration_action.go +++ b/app/integration_action.go @@ -37,11 +37,11 @@ import ( "github.com/mattermost/mattermost-server/v5/utils" ) -func (a *App) DoPostAction(postId, actionId, userId, selectedOption string) (string, *model.AppError) { - return a.DoPostActionWithCookie(postId, actionId, userId, selectedOption, nil) +func (a *App) DoPostAction(postId, actionId, userID, selectedOption string) (string, *model.AppError) { + return a.DoPostActionWithCookie(postId, actionId, userID, selectedOption, nil) } -func (a *App) DoPostActionWithCookie(postId, actionId, userId, selectedOption string, cookie *model.PostActionCookie) (string, *model.AppError) { +func (a *App) DoPostActionWithCookie(postId, actionId, userID, selectedOption string, cookie *model.PostActionCookie) (string, *model.AppError) { // PostAction may result in the original post being updated. For the // updated post, we need to unconditionally preserve the original @@ -62,7 +62,7 @@ func (a *App) DoPostActionWithCookie(postId, actionId, userId, selectedOption st upstreamURL := "" rootPostId := "" upstreamRequest := &model.PostActionIntegrationRequest{ - UserId: userId, + UserId: userID, PostId: postId, } @@ -277,7 +277,7 @@ func (a *App) DoPostActionWithCookie(postId, actionId, userId, selectedOption st Message: response.EphemeralText, ChannelId: upstreamRequest.ChannelId, RootId: rootPostId, - UserId: userId, + UserId: userID, } if !response.SkipSlackParsing { @@ -287,7 +287,7 @@ func (a *App) DoPostActionWithCookie(postId, actionId, userId, selectedOption st for key, value := range retain { ephemeralPost.AddProp(key, value) } - a.SendEphemeralPost(userId, ephemeralPost) + a.SendEphemeralPost(userID, ephemeralPost) } return clientTriggerId, nil @@ -567,7 +567,7 @@ func (a *App) DoLocalRequest(rawURL string, body []byte) (*http.Response, *model } func (a *App) OpenInteractiveDialog(request model.OpenDialogRequest) *model.AppError { - clientTriggerId, userId, err := request.DecodeAndVerifyTriggerId(a.AsymmetricSigningKey()) + clientTriggerId, userID, err := request.DecodeAndVerifyTriggerId(a.AsymmetricSigningKey()) if err != nil { return err } @@ -576,7 +576,7 @@ func (a *App) OpenInteractiveDialog(request model.OpenDialogRequest) *model.AppE jsonRequest, _ := json.Marshal(request) - message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_OPEN_DIALOG, "", "", userId, nil) + message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_OPEN_DIALOG, "", "", userID, nil) message.Add("dialog", string(jsonRequest)) a.Publish(message) diff --git a/app/notification.go b/app/notification.go index d02e40b064..3a1823ed92 100644 --- a/app/notification.go +++ b/app/notification.go @@ -181,16 +181,16 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod // for each mention, make sure to update thread autofollow (if enabled) and update increment mention count for id := range threadParticipants { mac := make(chan *model.AppError, 1) - go func(userId string) { + go func(userID string) { defer close(mac) incrementMentions := false for mid := range mentions.Mentions { - if userId == mid { + if userID == mid { incrementMentions = true break } } - nErr := a.Srv().Store.Thread().CreateMembershipIfNeeded(userId, post.RootId, true, incrementMentions, *a.Config().ServiceSettings.ThreadAutoFollow) + nErr := a.Srv().Store.Thread().CreateMembershipIfNeeded(userID, post.RootId, true, incrementMentions, *a.Config().ServiceSettings.ThreadAutoFollow) if nErr != nil { mac <- model.NewAppError("SendNotifications", "app.channel.autofollow.app_error", nil, nErr.Error(), http.StatusInternalServerError) return @@ -205,9 +205,9 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod mentionedUsersList = append(mentionedUsersList, id) umc := make(chan *model.AppError, 1) - go func(userId string) { + go func(userID string) { defer close(umc) - nErr := a.Srv().Store.Channel().IncrementMentionCount(post.ChannelId, userId, *a.Config().ServiceSettings.ThreadAutoFollow) + nErr := a.Srv().Store.Channel().IncrementMentionCount(post.ChannelId, userID, *a.Config().ServiceSettings.ThreadAutoFollow) if nErr != nil { umc <- model.NewAppError("SendNotifications", "app.channel.increment_mention_count.app_error", nil, nErr.Error(), http.StatusInternalServerError) return @@ -705,16 +705,16 @@ const ( GroupMention ) -func (m *ExplicitMentions) addMention(userId string, mentionType MentionType) { +func (m *ExplicitMentions) addMention(userID string, mentionType MentionType) { if m.Mentions == nil { m.Mentions = make(map[string]MentionType) } - if currentType, ok := m.Mentions[userId]; ok && currentType >= mentionType { + if currentType, ok := m.Mentions[userID]; ok && currentType >= mentionType { return } - m.Mentions[userId] = mentionType + m.Mentions[userID] = mentionType } func (m *ExplicitMentions) addGroupMention(word string, groups map[string]*model.Group) bool { @@ -745,14 +745,14 @@ func (m *ExplicitMentions) addGroupMention(word string, groups map[string]*model return true } -func (m *ExplicitMentions) addMentions(userIds []string, mentionType MentionType) { - for _, userId := range userIds { - m.addMention(userId, mentionType) +func (m *ExplicitMentions) addMentions(userIDs []string, mentionType MentionType) { + for _, userID := range userIDs { + m.addMention(userID, mentionType) } } -func (m *ExplicitMentions) removeMention(userId string) { - delete(m.Mentions, userId) +func (m *ExplicitMentions) removeMention(userID string) { + delete(m.Mentions, userID) } // Given a message and a map mapping mention keywords to the users who use them, returns a map of mentioned diff --git a/app/notification_push.go b/app/notification_push.go index 25f7c052bc..d8352a70aa 100644 --- a/app/notification_push.go +++ b/app/notification_push.go @@ -41,7 +41,7 @@ type PushNotificationsHub struct { type PushNotification struct { notificationType notificationType currentSessionId string - userId string + userID string channelId string post *model.Post user *model.User @@ -74,8 +74,8 @@ func (a *App) sendPushNotificationSync(post *model.Post, user *model.User, chann return a.sendPushNotificationToAllSessions(msg, user.Id, "") } -func (a *App) sendPushNotificationToAllSessions(msg *model.PushNotification, userId string, skipSessionId string) *model.AppError { - sessions, err := a.getMobileAppSessions(userId) +func (a *App) sendPushNotificationToAllSessions(msg *model.PushNotification, userID string, skipSessionId string) *model.AppError { + sessions, err := a.getMobileAppSessions(userID) if err != nil { return err } @@ -201,7 +201,7 @@ func (a *App) getPushNotificationMessage(contentsConfig, postMessage string, exp return senderName + userLocale("api.post.send_notifications_and_forget.push_general_message") } -func (a *App) clearPushNotificationSync(currentSessionId, userId, channelId string) *model.AppError { +func (a *App) clearPushNotificationSync(currentSessionId, userID, channelId string) *model.AppError { msg := &model.PushNotification{ Type: model.PUSH_TYPE_CLEAR, Version: model.PUSH_MESSAGE_V2, @@ -209,22 +209,22 @@ func (a *App) clearPushNotificationSync(currentSessionId, userId, channelId stri ContentAvailable: 1, } - unreadCount, err := a.Srv().Store.User().GetUnreadCount(userId) + unreadCount, err := a.Srv().Store.User().GetUnreadCount(userID) if err != nil { return model.NewAppError("clearPushNotificationSync", "app.user.get_unread_count.app_error", nil, err.Error(), http.StatusInternalServerError) } msg.Badge = int(unreadCount) - return a.sendPushNotificationToAllSessions(msg, userId, currentSessionId) + return a.sendPushNotificationToAllSessions(msg, userID, currentSessionId) } -func (a *App) clearPushNotification(currentSessionId, userId, channelId string) { +func (a *App) clearPushNotification(currentSessionId, userID, channelId string) { select { case a.Srv().PushNotificationsHub.notificationsChan <- PushNotification{ notificationType: notificationTypeClear, currentSessionId: currentSessionId, - userId: userId, + userID: userID, channelId: channelId, }: case <-a.Srv().PushNotificationsHub.stopChan: @@ -232,7 +232,7 @@ func (a *App) clearPushNotification(currentSessionId, userId, channelId string) } } -func (a *App) updateMobileAppBadgeSync(userId string) *model.AppError { +func (a *App) updateMobileAppBadgeSync(userID string) *model.AppError { msg := &model.PushNotification{ Type: model.PUSH_TYPE_UPDATE_BADGE, Version: model.PUSH_MESSAGE_V2, @@ -240,21 +240,21 @@ func (a *App) updateMobileAppBadgeSync(userId string) *model.AppError { ContentAvailable: 1, } - unreadCount, err := a.Srv().Store.User().GetUnreadCount(userId) + unreadCount, err := a.Srv().Store.User().GetUnreadCount(userID) if err != nil { return model.NewAppError("updateMobileAppBadgeSync", "app.user.get_unread_count.app_error", nil, err.Error(), http.StatusInternalServerError) } msg.Badge = int(unreadCount) - return a.sendPushNotificationToAllSessions(msg, userId, "") + return a.sendPushNotificationToAllSessions(msg, userID, "") } -func (a *App) UpdateMobileAppBadge(userId string) { +func (a *App) UpdateMobileAppBadge(userID string) { select { case a.Srv().PushNotificationsHub.notificationsChan <- PushNotification{ notificationType: notificationTypeUpdateBadge, - userId: userId, + userID: userID, }: case <-a.Srv().PushNotificationsHub.stopChan: return @@ -307,7 +307,7 @@ func (hub *PushNotificationsHub) start() { var err *model.AppError switch notification.notificationType { case notificationTypeClear: - err = hub.app.clearPushNotificationSync(notification.currentSessionId, notification.userId, notification.channelId) + err = hub.app.clearPushNotificationSync(notification.currentSessionId, notification.userID, notification.channelId) case notificationTypeMessage: err = hub.app.sendPushNotificationSync( notification.post, @@ -320,7 +320,7 @@ func (hub *PushNotificationsHub) start() { notification.replyToThreadType, ) case notificationTypeUpdateBadge: - err = hub.app.updateMobileAppBadgeSync(notification.userId) + err = hub.app.updateMobileAppBadgeSync(notification.userID) default: mlog.Debug("Invalid notification type", mlog.String("notification_type", string(notification.notificationType))) } @@ -429,8 +429,8 @@ func (a *App) SendAckToPushProxy(ack *model.PushNotificationAck) error { return nil } -func (a *App) getMobileAppSessions(userId string) ([]*model.Session, *model.AppError) { - sessions, err := a.Srv().Store.Session().GetSessionsWithActiveDeviceIds(userId) +func (a *App) getMobileAppSessions(userID string) ([]*model.Session, *model.AppError) { + sessions, err := a.Srv().Store.Session().GetSessionsWithActiveDeviceIds(userID) if err != nil { return nil, model.NewAppError("getMobileAppSessions", "app.session.get_sessions.app_error", nil, err.Error(), http.StatusInternalServerError) } diff --git a/app/notification_push_test.go b/app/notification_push_test.go index 8522e371e8..c20318b130 100644 --- a/app/notification_push_test.go +++ b/app/notification_push_test.go @@ -353,13 +353,13 @@ func TestDoesNotifyPropsAllowPushNotification(t *testing.T) { } func TestDoesStatusAllowPushNotification(t *testing.T) { - userId := model.NewId() + userID := model.NewId() channelId := model.NewId() - offline := &model.Status{UserId: userId, Status: model.STATUS_OFFLINE, Manual: false, LastActivityAt: 0, ActiveChannel: ""} - away := &model.Status{UserId: userId, Status: model.STATUS_AWAY, Manual: false, LastActivityAt: 0, ActiveChannel: ""} - online := &model.Status{UserId: userId, Status: model.STATUS_ONLINE, Manual: false, LastActivityAt: model.GetMillis(), ActiveChannel: ""} - dnd := &model.Status{UserId: userId, Status: model.STATUS_DND, Manual: true, LastActivityAt: model.GetMillis(), ActiveChannel: ""} + offline := &model.Status{UserId: userID, Status: model.STATUS_OFFLINE, Manual: false, LastActivityAt: 0, ActiveChannel: ""} + away := &model.Status{UserId: userID, Status: model.STATUS_AWAY, Manual: false, LastActivityAt: 0, ActiveChannel: ""} + online := &model.Status{UserId: userID, Status: model.STATUS_ONLINE, Manual: false, LastActivityAt: model.GetMillis(), ActiveChannel: ""} + dnd := &model.Status{UserId: userID, Status: model.STATUS_DND, Manual: true, LastActivityAt: model.GetMillis(), ActiveChannel: ""} tt := []struct { name string diff --git a/app/notification_test.go b/app/notification_test.go index f3451255d8..4fb3e28783 100644 --- a/app/notification_test.go +++ b/app/notification_test.go @@ -1971,51 +1971,51 @@ func TestAddMention(t *testing.T) { t.Run("should initialize Mentions and store new mentions", func(t *testing.T) { m := &ExplicitMentions{} - userId1 := model.NewId() - userId2 := model.NewId() + userID1 := model.NewId() + userID2 := model.NewId() - m.addMention(userId1, KeywordMention) - m.addMention(userId2, CommentMention) + m.addMention(userID1, KeywordMention) + m.addMention(userID2, CommentMention) assert.Equal(t, map[string]MentionType{ - userId1: KeywordMention, - userId2: CommentMention, + userID1: KeywordMention, + userID2: CommentMention, }, m.Mentions) }) t.Run("should replace existing mentions with higher priority ones", func(t *testing.T) { m := &ExplicitMentions{} - userId1 := model.NewId() - userId2 := model.NewId() + userID1 := model.NewId() + userID2 := model.NewId() - m.addMention(userId1, ThreadMention) - m.addMention(userId2, DMMention) + m.addMention(userID1, ThreadMention) + m.addMention(userID2, DMMention) - m.addMention(userId1, ChannelMention) - m.addMention(userId2, KeywordMention) + m.addMention(userID1, ChannelMention) + m.addMention(userID2, KeywordMention) assert.Equal(t, map[string]MentionType{ - userId1: ChannelMention, - userId2: KeywordMention, + userID1: ChannelMention, + userID2: KeywordMention, }, m.Mentions) }) t.Run("should not replace high priority mentions with low priority ones", func(t *testing.T) { m := &ExplicitMentions{} - userId1 := model.NewId() - userId2 := model.NewId() + userID1 := model.NewId() + userID2 := model.NewId() - m.addMention(userId1, KeywordMention) - m.addMention(userId2, CommentMention) + m.addMention(userID1, KeywordMention) + m.addMention(userID2, CommentMention) - m.addMention(userId1, DMMention) - m.addMention(userId2, ThreadMention) + m.addMention(userID1, DMMention) + m.addMention(userID2, ThreadMention) assert.Equal(t, map[string]MentionType{ - userId1: KeywordMention, - userId2: CommentMention, + userID1: KeywordMention, + userID2: CommentMention, }, m.Mentions) }) } diff --git a/app/oauth.go b/app/oauth.go index 720d09d88f..b9b20d93ae 100644 --- a/app/oauth.go +++ b/app/oauth.go @@ -128,12 +128,12 @@ func (a *App) GetOAuthApps(page, perPage int) ([]*model.OAuthApp, *model.AppErro return oauthApps, nil } -func (a *App) GetOAuthAppsByCreator(userId string, page, perPage int) ([]*model.OAuthApp, *model.AppError) { +func (a *App) GetOAuthAppsByCreator(userID string, page, perPage int) ([]*model.OAuthApp, *model.AppError) { if !*a.Config().ServiceSettings.EnableOAuthServiceProvider { return nil, model.NewAppError("GetOAuthAppsByUser", "api.oauth.allow_oauth.turn_off.app_error", nil, "", http.StatusNotImplemented) } - oauthApps, err := a.Srv().Store.OAuth().GetAppByUser(userId, page*perPage, perPage) + oauthApps, err := a.Srv().Store.OAuth().GetAppByUser(userID, page*perPage, perPage) if err != nil { return nil, model.NewAppError("GetOAuthAppsByCreator", "app.oauth.get_app_by_user.find.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -141,8 +141,8 @@ func (a *App) GetOAuthAppsByCreator(userId string, page, perPage int) ([]*model. return oauthApps, nil } -func (a *App) GetOAuthImplicitRedirect(userId string, authRequest *model.AuthorizeRequest) (string, *model.AppError) { - session, err := a.GetOAuthAccessTokenForImplicitFlow(userId, authRequest) +func (a *App) GetOAuthImplicitRedirect(userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError) { + session, err := a.GetOAuthAccessTokenForImplicitFlow(userID, authRequest) if err != nil { return "", err } @@ -157,8 +157,8 @@ func (a *App) GetOAuthImplicitRedirect(userId string, authRequest *model.Authori return fmt.Sprintf("%s#%s", authRequest.RedirectUri, values.Encode()), nil } -func (a *App) GetOAuthCodeRedirect(userId string, authRequest *model.AuthorizeRequest) (string, *model.AppError) { - authData := &model.AuthData{UserId: userId, ClientId: authRequest.ClientId, CreateAt: model.GetMillis(), RedirectUri: authRequest.RedirectUri, State: authRequest.State, Scope: authRequest.Scope} +func (a *App) GetOAuthCodeRedirect(userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError) { + authData := &model.AuthData{UserId: userID, ClientId: authRequest.ClientId, CreateAt: model.GetMillis(), RedirectUri: authRequest.RedirectUri, State: authRequest.State, Scope: authRequest.Scope} authData.Code = model.NewId() + model.NewId() if _, err := a.Srv().Store.OAuth().SaveAuthData(authData); err != nil { @@ -168,7 +168,7 @@ func (a *App) GetOAuthCodeRedirect(userId string, authRequest *model.AuthorizeRe return authRequest.RedirectUri + "?code=" + url.QueryEscape(authData.Code) + "&state=" + url.QueryEscape(authData.State), nil } -func (a *App) AllowOAuthAppAccessToUser(userId string, authRequest *model.AuthorizeRequest) (string, *model.AppError) { +func (a *App) AllowOAuthAppAccessToUser(userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError) { if !*a.Config().ServiceSettings.EnableOAuthServiceProvider { return "", model.NewAppError("AllowOAuthAppAccessToUser", "api.oauth.allow_oauth.turn_off.app_error", nil, "", http.StatusNotImplemented) } @@ -196,9 +196,9 @@ func (a *App) AllowOAuthAppAccessToUser(userId string, authRequest *model.Author var err *model.AppError switch authRequest.ResponseType { case model.AUTHCODE_RESPONSE_TYPE: - redirectURI, err = a.GetOAuthCodeRedirect(userId, authRequest) + redirectURI, err = a.GetOAuthCodeRedirect(userID, authRequest) case model.IMPLICIT_RESPONSE_TYPE: - redirectURI, err = a.GetOAuthImplicitRedirect(userId, authRequest) + redirectURI, err = a.GetOAuthImplicitRedirect(userID, authRequest) default: return authRequest.RedirectUri + "?error=unsupported_response_type&state=" + authRequest.State, nil } @@ -210,7 +210,7 @@ func (a *App) AllowOAuthAppAccessToUser(userId string, authRequest *model.Author // This saves the OAuth2 app as authorized authorizedApp := model.Preference{ - UserId: userId, + UserId: userID, Category: model.PREFERENCE_CATEGORY_AUTHORIZED_OAUTH_APP, Name: authRequest.ClientId, Value: authRequest.Scope, @@ -224,7 +224,7 @@ func (a *App) AllowOAuthAppAccessToUser(userId string, authRequest *model.Author return redirectURI, nil } -func (a *App) GetOAuthAccessTokenForImplicitFlow(userId string, authRequest *model.AuthorizeRequest) (*model.Session, *model.AppError) { +func (a *App) GetOAuthAccessTokenForImplicitFlow(userID string, authRequest *model.AuthorizeRequest) (*model.Session, *model.AppError) { if !*a.Config().ServiceSettings.EnableOAuthServiceProvider { return nil, model.NewAppError("GetOAuthAccessToken", "api.oauth.get_access_token.disabled.app_error", nil, "", http.StatusNotImplemented) } @@ -234,7 +234,7 @@ func (a *App) GetOAuthAccessTokenForImplicitFlow(userId string, authRequest *mod return nil, model.NewAppError("GetOAuthAccessToken", "api.oauth.get_access_token.credentials.app_error", nil, "", http.StatusNotFound) } - user, err := a.GetUser(userId) + user, err := a.GetUser(userID) if err != nil { return nil, err } @@ -409,11 +409,11 @@ func (a *App) newSessionUpdateToken(appName string, accessData *model.AccessData return accessRsp, nil } -func (a *App) GetOAuthLoginEndpoint(w http.ResponseWriter, r *http.Request, service, teamId, action, redirectTo, loginHint string, isMobile bool) (string, *model.AppError) { +func (a *App) GetOAuthLoginEndpoint(w http.ResponseWriter, r *http.Request, service, teamID, action, redirectTo, loginHint string, isMobile bool) (string, *model.AppError) { stateProps := map[string]string{} stateProps["action"] = action - if teamId != "" { - stateProps["team_id"] = teamId + if teamID != "" { + stateProps["team_id"] = teamID } if redirectTo != "" { @@ -430,11 +430,11 @@ func (a *App) GetOAuthLoginEndpoint(w http.ResponseWriter, r *http.Request, serv return authUrl, nil } -func (a *App) GetOAuthSignupEndpoint(w http.ResponseWriter, r *http.Request, service, teamId string) (string, *model.AppError) { +func (a *App) GetOAuthSignupEndpoint(w http.ResponseWriter, r *http.Request, service, teamID string) (string, *model.AppError) { stateProps := map[string]string{} stateProps["action"] = model.OAUTH_ACTION_SIGNUP - if teamId != "" { - stateProps["team_id"] = teamId + if teamID != "" { + stateProps["team_id"] = teamID } authUrl, err := a.GetAuthorizationCode(w, r, service, stateProps, "") @@ -445,12 +445,12 @@ func (a *App) GetOAuthSignupEndpoint(w http.ResponseWriter, r *http.Request, ser return authUrl, nil } -func (a *App) GetAuthorizedAppsForUser(userId string, page, perPage int) ([]*model.OAuthApp, *model.AppError) { +func (a *App) GetAuthorizedAppsForUser(userID string, page, perPage int) ([]*model.OAuthApp, *model.AppError) { if !*a.Config().ServiceSettings.EnableOAuthServiceProvider { return nil, model.NewAppError("GetAuthorizedAppsForUser", "api.oauth.allow_oauth.turn_off.app_error", nil, "", http.StatusNotImplemented) } - apps, err := a.Srv().Store.OAuth().GetAuthorizedApps(userId, page*perPage, perPage) + apps, err := a.Srv().Store.OAuth().GetAuthorizedApps(userID, page*perPage, perPage) if err != nil { return nil, model.NewAppError("GetAuthorizedAppsForUser", "app.oauth.get_apps.find.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -463,13 +463,13 @@ func (a *App) GetAuthorizedAppsForUser(userId string, page, perPage int) ([]*mod return apps, nil } -func (a *App) DeauthorizeOAuthAppForUser(userId, appId string) *model.AppError { +func (a *App) DeauthorizeOAuthAppForUser(userID, appId string) *model.AppError { if !*a.Config().ServiceSettings.EnableOAuthServiceProvider { return model.NewAppError("DeauthorizeOAuthAppForUser", "api.oauth.allow_oauth.turn_off.app_error", nil, "", http.StatusNotImplemented) } // Revoke app sessions - accessData, err := a.Srv().Store.OAuth().GetAccessDataByUserForApp(userId, appId) + accessData, err := a.Srv().Store.OAuth().GetAccessDataByUserForApp(userID, appId) if err != nil { return model.NewAppError("DeauthorizeOAuthAppForUser", "app.oauth.get_access_data_by_user_for_app.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -485,7 +485,7 @@ func (a *App) DeauthorizeOAuthAppForUser(userId, appId string) *model.AppError { } // Deauthorize the app - if err := a.Srv().Store.Preference().Delete(userId, model.PREFERENCE_CATEGORY_AUTHORIZED_OAUTH_APP, appId); err != nil { + if err := a.Srv().Store.Preference().Delete(userID, model.PREFERENCE_CATEGORY_AUTHORIZED_OAUTH_APP, appId); err != nil { return model.NewAppError("DeauthorizeOAuthAppForUser", "app.preference.delete.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -544,22 +544,22 @@ func (a *App) RevokeAccessToken(token string) *model.AppError { return nil } -func (a *App) CompleteOAuth(service string, body io.ReadCloser, teamId string, props map[string]string, tokenUser *model.User) (*model.User, *model.AppError) { +func (a *App) CompleteOAuth(service string, body io.ReadCloser, teamID string, props map[string]string, tokenUser *model.User) (*model.User, *model.AppError) { defer body.Close() action := props["action"] switch action { case model.OAUTH_ACTION_SIGNUP: - return a.CreateOAuthUser(service, body, teamId, tokenUser) + return a.CreateOAuthUser(service, body, teamID, tokenUser) case model.OAUTH_ACTION_LOGIN: - return a.LoginByOAuth(service, body, teamId, tokenUser) + return a.LoginByOAuth(service, body, teamID, tokenUser) case model.OAUTH_ACTION_EMAIL_TO_SSO: return a.CompleteSwitchWithOAuth(service, body, props["email"], tokenUser) case model.OAUTH_ACTION_SSO_TO_EMAIL: - return a.LoginByOAuth(service, body, teamId, tokenUser) + return a.LoginByOAuth(service, body, teamID, tokenUser) default: - return a.LoginByOAuth(service, body, teamId, tokenUser) + return a.LoginByOAuth(service, body, teamID, tokenUser) } } @@ -580,7 +580,7 @@ func (a *App) getSSOProvider(service string) (einterfaces.OauthProvider, *model. return provider, nil } -func (a *App) LoginByOAuth(service string, userData io.Reader, teamId string, tokenUser *model.User) (*model.User, *model.AppError) { +func (a *App) LoginByOAuth(service string, userData io.Reader, teamID string, tokenUser *model.User) (*model.User, *model.AppError) { provider, e := a.getSSOProvider(service) if e != nil { return nil, e @@ -606,7 +606,7 @@ func (a *App) LoginByOAuth(service string, userData io.Reader, teamId string, to user, err := a.GetUserByAuth(model.NewString(*authUser.AuthData), service) if err != nil { if err.Id == MissingAuthAccountError { - user, err = a.CreateOAuthUser(service, bytes.NewReader(buf.Bytes()), teamId, tokenUser) + user, err = a.CreateOAuthUser(service, bytes.NewReader(buf.Bytes()), teamID, tokenUser) } else { return nil, err } @@ -621,8 +621,8 @@ func (a *App) LoginByOAuth(service string, userData io.Reader, teamId string, to if err = a.UpdateOAuthUserAttrs(bytes.NewReader(buf.Bytes()), user, provider, service, tokenUser); err != nil { return nil, err } - if teamId != "" { - err = a.AddUserToTeamByTeamId(teamId, user) + if teamID != "" { + err = a.AddUserToTeamByTeamId(teamID, user) } } @@ -833,7 +833,7 @@ func (a *App) AuthorizeOAuthUser(w http.ResponseWriter, r *http.Request, service http.SetCookie(w, httpCookie) - teamId := stateProps["team_id"] + teamID := stateProps["team_id"] p := url.Values{} p.Set("client_id", *sso.Id) @@ -912,7 +912,7 @@ func (a *App) AuthorizeOAuthUser(w http.ResponseWriter, r *http.Request, service } // Note that resp.Body is not closed here, so it must be closed by the caller - return resp.Body, teamId, stateProps, userFromToken, nil + return resp.Body, teamID, stateProps, userFromToken, nil } func (a *App) SwitchEmailToOAuth(w http.ResponseWriter, r *http.Request, email, password, code, service string) (string, *model.AppError) { diff --git a/app/opentracing/opentracing_layer.go b/app/opentracing/opentracing_layer.go index 2530e3f9f2..2112736da7 100644 --- a/app/opentracing/opentracing_layer.go +++ b/app/opentracing/opentracing_layer.go @@ -72,7 +72,7 @@ type OpenTracingAppLayer struct { ctx context.Context } -func (a *OpenTracingAppLayer) ActivateMfa(userId string, token string) *model.AppError { +func (a *OpenTracingAppLayer) ActivateMfa(userID string, token string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ActivateMfa") @@ -84,7 +84,7 @@ func (a *OpenTracingAppLayer) ActivateMfa(userId string, token string) *model.Ap }() defer span.Finish() - resultVar0 := a.app.ActivateMfa(userId, token) + resultVar0 := a.app.ActivateMfa(userID, token) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -94,7 +94,7 @@ func (a *OpenTracingAppLayer) ActivateMfa(userId string, token string) *model.Ap return resultVar0 } -func (a *OpenTracingAppLayer) AddChannelMember(userId string, channel *model.Channel, userRequestorId string, postRootId string) (*model.ChannelMember, *model.AppError) { +func (a *OpenTracingAppLayer) AddChannelMember(userID string, channel *model.Channel, userRequestorId string, postRootId string) (*model.ChannelMember, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddChannelMember") @@ -106,7 +106,7 @@ func (a *OpenTracingAppLayer) AddChannelMember(userId string, channel *model.Cha }() defer span.Finish() - resultVar0, resultVar1 := a.app.AddChannelMember(userId, channel, userRequestorId, postRootId) + resultVar0, resultVar1 := a.app.AddChannelMember(userID, channel, userRequestorId, postRootId) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -148,7 +148,7 @@ func (a *OpenTracingAppLayer) AddCursorIdsForPostList(originalList *model.PostLi a.app.AddCursorIdsForPostList(originalList, afterPost, beforePost, since, page, perPage) } -func (a *OpenTracingAppLayer) AddDirectChannels(teamId string, user *model.User) *model.AppError { +func (a *OpenTracingAppLayer) AddDirectChannels(teamID string, user *model.User) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddDirectChannels") @@ -160,7 +160,7 @@ func (a *OpenTracingAppLayer) AddDirectChannels(teamId string, user *model.User) }() defer span.Finish() - resultVar0 := a.app.AddDirectChannels(teamId, user) + resultVar0 := a.app.AddDirectChannels(teamID, user) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -347,7 +347,7 @@ func (a *OpenTracingAppLayer) AddStatusCacheSkipClusterSend(status *model.Status a.app.AddStatusCacheSkipClusterSend(status) } -func (a *OpenTracingAppLayer) AddTeamMember(teamId string, userId string) (*model.TeamMember, *model.AppError) { +func (a *OpenTracingAppLayer) AddTeamMember(teamID string, userID string) (*model.TeamMember, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddTeamMember") @@ -359,7 +359,7 @@ func (a *OpenTracingAppLayer) AddTeamMember(teamId string, userId string) (*mode }() defer span.Finish() - resultVar0, resultVar1 := a.app.AddTeamMember(teamId, userId) + resultVar0, resultVar1 := a.app.AddTeamMember(teamID, userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -369,7 +369,7 @@ func (a *OpenTracingAppLayer) AddTeamMember(teamId string, userId string) (*mode return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) AddTeamMemberByInviteId(inviteId string, userId string) (*model.TeamMember, *model.AppError) { +func (a *OpenTracingAppLayer) AddTeamMemberByInviteId(inviteId string, userID string) (*model.TeamMember, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddTeamMemberByInviteId") @@ -381,7 +381,7 @@ func (a *OpenTracingAppLayer) AddTeamMemberByInviteId(inviteId string, userId st }() defer span.Finish() - resultVar0, resultVar1 := a.app.AddTeamMemberByInviteId(inviteId, userId) + resultVar0, resultVar1 := a.app.AddTeamMemberByInviteId(inviteId, userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -391,7 +391,7 @@ func (a *OpenTracingAppLayer) AddTeamMemberByInviteId(inviteId string, userId st return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) AddTeamMemberByToken(userId string, tokenId string) (*model.TeamMember, *model.AppError) { +func (a *OpenTracingAppLayer) AddTeamMemberByToken(userID string, tokenID string) (*model.TeamMember, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddTeamMemberByToken") @@ -403,7 +403,7 @@ func (a *OpenTracingAppLayer) AddTeamMemberByToken(userId string, tokenId string }() defer span.Finish() - resultVar0, resultVar1 := a.app.AddTeamMemberByToken(userId, tokenId) + resultVar0, resultVar1 := a.app.AddTeamMemberByToken(userID, tokenID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -413,7 +413,7 @@ func (a *OpenTracingAppLayer) AddTeamMemberByToken(userId string, tokenId string return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) AddTeamMembers(teamId string, userIds []string, userRequestorId string, graceful bool) ([]*model.TeamMemberWithError, *model.AppError) { +func (a *OpenTracingAppLayer) AddTeamMembers(teamID string, userIDs []string, userRequestorId string, graceful bool) ([]*model.TeamMemberWithError, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddTeamMembers") @@ -425,7 +425,7 @@ func (a *OpenTracingAppLayer) AddTeamMembers(teamId string, userIds []string, us }() defer span.Finish() - resultVar0, resultVar1 := a.app.AddTeamMembers(teamId, userIds, userRequestorId, graceful) + resultVar0, resultVar1 := a.app.AddTeamMembers(teamID, userIDs, userRequestorId, graceful) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -457,7 +457,7 @@ func (a *OpenTracingAppLayer) AddUserToChannel(user *model.User, channel *model. return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) AddUserToTeam(teamId string, userId string, userRequestorId string) (*model.Team, *model.AppError) { +func (a *OpenTracingAppLayer) AddUserToTeam(teamID string, userID string, userRequestorId string) (*model.Team, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddUserToTeam") @@ -469,7 +469,7 @@ func (a *OpenTracingAppLayer) AddUserToTeam(teamId string, userId string, userRe }() defer span.Finish() - resultVar0, resultVar1 := a.app.AddUserToTeam(teamId, userId, userRequestorId) + resultVar0, resultVar1 := a.app.AddUserToTeam(teamID, userID, userRequestorId) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -479,7 +479,7 @@ func (a *OpenTracingAppLayer) AddUserToTeam(teamId string, userId string, userRe return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) AddUserToTeamByInviteId(inviteId string, userId string) (*model.Team, *model.AppError) { +func (a *OpenTracingAppLayer) AddUserToTeamByInviteId(inviteId string, userID string) (*model.Team, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddUserToTeamByInviteId") @@ -491,7 +491,7 @@ func (a *OpenTracingAppLayer) AddUserToTeamByInviteId(inviteId string, userId st }() defer span.Finish() - resultVar0, resultVar1 := a.app.AddUserToTeamByInviteId(inviteId, userId) + resultVar0, resultVar1 := a.app.AddUserToTeamByInviteId(inviteId, userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -501,7 +501,7 @@ func (a *OpenTracingAppLayer) AddUserToTeamByInviteId(inviteId string, userId st return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) AddUserToTeamByTeamId(teamId string, user *model.User) *model.AppError { +func (a *OpenTracingAppLayer) AddUserToTeamByTeamId(teamID string, user *model.User) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddUserToTeamByTeamId") @@ -513,7 +513,7 @@ func (a *OpenTracingAppLayer) AddUserToTeamByTeamId(teamId string, user *model.U }() defer span.Finish() - resultVar0 := a.app.AddUserToTeamByTeamId(teamId, user) + resultVar0 := a.app.AddUserToTeamByTeamId(teamID, user) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -523,7 +523,7 @@ func (a *OpenTracingAppLayer) AddUserToTeamByTeamId(teamId string, user *model.U return resultVar0 } -func (a *OpenTracingAppLayer) AddUserToTeamByToken(userId string, tokenId string) (*model.Team, *model.AppError) { +func (a *OpenTracingAppLayer) AddUserToTeamByToken(userID string, tokenID string) (*model.Team, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddUserToTeamByToken") @@ -535,7 +535,7 @@ func (a *OpenTracingAppLayer) AddUserToTeamByToken(userId string, tokenId string }() defer span.Finish() - resultVar0, resultVar1 := a.app.AddUserToTeamByToken(userId, tokenId) + resultVar0, resultVar1 := a.app.AddUserToTeamByToken(userID, tokenID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -567,7 +567,7 @@ func (a *OpenTracingAppLayer) AdjustImage(file io.Reader) (*bytes.Buffer, *model return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) AllowOAuthAppAccessToUser(userId string, authRequest *model.AuthorizeRequest) (string, *model.AppError) { +func (a *OpenTracingAppLayer) AllowOAuthAppAccessToUser(userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AllowOAuthAppAccessToUser") @@ -579,7 +579,7 @@ func (a *OpenTracingAppLayer) AllowOAuthAppAccessToUser(userId string, authReque }() defer span.Finish() - resultVar0, resultVar1 := a.app.AllowOAuthAppAccessToUser(userId, authRequest) + resultVar0, resultVar1 := a.app.AllowOAuthAppAccessToUser(userID, authRequest) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -709,7 +709,7 @@ func (a *OpenTracingAppLayer) AuthorizeOAuthUser(w http.ResponseWriter, r *http. return resultVar0, resultVar1, resultVar2, resultVar3, resultVar4 } -func (a *OpenTracingAppLayer) AutocompleteChannels(teamId string, term string) (*model.ChannelList, *model.AppError) { +func (a *OpenTracingAppLayer) AutocompleteChannels(teamID string, term string) (*model.ChannelList, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AutocompleteChannels") @@ -721,7 +721,7 @@ func (a *OpenTracingAppLayer) AutocompleteChannels(teamId string, term string) ( }() defer span.Finish() - resultVar0, resultVar1 := a.app.AutocompleteChannels(teamId, term) + resultVar0, resultVar1 := a.app.AutocompleteChannels(teamID, term) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -731,7 +731,7 @@ func (a *OpenTracingAppLayer) AutocompleteChannels(teamId string, term string) ( return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) AutocompleteChannelsForSearch(teamId string, userId string, term string) (*model.ChannelList, *model.AppError) { +func (a *OpenTracingAppLayer) AutocompleteChannelsForSearch(teamID string, userID string, term string) (*model.ChannelList, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AutocompleteChannelsForSearch") @@ -743,7 +743,7 @@ func (a *OpenTracingAppLayer) AutocompleteChannelsForSearch(teamId string, userI }() defer span.Finish() - resultVar0, resultVar1 := a.app.AutocompleteChannelsForSearch(teamId, userId, term) + resultVar0, resultVar1 := a.app.AutocompleteChannelsForSearch(teamID, userID, term) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -753,7 +753,7 @@ func (a *OpenTracingAppLayer) AutocompleteChannelsForSearch(teamId string, userI return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) AutocompleteUsersInChannel(teamId string, channelId string, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInChannel, *model.AppError) { +func (a *OpenTracingAppLayer) AutocompleteUsersInChannel(teamID string, channelId string, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInChannel, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AutocompleteUsersInChannel") @@ -765,7 +765,7 @@ func (a *OpenTracingAppLayer) AutocompleteUsersInChannel(teamId string, channelI }() defer span.Finish() - resultVar0, resultVar1 := a.app.AutocompleteUsersInChannel(teamId, channelId, term, options) + resultVar0, resultVar1 := a.app.AutocompleteUsersInChannel(teamID, channelId, term, options) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -775,7 +775,7 @@ func (a *OpenTracingAppLayer) AutocompleteUsersInChannel(teamId string, channelI return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) AutocompleteUsersInTeam(teamId string, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInTeam, *model.AppError) { +func (a *OpenTracingAppLayer) AutocompleteUsersInTeam(teamID string, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInTeam, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AutocompleteUsersInTeam") @@ -787,7 +787,7 @@ func (a *OpenTracingAppLayer) AutocompleteUsersInTeam(teamId string, term string }() defer span.Finish() - resultVar0, resultVar1 := a.app.AutocompleteUsersInTeam(teamId, term, options) + resultVar0, resultVar1 := a.app.AutocompleteUsersInTeam(teamID, term, options) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -1292,7 +1292,7 @@ func (a *OpenTracingAppLayer) ClearSessionCacheForAllUsersSkipClusterSend() { a.app.ClearSessionCacheForAllUsersSkipClusterSend() } -func (a *OpenTracingAppLayer) ClearSessionCacheForUser(userId string) { +func (a *OpenTracingAppLayer) ClearSessionCacheForUser(userID string) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClearSessionCacheForUser") @@ -1304,10 +1304,10 @@ func (a *OpenTracingAppLayer) ClearSessionCacheForUser(userId string) { }() defer span.Finish() - a.app.ClearSessionCacheForUser(userId) + a.app.ClearSessionCacheForUser(userID) } -func (a *OpenTracingAppLayer) ClearSessionCacheForUserSkipClusterSend(userId string) { +func (a *OpenTracingAppLayer) ClearSessionCacheForUserSkipClusterSend(userID string) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClearSessionCacheForUserSkipClusterSend") @@ -1319,7 +1319,7 @@ func (a *OpenTracingAppLayer) ClearSessionCacheForUserSkipClusterSend(userId str }() defer span.Finish() - a.app.ClearSessionCacheForUserSkipClusterSend(userId) + a.app.ClearSessionCacheForUserSkipClusterSend(userID) } func (a *OpenTracingAppLayer) ClearTeamMembersCache(teamID string) { @@ -1449,7 +1449,7 @@ func (a *OpenTracingAppLayer) CompareAndSetPluginKey(pluginId string, key string return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) CompleteOAuth(service string, body io.ReadCloser, teamId string, props map[string]string, tokenUser *model.User) (*model.User, *model.AppError) { +func (a *OpenTracingAppLayer) CompleteOAuth(service string, body io.ReadCloser, teamID string, props map[string]string, tokenUser *model.User) (*model.User, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CompleteOAuth") @@ -1461,7 +1461,7 @@ func (a *OpenTracingAppLayer) CompleteOAuth(service string, body io.ReadCloser, }() defer span.Finish() - resultVar0, resultVar1 := a.app.CompleteOAuth(service, body, teamId, props, tokenUser) + resultVar0, resultVar1 := a.app.CompleteOAuth(service, body, teamID, props, tokenUser) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -1554,7 +1554,7 @@ func (a *OpenTracingAppLayer) ConvertUserToBot(user *model.User) (*model.Bot, *m return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) CopyFileInfos(userId string, fileIds []string) ([]string, *model.AppError) { +func (a *OpenTracingAppLayer) CopyFileInfos(userID string, fileIds []string) ([]string, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CopyFileInfos") @@ -1566,7 +1566,7 @@ func (a *OpenTracingAppLayer) CopyFileInfos(userId string, fileIds []string) ([] }() defer span.Finish() - resultVar0, resultVar1 := a.app.CopyFileInfos(userId, fileIds) + resultVar0, resultVar1 := a.app.CopyFileInfos(userID, fileIds) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -1642,7 +1642,7 @@ func (a *OpenTracingAppLayer) CreateChannelScheme(channel *model.Channel) (*mode return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) CreateChannelWithUser(channel *model.Channel, userId string) (*model.Channel, *model.AppError) { +func (a *OpenTracingAppLayer) CreateChannelWithUser(channel *model.Channel, userID string) (*model.Channel, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateChannelWithUser") @@ -1654,7 +1654,7 @@ func (a *OpenTracingAppLayer) CreateChannelWithUser(channel *model.Channel, user }() defer span.Finish() - resultVar0, resultVar1 := a.app.CreateChannelWithUser(channel, userId) + resultVar0, resultVar1 := a.app.CreateChannelWithUser(channel, userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -1686,7 +1686,7 @@ func (a *OpenTracingAppLayer) CreateCommand(cmd *model.Command) (*model.Command, return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) CreateCommandPost(post *model.Post, teamId string, response *model.CommandResponse, skipSlackParsing bool) (*model.Post, *model.AppError) { +func (a *OpenTracingAppLayer) CreateCommandPost(post *model.Post, teamID string, response *model.CommandResponse, skipSlackParsing bool) (*model.Post, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateCommandPost") @@ -1697,12 +1697,12 @@ func (a *OpenTracingAppLayer) CreateCommandPost(post *model.Post, teamId string, a.ctx = origCtx }() - span.SetTag("teamId", teamId) + span.SetTag("teamID", teamID) span.SetTag("skipSlackParsing", skipSlackParsing) defer span.Finish() - resultVar0, resultVar1 := a.app.CreateCommandPost(post, teamId, response, skipSlackParsing) + resultVar0, resultVar1 := a.app.CreateCommandPost(post, teamID, response, skipSlackParsing) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -1712,7 +1712,7 @@ func (a *OpenTracingAppLayer) CreateCommandPost(post *model.Post, teamId string, return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) CreateCommandWebhook(commandId string, args *model.CommandArgs) (*model.CommandWebhook, *model.AppError) { +func (a *OpenTracingAppLayer) CreateCommandWebhook(commandID string, args *model.CommandArgs) (*model.CommandWebhook, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateCommandWebhook") @@ -1724,7 +1724,7 @@ func (a *OpenTracingAppLayer) CreateCommandWebhook(commandId string, args *model }() defer span.Finish() - resultVar0, resultVar1 := a.app.CreateCommandWebhook(commandId, args) + resultVar0, resultVar1 := a.app.CreateCommandWebhook(commandID, args) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -1822,7 +1822,7 @@ func (a *OpenTracingAppLayer) CreateGroup(group *model.Group) (*model.Group, *mo return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) CreateGroupChannel(userIds []string, creatorId string) (*model.Channel, *model.AppError) { +func (a *OpenTracingAppLayer) CreateGroupChannel(userIDs []string, creatorId string) (*model.Channel, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateGroupChannel") @@ -1834,7 +1834,7 @@ func (a *OpenTracingAppLayer) CreateGroupChannel(userIds []string, creatorId str }() defer span.Finish() - resultVar0, resultVar1 := a.app.CreateGroupChannel(userIds, creatorId) + resultVar0, resultVar1 := a.app.CreateGroupChannel(userIDs, creatorId) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -1954,7 +1954,7 @@ func (a *OpenTracingAppLayer) CreateOAuthStateToken(extra string) (*model.Token, return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) CreateOAuthUser(service string, userData io.Reader, teamId string, tokenUser *model.User) (*model.User, *model.AppError) { +func (a *OpenTracingAppLayer) CreateOAuthUser(service string, userData io.Reader, teamID string, tokenUser *model.User) (*model.User, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateOAuthUser") @@ -1966,7 +1966,7 @@ func (a *OpenTracingAppLayer) CreateOAuthUser(service string, userData io.Reader }() defer span.Finish() - resultVar0, resultVar1 := a.app.CreateOAuthUser(service, userData, teamId, tokenUser) + resultVar0, resultVar1 := a.app.CreateOAuthUser(service, userData, teamID, tokenUser) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -1998,7 +1998,7 @@ func (a *OpenTracingAppLayer) CreateOutgoingWebhook(hook *model.OutgoingWebhook) return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) CreatePasswordRecoveryToken(userId string, email string) (*model.Token, *model.AppError) { +func (a *OpenTracingAppLayer) CreatePasswordRecoveryToken(userID string, email string) (*model.Token, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreatePasswordRecoveryToken") @@ -2010,7 +2010,7 @@ func (a *OpenTracingAppLayer) CreatePasswordRecoveryToken(userId string, email s }() defer span.Finish() - resultVar0, resultVar1 := a.app.CreatePasswordRecoveryToken(userId, email) + resultVar0, resultVar1 := a.app.CreatePasswordRecoveryToken(userID, email) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -2152,7 +2152,7 @@ func (a *OpenTracingAppLayer) CreateSession(session *model.Session) (*model.Sess return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) CreateSidebarCategory(userId string, teamId string, newCategory *model.SidebarCategoryWithChannels) (*model.SidebarCategoryWithChannels, *model.AppError) { +func (a *OpenTracingAppLayer) CreateSidebarCategory(userID string, teamID string, newCategory *model.SidebarCategoryWithChannels) (*model.SidebarCategoryWithChannels, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateSidebarCategory") @@ -2164,7 +2164,7 @@ func (a *OpenTracingAppLayer) CreateSidebarCategory(userId string, teamId string }() defer span.Finish() - resultVar0, resultVar1 := a.app.CreateSidebarCategory(userId, teamId, newCategory) + resultVar0, resultVar1 := a.app.CreateSidebarCategory(userID, teamID, newCategory) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -2196,7 +2196,7 @@ func (a *OpenTracingAppLayer) CreateTeam(team *model.Team) (*model.Team, *model. return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) CreateTeamWithUser(team *model.Team, userId string) (*model.Team, *model.AppError) { +func (a *OpenTracingAppLayer) CreateTeamWithUser(team *model.Team, userID string) (*model.Team, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateTeamWithUser") @@ -2208,7 +2208,7 @@ func (a *OpenTracingAppLayer) CreateTeamWithUser(team *model.Team, userId string }() defer span.Finish() - resultVar0, resultVar1 := a.app.CreateTeamWithUser(team, userId) + resultVar0, resultVar1 := a.app.CreateTeamWithUser(team, userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -2218,7 +2218,7 @@ func (a *OpenTracingAppLayer) CreateTeamWithUser(team *model.Team, userId string return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) CreateTermsOfService(text string, userId string) (*model.TermsOfService, *model.AppError) { +func (a *OpenTracingAppLayer) CreateTermsOfService(text string, userID string) (*model.TermsOfService, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateTermsOfService") @@ -2230,7 +2230,7 @@ func (a *OpenTracingAppLayer) CreateTermsOfService(text string, userId string) ( }() defer span.Finish() - resultVar0, resultVar1 := a.app.CreateTermsOfService(text, userId) + resultVar0, resultVar1 := a.app.CreateTermsOfService(text, userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -2394,7 +2394,7 @@ func (a *OpenTracingAppLayer) CreateUserWithToken(user *model.User, token *model return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) CreateWebhookPost(userId string, channel *model.Channel, text string, overrideUsername string, overrideIconUrl string, overrideIconEmoji string, props model.StringInterface, postType string, postRootId string) (*model.Post, *model.AppError) { +func (a *OpenTracingAppLayer) CreateWebhookPost(userID string, channel *model.Channel, text string, overrideUsername string, overrideIconURL string, overrideIconEmoji string, props model.StringInterface, postType string, postRootId string) (*model.Post, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateWebhookPost") @@ -2406,7 +2406,7 @@ func (a *OpenTracingAppLayer) CreateWebhookPost(userId string, channel *model.Ch }() defer span.Finish() - resultVar0, resultVar1 := a.app.CreateWebhookPost(userId, channel, text, overrideUsername, overrideIconUrl, overrideIconEmoji, props, postType, postRootId) + resultVar0, resultVar1 := a.app.CreateWebhookPost(userID, channel, text, overrideUsername, overrideIconURL, overrideIconEmoji, props, postType, postRootId) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -2504,7 +2504,7 @@ func (a *OpenTracingAppLayer) DeactivateGuests() *model.AppError { return resultVar0 } -func (a *OpenTracingAppLayer) DeactivateMfa(userId string) *model.AppError { +func (a *OpenTracingAppLayer) DeactivateMfa(userID string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeactivateMfa") @@ -2516,7 +2516,7 @@ func (a *OpenTracingAppLayer) DeactivateMfa(userId string) *model.AppError { }() defer span.Finish() - resultVar0 := a.app.DeactivateMfa(userId) + resultVar0 := a.app.DeactivateMfa(userID) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -2526,7 +2526,7 @@ func (a *OpenTracingAppLayer) DeactivateMfa(userId string) *model.AppError { return resultVar0 } -func (a *OpenTracingAppLayer) DeauthorizeOAuthAppForUser(userId string, appId string) *model.AppError { +func (a *OpenTracingAppLayer) DeauthorizeOAuthAppForUser(userID string, appId string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeauthorizeOAuthAppForUser") @@ -2538,7 +2538,7 @@ func (a *OpenTracingAppLayer) DeauthorizeOAuthAppForUser(userId string, appId st }() defer span.Finish() - resultVar0 := a.app.DeauthorizeOAuthAppForUser(userId, appId) + resultVar0 := a.app.DeauthorizeOAuthAppForUser(userID, appId) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -2653,7 +2653,7 @@ func (a *OpenTracingAppLayer) DeleteBrandImage() *model.AppError { return resultVar0 } -func (a *OpenTracingAppLayer) DeleteChannel(channel *model.Channel, userId string) *model.AppError { +func (a *OpenTracingAppLayer) DeleteChannel(channel *model.Channel, userID string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteChannel") @@ -2665,7 +2665,7 @@ func (a *OpenTracingAppLayer) DeleteChannel(channel *model.Channel, userId strin }() defer span.Finish() - resultVar0 := a.app.DeleteChannel(channel, userId) + resultVar0 := a.app.DeleteChannel(channel, userID) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -2697,7 +2697,7 @@ func (a *OpenTracingAppLayer) DeleteChannelScheme(channel *model.Channel) (*mode return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) DeleteCommand(commandId string) *model.AppError { +func (a *OpenTracingAppLayer) DeleteCommand(commandID string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteCommand") @@ -2709,7 +2709,7 @@ func (a *OpenTracingAppLayer) DeleteCommand(commandId string) *model.AppError { }() defer span.Finish() - resultVar0 := a.app.DeleteCommand(commandId) + resultVar0 := a.app.DeleteCommand(commandID) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -2741,7 +2741,7 @@ func (a *OpenTracingAppLayer) DeleteEmoji(emoji *model.Emoji) *model.AppError { return resultVar0 } -func (a *OpenTracingAppLayer) DeleteEphemeralPost(userId string, postId string) { +func (a *OpenTracingAppLayer) DeleteEphemeralPost(userID string, postId string) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteEphemeralPost") @@ -2753,7 +2753,7 @@ func (a *OpenTracingAppLayer) DeleteEphemeralPost(userId string, postId string) }() defer span.Finish() - a.app.DeleteEphemeralPost(userId, postId) + a.app.DeleteEphemeralPost(userID, postId) } func (a *OpenTracingAppLayer) DeleteFlaggedPosts(postId string) { @@ -2859,7 +2859,7 @@ func (a *OpenTracingAppLayer) DeleteGroupSyncable(groupID string, syncableID str return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) DeleteIncomingWebhook(hookId string) *model.AppError { +func (a *OpenTracingAppLayer) DeleteIncomingWebhook(hookID string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteIncomingWebhook") @@ -2871,7 +2871,7 @@ func (a *OpenTracingAppLayer) DeleteIncomingWebhook(hookId string) *model.AppErr }() defer span.Finish() - resultVar0 := a.app.DeleteIncomingWebhook(hookId) + resultVar0 := a.app.DeleteIncomingWebhook(hookID) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -2903,7 +2903,7 @@ func (a *OpenTracingAppLayer) DeleteOAuthApp(appId string) *model.AppError { return resultVar0 } -func (a *OpenTracingAppLayer) DeleteOutgoingWebhook(hookId string) *model.AppError { +func (a *OpenTracingAppLayer) DeleteOutgoingWebhook(hookID string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteOutgoingWebhook") @@ -2915,7 +2915,7 @@ func (a *OpenTracingAppLayer) DeleteOutgoingWebhook(hookId string) *model.AppErr }() defer span.Finish() - resultVar0 := a.app.DeleteOutgoingWebhook(hookId) + resultVar0 := a.app.DeleteOutgoingWebhook(hookID) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -2984,7 +2984,7 @@ func (a *OpenTracingAppLayer) DeletePostFiles(post *model.Post) { a.app.DeletePostFiles(post) } -func (a *OpenTracingAppLayer) DeletePreferences(userId string, preferences model.Preferences) *model.AppError { +func (a *OpenTracingAppLayer) DeletePreferences(userID string, preferences model.Preferences) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeletePreferences") @@ -2996,7 +2996,7 @@ func (a *OpenTracingAppLayer) DeletePreferences(userId string, preferences model }() defer span.Finish() - resultVar0 := a.app.DeletePreferences(userId, preferences) + resultVar0 := a.app.DeletePreferences(userID, preferences) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -3072,7 +3072,7 @@ func (a *OpenTracingAppLayer) DeleteScheme(schemeId string) (*model.Scheme, *mod return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) DeleteSidebarCategory(userId string, teamId string, categoryId string) *model.AppError { +func (a *OpenTracingAppLayer) DeleteSidebarCategory(userID string, teamID string, categoryId string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteSidebarCategory") @@ -3084,7 +3084,7 @@ func (a *OpenTracingAppLayer) DeleteSidebarCategory(userId string, teamId string }() defer span.Finish() - resultVar0 := a.app.DeleteSidebarCategory(userId, teamId, categoryId) + resultVar0 := a.app.DeleteSidebarCategory(userID, teamID, categoryId) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -3138,7 +3138,7 @@ func (a *OpenTracingAppLayer) DemoteUserToGuest(user *model.User) *model.AppErro return resultVar0 } -func (a *OpenTracingAppLayer) DisableAutoResponder(userId string, asAdmin bool) *model.AppError { +func (a *OpenTracingAppLayer) DisableAutoResponder(userID string, asAdmin bool) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DisableAutoResponder") @@ -3150,7 +3150,7 @@ func (a *OpenTracingAppLayer) DisableAutoResponder(userId string, asAdmin bool) }() defer span.Finish() - resultVar0 := a.app.DisableAutoResponder(userId, asAdmin) + resultVar0 := a.app.DisableAutoResponder(userID, asAdmin) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -3374,7 +3374,7 @@ func (a *OpenTracingAppLayer) DoPermissionsMigrations() error { return resultVar0 } -func (a *OpenTracingAppLayer) DoPostAction(postId string, actionId string, userId string, selectedOption string) (string, *model.AppError) { +func (a *OpenTracingAppLayer) DoPostAction(postId string, actionId string, userID string, selectedOption string) (string, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoPostAction") @@ -3386,7 +3386,7 @@ func (a *OpenTracingAppLayer) DoPostAction(postId string, actionId string, userI }() defer span.Finish() - resultVar0, resultVar1 := a.app.DoPostAction(postId, actionId, userId, selectedOption) + resultVar0, resultVar1 := a.app.DoPostAction(postId, actionId, userID, selectedOption) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -3396,7 +3396,7 @@ func (a *OpenTracingAppLayer) DoPostAction(postId string, actionId string, userI return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) DoPostActionWithCookie(postId string, actionId string, userId string, selectedOption string, cookie *model.PostActionCookie) (string, *model.AppError) { +func (a *OpenTracingAppLayer) DoPostActionWithCookie(postId string, actionId string, userID string, selectedOption string, cookie *model.PostActionCookie) (string, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoPostActionWithCookie") @@ -3408,7 +3408,7 @@ func (a *OpenTracingAppLayer) DoPostActionWithCookie(postId string, actionId str }() defer span.Finish() - resultVar0, resultVar1 := a.app.DoPostActionWithCookie(postId, actionId, userId, selectedOption, cookie) + resultVar0, resultVar1 := a.app.DoPostActionWithCookie(postId, actionId, userID, selectedOption, cookie) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -3843,7 +3843,7 @@ func (a *OpenTracingAppLayer) FillInPostProps(post *model.Post, channel *model.C return resultVar0 } -func (a *OpenTracingAppLayer) FilterNonGroupChannelMembers(userIds []string, channel *model.Channel) ([]string, error) { +func (a *OpenTracingAppLayer) FilterNonGroupChannelMembers(userIDs []string, channel *model.Channel) ([]string, error) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FilterNonGroupChannelMembers") @@ -3855,7 +3855,7 @@ func (a *OpenTracingAppLayer) FilterNonGroupChannelMembers(userIds []string, cha }() defer span.Finish() - resultVar0, resultVar1 := a.app.FilterNonGroupChannelMembers(userIds, channel) + resultVar0, resultVar1 := a.app.FilterNonGroupChannelMembers(userIDs, channel) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -3865,7 +3865,7 @@ func (a *OpenTracingAppLayer) FilterNonGroupChannelMembers(userIds []string, cha return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) FilterNonGroupTeamMembers(userIds []string, team *model.Team) ([]string, error) { +func (a *OpenTracingAppLayer) FilterNonGroupTeamMembers(userIDs []string, team *model.Team) ([]string, error) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FilterNonGroupTeamMembers") @@ -3877,7 +3877,7 @@ func (a *OpenTracingAppLayer) FilterNonGroupTeamMembers(userIds []string, team * }() defer span.Finish() - resultVar0, resultVar1 := a.app.FilterNonGroupTeamMembers(userIds, team) + resultVar0, resultVar1 := a.app.FilterNonGroupTeamMembers(userIDs, team) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -3926,7 +3926,7 @@ func (a *OpenTracingAppLayer) FindTeamByName(name string) bool { return resultVar0 } -func (a *OpenTracingAppLayer) GenerateMfaSecret(userId string) (*model.MfaSecret, *model.AppError) { +func (a *OpenTracingAppLayer) GenerateMfaSecret(userID string) (*model.MfaSecret, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GenerateMfaSecret") @@ -3938,7 +3938,7 @@ func (a *OpenTracingAppLayer) GenerateMfaSecret(userId string) (*model.MfaSecret }() defer span.Finish() - resultVar0, resultVar1 := a.app.GenerateMfaSecret(userId) + resultVar0, resultVar1 := a.app.GenerateMfaSecret(userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -4307,7 +4307,7 @@ func (a *OpenTracingAppLayer) GetAllTeamsPageWithCount(offset int, limit int) (* return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetAnalytics(name string, teamId string) (model.AnalyticsRows, *model.AppError) { +func (a *OpenTracingAppLayer) GetAnalytics(name string, teamID string) (model.AnalyticsRows, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAnalytics") @@ -4319,7 +4319,7 @@ func (a *OpenTracingAppLayer) GetAnalytics(name string, teamId string) (model.An }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetAnalytics(name, teamId) + resultVar0, resultVar1 := a.app.GetAnalytics(name, teamID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -4329,7 +4329,7 @@ func (a *OpenTracingAppLayer) GetAnalytics(name string, teamId string) (model.An return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetAudits(userId string, limit int) (model.Audits, *model.AppError) { +func (a *OpenTracingAppLayer) GetAudits(userID string, limit int) (model.Audits, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAudits") @@ -4341,7 +4341,7 @@ func (a *OpenTracingAppLayer) GetAudits(userId string, limit int) (model.Audits, }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetAudits(userId, limit) + resultVar0, resultVar1 := a.app.GetAudits(userID, limit) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -4351,7 +4351,7 @@ func (a *OpenTracingAppLayer) GetAudits(userId string, limit int) (model.Audits, return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetAuditsPage(userId string, page int, perPage int) (model.Audits, *model.AppError) { +func (a *OpenTracingAppLayer) GetAuditsPage(userID string, page int, perPage int) (model.Audits, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAuditsPage") @@ -4363,7 +4363,7 @@ func (a *OpenTracingAppLayer) GetAuditsPage(userId string, page int, perPage int }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetAuditsPage(userId, page, perPage) + resultVar0, resultVar1 := a.app.GetAuditsPage(userID, page, perPage) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -4395,7 +4395,7 @@ func (a *OpenTracingAppLayer) GetAuthorizationCode(w http.ResponseWriter, r *htt return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetAuthorizedAppsForUser(userId string, page int, perPage int) ([]*model.OAuthApp, *model.AppError) { +func (a *OpenTracingAppLayer) GetAuthorizedAppsForUser(userID string, page int, perPage int) ([]*model.OAuthApp, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAuthorizedAppsForUser") @@ -4407,7 +4407,7 @@ func (a *OpenTracingAppLayer) GetAuthorizedAppsForUser(userId string, page int, }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetAuthorizedAppsForUser(userId, page, perPage) + resultVar0, resultVar1 := a.app.GetAuthorizedAppsForUser(userID, page, perPage) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -4549,7 +4549,7 @@ func (a *OpenTracingAppLayer) GetChannel(channelId string) (*model.Channel, *mod return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetChannelByName(channelName string, teamId string, includeDeleted bool) (*model.Channel, *model.AppError) { +func (a *OpenTracingAppLayer) GetChannelByName(channelName string, teamID string, includeDeleted bool) (*model.Channel, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelByName") @@ -4561,7 +4561,7 @@ func (a *OpenTracingAppLayer) GetChannelByName(channelName string, teamId string }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetChannelByName(channelName, teamId, includeDeleted) + resultVar0, resultVar1 := a.app.GetChannelByName(channelName, teamID, includeDeleted) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -4593,7 +4593,7 @@ func (a *OpenTracingAppLayer) GetChannelByNameForTeamName(channelName string, te return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetChannelCounts(teamId string, userId string) (*model.ChannelCounts, *model.AppError) { +func (a *OpenTracingAppLayer) GetChannelCounts(teamID string, userID string) (*model.ChannelCounts, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelCounts") @@ -4605,7 +4605,7 @@ func (a *OpenTracingAppLayer) GetChannelCounts(teamId string, userId string) (*m }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetChannelCounts(teamId, userId) + resultVar0, resultVar1 := a.app.GetChannelCounts(teamID, userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -4659,7 +4659,7 @@ func (a *OpenTracingAppLayer) GetChannelGuestCount(channelId string) (int64, *mo return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetChannelMember(channelId string, userId string) (*model.ChannelMember, *model.AppError) { +func (a *OpenTracingAppLayer) GetChannelMember(channelId string, userID string) (*model.ChannelMember, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelMember") @@ -4671,7 +4671,7 @@ func (a *OpenTracingAppLayer) GetChannelMember(channelId string, userId string) }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetChannelMember(channelId, userId) + resultVar0, resultVar1 := a.app.GetChannelMember(channelId, userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -4703,7 +4703,7 @@ func (a *OpenTracingAppLayer) GetChannelMemberCount(channelId string) (int64, *m return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetChannelMembersByIds(channelId string, userIds []string) (*model.ChannelMembers, *model.AppError) { +func (a *OpenTracingAppLayer) GetChannelMembersByIds(channelId string, userIDs []string) (*model.ChannelMembers, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelMembersByIds") @@ -4715,7 +4715,7 @@ func (a *OpenTracingAppLayer) GetChannelMembersByIds(channelId string, userIds [ }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetChannelMembersByIds(channelId, userIds) + resultVar0, resultVar1 := a.app.GetChannelMembersByIds(channelId, userIDs) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -4725,7 +4725,7 @@ func (a *OpenTracingAppLayer) GetChannelMembersByIds(channelId string, userIds [ return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetChannelMembersForUser(teamId string, userId string) (*model.ChannelMembers, *model.AppError) { +func (a *OpenTracingAppLayer) GetChannelMembersForUser(teamID string, userID string) (*model.ChannelMembers, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelMembersForUser") @@ -4737,7 +4737,7 @@ func (a *OpenTracingAppLayer) GetChannelMembersForUser(teamId string, userId str }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetChannelMembersForUser(teamId, userId) + resultVar0, resultVar1 := a.app.GetChannelMembersForUser(teamID, userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -4747,7 +4747,7 @@ func (a *OpenTracingAppLayer) GetChannelMembersForUser(teamId string, userId str return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetChannelMembersForUserWithPagination(teamId string, userId string, page int, perPage int) ([]*model.ChannelMember, *model.AppError) { +func (a *OpenTracingAppLayer) GetChannelMembersForUserWithPagination(teamID string, userID string, page int, perPage int) ([]*model.ChannelMember, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelMembersForUserWithPagination") @@ -4759,7 +4759,7 @@ func (a *OpenTracingAppLayer) GetChannelMembersForUserWithPagination(teamId stri }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetChannelMembersForUserWithPagination(teamId, userId, page, perPage) + resultVar0, resultVar1 := a.app.GetChannelMembersForUserWithPagination(teamID, userID, page, perPage) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -4857,7 +4857,7 @@ func (a *OpenTracingAppLayer) GetChannelPinnedPostCount(channelId string) (int64 return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetChannelUnread(channelId string, userId string) (*model.ChannelUnread, *model.AppError) { +func (a *OpenTracingAppLayer) GetChannelUnread(channelId string, userID string) (*model.ChannelUnread, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelUnread") @@ -4869,7 +4869,7 @@ func (a *OpenTracingAppLayer) GetChannelUnread(channelId string, userId string) }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetChannelUnread(channelId, userId) + resultVar0, resultVar1 := a.app.GetChannelUnread(channelId, userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -4879,7 +4879,7 @@ func (a *OpenTracingAppLayer) GetChannelUnread(channelId string, userId string) return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetChannelsByNames(channelNames []string, teamId string) ([]*model.Channel, *model.AppError) { +func (a *OpenTracingAppLayer) GetChannelsByNames(channelNames []string, teamID string) ([]*model.Channel, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelsByNames") @@ -4891,7 +4891,7 @@ func (a *OpenTracingAppLayer) GetChannelsByNames(channelNames []string, teamId s }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetChannelsByNames(channelNames, teamId) + resultVar0, resultVar1 := a.app.GetChannelsByNames(channelNames, teamID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -4945,7 +4945,7 @@ func (a *OpenTracingAppLayer) GetChannelsForSchemePage(scheme *model.Scheme, pag return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetChannelsForUser(teamId string, userId string, includeDeleted bool, lastDeleteAt int) (*model.ChannelList, *model.AppError) { +func (a *OpenTracingAppLayer) GetChannelsForUser(teamID string, userID string, includeDeleted bool, lastDeleteAt int) (*model.ChannelList, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelsForUser") @@ -4957,7 +4957,7 @@ func (a *OpenTracingAppLayer) GetChannelsForUser(teamId string, userId string, i }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetChannelsForUser(teamId, userId, includeDeleted, lastDeleteAt) + resultVar0, resultVar1 := a.app.GetChannelsForUser(teamID, userID, includeDeleted, lastDeleteAt) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -4967,7 +4967,7 @@ func (a *OpenTracingAppLayer) GetChannelsForUser(teamId string, userId string, i return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetChannelsUserNotIn(teamId string, userId string, offset int, limit int) (*model.ChannelList, *model.AppError) { +func (a *OpenTracingAppLayer) GetChannelsUserNotIn(teamID string, userID string, offset int, limit int) (*model.ChannelList, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelsUserNotIn") @@ -4979,7 +4979,7 @@ func (a *OpenTracingAppLayer) GetChannelsUserNotIn(teamId string, userId string, }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetChannelsUserNotIn(teamId, userId, offset, limit) + resultVar0, resultVar1 := a.app.GetChannelsUserNotIn(teamID, userID, offset, limit) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -5067,7 +5067,7 @@ func (a *OpenTracingAppLayer) GetClusterStatus() []*model.ClusterInfo { return resultVar0 } -func (a *OpenTracingAppLayer) GetCommand(commandId string) (*model.Command, *model.AppError) { +func (a *OpenTracingAppLayer) GetCommand(commandID string) (*model.Command, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetCommand") @@ -5079,7 +5079,7 @@ func (a *OpenTracingAppLayer) GetCommand(commandId string) (*model.Command, *mod }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetCommand(commandId) + resultVar0, resultVar1 := a.app.GetCommand(commandID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -5238,7 +5238,7 @@ func (a *OpenTracingAppLayer) GetDefaultProfileImage(user *model.User) ([]byte, return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetDeletedChannels(teamId string, offset int, limit int, userId string) (*model.ChannelList, *model.AppError) { +func (a *OpenTracingAppLayer) GetDeletedChannels(teamID string, offset int, limit int, userID string) (*model.ChannelList, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetDeletedChannels") @@ -5250,7 +5250,7 @@ func (a *OpenTracingAppLayer) GetDeletedChannels(teamId string, offset int, limi }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetDeletedChannels(teamId, offset, limit, userId) + resultVar0, resultVar1 := a.app.GetDeletedChannels(teamID, offset, limit, userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -5541,7 +5541,7 @@ func (a *OpenTracingAppLayer) GetFilteredUsersStats(options *model.UserCountOpti return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetFlaggedPosts(userId string, offset int, limit int) (*model.PostList, *model.AppError) { +func (a *OpenTracingAppLayer) GetFlaggedPosts(userID string, offset int, limit int) (*model.PostList, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFlaggedPosts") @@ -5553,7 +5553,7 @@ func (a *OpenTracingAppLayer) GetFlaggedPosts(userId string, offset int, limit i }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetFlaggedPosts(userId, offset, limit) + resultVar0, resultVar1 := a.app.GetFlaggedPosts(userID, offset, limit) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -5563,7 +5563,7 @@ func (a *OpenTracingAppLayer) GetFlaggedPosts(userId string, offset int, limit i return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetFlaggedPostsForChannel(userId string, channelId string, offset int, limit int) (*model.PostList, *model.AppError) { +func (a *OpenTracingAppLayer) GetFlaggedPostsForChannel(userID string, channelId string, offset int, limit int) (*model.PostList, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFlaggedPostsForChannel") @@ -5575,7 +5575,7 @@ func (a *OpenTracingAppLayer) GetFlaggedPostsForChannel(userId string, channelId }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetFlaggedPostsForChannel(userId, channelId, offset, limit) + resultVar0, resultVar1 := a.app.GetFlaggedPostsForChannel(userID, channelId, offset, limit) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -5585,7 +5585,7 @@ func (a *OpenTracingAppLayer) GetFlaggedPostsForChannel(userId string, channelId return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetFlaggedPostsForTeam(userId string, teamId string, offset int, limit int) (*model.PostList, *model.AppError) { +func (a *OpenTracingAppLayer) GetFlaggedPostsForTeam(userID string, teamID string, offset int, limit int) (*model.PostList, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFlaggedPostsForTeam") @@ -5597,7 +5597,7 @@ func (a *OpenTracingAppLayer) GetFlaggedPostsForTeam(userId string, teamId strin }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetFlaggedPostsForTeam(userId, teamId, offset, limit) + resultVar0, resultVar1 := a.app.GetFlaggedPostsForTeam(userID, teamID, offset, limit) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -5673,7 +5673,7 @@ func (a *OpenTracingAppLayer) GetGroupByRemoteID(remoteID string, groupSource mo return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetGroupChannel(userIds []string) (*model.Channel, *model.AppError) { +func (a *OpenTracingAppLayer) GetGroupChannel(userIDs []string) (*model.Channel, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupChannel") @@ -5685,7 +5685,7 @@ func (a *OpenTracingAppLayer) GetGroupChannel(userIds []string) (*model.Channel, }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetGroupChannel(userIds) + resultVar0, resultVar1 := a.app.GetGroupChannel(userIDs) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -5827,7 +5827,7 @@ func (a *OpenTracingAppLayer) GetGroups(page int, perPage int, opts model.GroupS return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetGroupsAssociatedToChannelsByTeam(teamId string, opts model.GroupSearchOpts) (map[string][]*model.GroupWithSchemeAdmin, *model.AppError) { +func (a *OpenTracingAppLayer) GetGroupsAssociatedToChannelsByTeam(teamID string, opts model.GroupSearchOpts) (map[string][]*model.GroupWithSchemeAdmin, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupsAssociatedToChannelsByTeam") @@ -5839,7 +5839,7 @@ func (a *OpenTracingAppLayer) GetGroupsAssociatedToChannelsByTeam(teamId string, }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetGroupsAssociatedToChannelsByTeam(teamId, opts) + resultVar0, resultVar1 := a.app.GetGroupsAssociatedToChannelsByTeam(teamID, opts) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -5915,7 +5915,7 @@ func (a *OpenTracingAppLayer) GetGroupsBySource(groupSource model.GroupSource) ( return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetGroupsByTeam(teamId string, opts model.GroupSearchOpts) ([]*model.GroupWithSchemeAdmin, int, *model.AppError) { +func (a *OpenTracingAppLayer) GetGroupsByTeam(teamID string, opts model.GroupSearchOpts) ([]*model.GroupWithSchemeAdmin, int, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupsByTeam") @@ -5927,7 +5927,7 @@ func (a *OpenTracingAppLayer) GetGroupsByTeam(teamId string, opts model.GroupSea }() defer span.Finish() - resultVar0, resultVar1, resultVar2 := a.app.GetGroupsByTeam(teamId, opts) + resultVar0, resultVar1, resultVar2 := a.app.GetGroupsByTeam(teamID, opts) if resultVar2 != nil { span.LogFields(spanlog.Error(resultVar2)) @@ -5937,7 +5937,7 @@ func (a *OpenTracingAppLayer) GetGroupsByTeam(teamId string, opts model.GroupSea return resultVar0, resultVar1, resultVar2 } -func (a *OpenTracingAppLayer) GetGroupsByUserId(userId string) ([]*model.Group, *model.AppError) { +func (a *OpenTracingAppLayer) GetGroupsByUserId(userID string) ([]*model.Group, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupsByUserId") @@ -5949,7 +5949,7 @@ func (a *OpenTracingAppLayer) GetGroupsByUserId(userId string) ([]*model.Group, }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetGroupsByUserId(userId) + resultVar0, resultVar1 := a.app.GetGroupsByUserId(userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -5959,7 +5959,7 @@ func (a *OpenTracingAppLayer) GetGroupsByUserId(userId string) ([]*model.Group, return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetHubForUserId(userId string) *app.Hub { +func (a *OpenTracingAppLayer) GetHubForUserId(userID string) *app.Hub { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetHubForUserId") @@ -5971,12 +5971,12 @@ func (a *OpenTracingAppLayer) GetHubForUserId(userId string) *app.Hub { }() defer span.Finish() - resultVar0 := a.app.GetHubForUserId(userId) + resultVar0 := a.app.GetHubForUserId(userID) return resultVar0 } -func (a *OpenTracingAppLayer) GetIncomingWebhook(hookId string) (*model.IncomingWebhook, *model.AppError) { +func (a *OpenTracingAppLayer) GetIncomingWebhook(hookID string) (*model.IncomingWebhook, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetIncomingWebhook") @@ -5988,7 +5988,7 @@ func (a *OpenTracingAppLayer) GetIncomingWebhook(hookId string) (*model.Incoming }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetIncomingWebhook(hookId) + resultVar0, resultVar1 := a.app.GetIncomingWebhook(hookID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -5998,7 +5998,7 @@ func (a *OpenTracingAppLayer) GetIncomingWebhook(hookId string) (*model.Incoming return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetIncomingWebhooksForTeamPage(teamId string, page int, perPage int) ([]*model.IncomingWebhook, *model.AppError) { +func (a *OpenTracingAppLayer) GetIncomingWebhooksForTeamPage(teamID string, page int, perPage int) ([]*model.IncomingWebhook, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetIncomingWebhooksForTeamPage") @@ -6010,7 +6010,7 @@ func (a *OpenTracingAppLayer) GetIncomingWebhooksForTeamPage(teamId string, page }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetIncomingWebhooksForTeamPage(teamId, page, perPage) + resultVar0, resultVar1 := a.app.GetIncomingWebhooksForTeamPage(teamID, page, perPage) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -6020,7 +6020,7 @@ func (a *OpenTracingAppLayer) GetIncomingWebhooksForTeamPage(teamId string, page return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetIncomingWebhooksForTeamPageByUser(teamId string, userId string, page int, perPage int) ([]*model.IncomingWebhook, *model.AppError) { +func (a *OpenTracingAppLayer) GetIncomingWebhooksForTeamPageByUser(teamID string, userID string, page int, perPage int) ([]*model.IncomingWebhook, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetIncomingWebhooksForTeamPageByUser") @@ -6032,7 +6032,7 @@ func (a *OpenTracingAppLayer) GetIncomingWebhooksForTeamPageByUser(teamId string }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetIncomingWebhooksForTeamPageByUser(teamId, userId, page, perPage) + resultVar0, resultVar1 := a.app.GetIncomingWebhooksForTeamPageByUser(teamID, userID, page, perPage) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -6064,7 +6064,7 @@ func (a *OpenTracingAppLayer) GetIncomingWebhooksPage(page int, perPage int) ([] return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetIncomingWebhooksPageByUser(userId string, page int, perPage int) ([]*model.IncomingWebhook, *model.AppError) { +func (a *OpenTracingAppLayer) GetIncomingWebhooksPageByUser(userID string, page int, perPage int) ([]*model.IncomingWebhook, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetIncomingWebhooksPageByUser") @@ -6076,7 +6076,7 @@ func (a *OpenTracingAppLayer) GetIncomingWebhooksPageByUser(userId string, page }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetIncomingWebhooksPageByUser(userId, page, perPage) + resultVar0, resultVar1 := a.app.GetIncomingWebhooksPageByUser(userID, page, perPage) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -6389,7 +6389,7 @@ func (a *OpenTracingAppLayer) GetMultipleEmojiByName(names []string) ([]*model.E return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetNewUsersForTeamPage(teamId string, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { +func (a *OpenTracingAppLayer) GetNewUsersForTeamPage(teamID string, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetNewUsersForTeamPage") @@ -6401,7 +6401,7 @@ func (a *OpenTracingAppLayer) GetNewUsersForTeamPage(teamId string, page int, pe }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetNewUsersForTeamPage(teamId, page, perPage, asAdmin, viewRestrictions) + resultVar0, resultVar1 := a.app.GetNewUsersForTeamPage(teamID, page, perPage, asAdmin, viewRestrictions) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -6445,7 +6445,7 @@ func (a *OpenTracingAppLayer) GetNotificationNameFormat(user *model.User) string return resultVar0 } -func (a *OpenTracingAppLayer) GetNumberOfChannelsOnTeam(teamId string) (int, *model.AppError) { +func (a *OpenTracingAppLayer) GetNumberOfChannelsOnTeam(teamID string) (int, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetNumberOfChannelsOnTeam") @@ -6457,7 +6457,7 @@ func (a *OpenTracingAppLayer) GetNumberOfChannelsOnTeam(teamId string) (int, *mo }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetNumberOfChannelsOnTeam(teamId) + resultVar0, resultVar1 := a.app.GetNumberOfChannelsOnTeam(teamID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -6489,7 +6489,7 @@ func (a *OpenTracingAppLayer) GetOAuthAccessTokenForCodeFlow(clientId string, gr return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetOAuthAccessTokenForImplicitFlow(userId string, authRequest *model.AuthorizeRequest) (*model.Session, *model.AppError) { +func (a *OpenTracingAppLayer) GetOAuthAccessTokenForImplicitFlow(userID string, authRequest *model.AuthorizeRequest) (*model.Session, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthAccessTokenForImplicitFlow") @@ -6501,7 +6501,7 @@ func (a *OpenTracingAppLayer) GetOAuthAccessTokenForImplicitFlow(userId string, }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetOAuthAccessTokenForImplicitFlow(userId, authRequest) + resultVar0, resultVar1 := a.app.GetOAuthAccessTokenForImplicitFlow(userID, authRequest) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -6555,7 +6555,7 @@ func (a *OpenTracingAppLayer) GetOAuthApps(page int, perPage int) ([]*model.OAut return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetOAuthAppsByCreator(userId string, page int, perPage int) ([]*model.OAuthApp, *model.AppError) { +func (a *OpenTracingAppLayer) GetOAuthAppsByCreator(userID string, page int, perPage int) ([]*model.OAuthApp, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthAppsByCreator") @@ -6567,7 +6567,7 @@ func (a *OpenTracingAppLayer) GetOAuthAppsByCreator(userId string, page int, per }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetOAuthAppsByCreator(userId, page, perPage) + resultVar0, resultVar1 := a.app.GetOAuthAppsByCreator(userID, page, perPage) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -6577,7 +6577,7 @@ func (a *OpenTracingAppLayer) GetOAuthAppsByCreator(userId string, page int, per return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetOAuthCodeRedirect(userId string, authRequest *model.AuthorizeRequest) (string, *model.AppError) { +func (a *OpenTracingAppLayer) GetOAuthCodeRedirect(userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthCodeRedirect") @@ -6589,7 +6589,7 @@ func (a *OpenTracingAppLayer) GetOAuthCodeRedirect(userId string, authRequest *m }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetOAuthCodeRedirect(userId, authRequest) + resultVar0, resultVar1 := a.app.GetOAuthCodeRedirect(userID, authRequest) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -6599,7 +6599,7 @@ func (a *OpenTracingAppLayer) GetOAuthCodeRedirect(userId string, authRequest *m return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetOAuthImplicitRedirect(userId string, authRequest *model.AuthorizeRequest) (string, *model.AppError) { +func (a *OpenTracingAppLayer) GetOAuthImplicitRedirect(userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthImplicitRedirect") @@ -6611,7 +6611,7 @@ func (a *OpenTracingAppLayer) GetOAuthImplicitRedirect(userId string, authReques }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetOAuthImplicitRedirect(userId, authRequest) + resultVar0, resultVar1 := a.app.GetOAuthImplicitRedirect(userID, authRequest) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -6621,7 +6621,7 @@ func (a *OpenTracingAppLayer) GetOAuthImplicitRedirect(userId string, authReques return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetOAuthLoginEndpoint(w http.ResponseWriter, r *http.Request, service string, teamId string, action string, redirectTo string, loginHint string, isMobile bool) (string, *model.AppError) { +func (a *OpenTracingAppLayer) GetOAuthLoginEndpoint(w http.ResponseWriter, r *http.Request, service string, teamID string, action string, redirectTo string, loginHint string, isMobile bool) (string, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthLoginEndpoint") @@ -6633,7 +6633,7 @@ func (a *OpenTracingAppLayer) GetOAuthLoginEndpoint(w http.ResponseWriter, r *ht }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetOAuthLoginEndpoint(w, r, service, teamId, action, redirectTo, loginHint, isMobile) + resultVar0, resultVar1 := a.app.GetOAuthLoginEndpoint(w, r, service, teamID, action, redirectTo, loginHint, isMobile) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -6643,7 +6643,7 @@ func (a *OpenTracingAppLayer) GetOAuthLoginEndpoint(w http.ResponseWriter, r *ht return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetOAuthSignupEndpoint(w http.ResponseWriter, r *http.Request, service string, teamId string) (string, *model.AppError) { +func (a *OpenTracingAppLayer) GetOAuthSignupEndpoint(w http.ResponseWriter, r *http.Request, service string, teamID string) (string, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthSignupEndpoint") @@ -6655,7 +6655,7 @@ func (a *OpenTracingAppLayer) GetOAuthSignupEndpoint(w http.ResponseWriter, r *h }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetOAuthSignupEndpoint(w, r, service, teamId) + resultVar0, resultVar1 := a.app.GetOAuthSignupEndpoint(w, r, service, teamID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -6704,7 +6704,7 @@ func (a *OpenTracingAppLayer) GetOpenGraphMetadata(requestURL string) *opengraph return resultVar0 } -func (a *OpenTracingAppLayer) GetOrCreateDirectChannel(userId string, otherUserId string) (*model.Channel, *model.AppError) { +func (a *OpenTracingAppLayer) GetOrCreateDirectChannel(userID string, otherUserId string) (*model.Channel, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOrCreateDirectChannel") @@ -6716,7 +6716,7 @@ func (a *OpenTracingAppLayer) GetOrCreateDirectChannel(userId string, otherUserI }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetOrCreateDirectChannel(userId, otherUserId) + resultVar0, resultVar1 := a.app.GetOrCreateDirectChannel(userID, otherUserId) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -6726,7 +6726,7 @@ func (a *OpenTracingAppLayer) GetOrCreateDirectChannel(userId string, otherUserI return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetOutgoingWebhook(hookId string) (*model.OutgoingWebhook, *model.AppError) { +func (a *OpenTracingAppLayer) GetOutgoingWebhook(hookID string) (*model.OutgoingWebhook, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOutgoingWebhook") @@ -6738,7 +6738,7 @@ func (a *OpenTracingAppLayer) GetOutgoingWebhook(hookId string) (*model.Outgoing }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetOutgoingWebhook(hookId) + resultVar0, resultVar1 := a.app.GetOutgoingWebhook(hookID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -6748,7 +6748,7 @@ func (a *OpenTracingAppLayer) GetOutgoingWebhook(hookId string) (*model.Outgoing return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetOutgoingWebhooksForChannelPageByUser(channelId string, userId string, page int, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { +func (a *OpenTracingAppLayer) GetOutgoingWebhooksForChannelPageByUser(channelId string, userID string, page int, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOutgoingWebhooksForChannelPageByUser") @@ -6760,7 +6760,7 @@ func (a *OpenTracingAppLayer) GetOutgoingWebhooksForChannelPageByUser(channelId }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetOutgoingWebhooksForChannelPageByUser(channelId, userId, page, perPage) + resultVar0, resultVar1 := a.app.GetOutgoingWebhooksForChannelPageByUser(channelId, userID, page, perPage) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -6770,7 +6770,7 @@ func (a *OpenTracingAppLayer) GetOutgoingWebhooksForChannelPageByUser(channelId return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetOutgoingWebhooksForTeamPage(teamId string, page int, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { +func (a *OpenTracingAppLayer) GetOutgoingWebhooksForTeamPage(teamID string, page int, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOutgoingWebhooksForTeamPage") @@ -6782,7 +6782,7 @@ func (a *OpenTracingAppLayer) GetOutgoingWebhooksForTeamPage(teamId string, page }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetOutgoingWebhooksForTeamPage(teamId, page, perPage) + resultVar0, resultVar1 := a.app.GetOutgoingWebhooksForTeamPage(teamID, page, perPage) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -6792,7 +6792,7 @@ func (a *OpenTracingAppLayer) GetOutgoingWebhooksForTeamPage(teamId string, page return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetOutgoingWebhooksForTeamPageByUser(teamId string, userId string, page int, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { +func (a *OpenTracingAppLayer) GetOutgoingWebhooksForTeamPageByUser(teamID string, userID string, page int, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOutgoingWebhooksForTeamPageByUser") @@ -6804,7 +6804,7 @@ func (a *OpenTracingAppLayer) GetOutgoingWebhooksForTeamPageByUser(teamId string }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetOutgoingWebhooksForTeamPageByUser(teamId, userId, page, perPage) + resultVar0, resultVar1 := a.app.GetOutgoingWebhooksForTeamPageByUser(teamID, userID, page, perPage) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -6836,7 +6836,7 @@ func (a *OpenTracingAppLayer) GetOutgoingWebhooksPage(page int, perPage int) ([] return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetOutgoingWebhooksPageByUser(userId string, page int, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { +func (a *OpenTracingAppLayer) GetOutgoingWebhooksPageByUser(userID string, page int, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOutgoingWebhooksPageByUser") @@ -6848,7 +6848,7 @@ func (a *OpenTracingAppLayer) GetOutgoingWebhooksPageByUser(userId string, page }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetOutgoingWebhooksPageByUser(userId, page, perPage) + resultVar0, resultVar1 := a.app.GetOutgoingWebhooksPageByUser(userID, page, perPage) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -6880,7 +6880,7 @@ func (a *OpenTracingAppLayer) GetPasswordRecoveryToken(token string) (*model.Tok return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetPermalinkPost(postId string, userId string) (*model.PostList, *model.AppError) { +func (a *OpenTracingAppLayer) GetPermalinkPost(postId string, userID string) (*model.PostList, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPermalinkPost") @@ -6892,7 +6892,7 @@ func (a *OpenTracingAppLayer) GetPermalinkPost(postId string, userId string) (*m }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetPermalinkPost(postId, userId) + resultVar0, resultVar1 := a.app.GetPermalinkPost(postId, userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -7244,7 +7244,7 @@ func (a *OpenTracingAppLayer) GetPostsEtag(channelId string, collapsedThreads bo return resultVar0 } -func (a *OpenTracingAppLayer) GetPostsForChannelAroundLastUnread(channelId string, userId string, limitBefore int, limitAfter int, skipFetchThreads bool, collapsedThreads bool, collapsedThreadsExtended bool) (*model.PostList, *model.AppError) { +func (a *OpenTracingAppLayer) GetPostsForChannelAroundLastUnread(channelId string, userID string, limitBefore int, limitAfter int, skipFetchThreads bool, collapsedThreads bool, collapsedThreadsExtended bool) (*model.PostList, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostsForChannelAroundLastUnread") @@ -7256,7 +7256,7 @@ func (a *OpenTracingAppLayer) GetPostsForChannelAroundLastUnread(channelId strin }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetPostsForChannelAroundLastUnread(channelId, userId, limitBefore, limitAfter, skipFetchThreads, collapsedThreads, collapsedThreadsExtended) + resultVar0, resultVar1 := a.app.GetPostsForChannelAroundLastUnread(channelId, userID, limitBefore, limitAfter, skipFetchThreads, collapsedThreads, collapsedThreadsExtended) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -7310,7 +7310,7 @@ func (a *OpenTracingAppLayer) GetPostsSince(options model.GetPostsSinceOptions) return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetPreferenceByCategoryAndNameForUser(userId string, category string, preferenceName string) (*model.Preference, *model.AppError) { +func (a *OpenTracingAppLayer) GetPreferenceByCategoryAndNameForUser(userID string, category string, preferenceName string) (*model.Preference, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPreferenceByCategoryAndNameForUser") @@ -7322,7 +7322,7 @@ func (a *OpenTracingAppLayer) GetPreferenceByCategoryAndNameForUser(userId strin }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetPreferenceByCategoryAndNameForUser(userId, category, preferenceName) + resultVar0, resultVar1 := a.app.GetPreferenceByCategoryAndNameForUser(userID, category, preferenceName) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -7332,7 +7332,7 @@ func (a *OpenTracingAppLayer) GetPreferenceByCategoryAndNameForUser(userId strin return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetPreferenceByCategoryForUser(userId string, category string) (model.Preferences, *model.AppError) { +func (a *OpenTracingAppLayer) GetPreferenceByCategoryForUser(userID string, category string) (model.Preferences, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPreferenceByCategoryForUser") @@ -7344,7 +7344,7 @@ func (a *OpenTracingAppLayer) GetPreferenceByCategoryForUser(userId string, cate }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetPreferenceByCategoryForUser(userId, category) + resultVar0, resultVar1 := a.app.GetPreferenceByCategoryForUser(userID, category) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -7354,7 +7354,7 @@ func (a *OpenTracingAppLayer) GetPreferenceByCategoryForUser(userId string, cate return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetPreferencesForUser(userId string) (model.Preferences, *model.AppError) { +func (a *OpenTracingAppLayer) GetPreferencesForUser(userID string) (model.Preferences, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPreferencesForUser") @@ -7366,7 +7366,7 @@ func (a *OpenTracingAppLayer) GetPreferencesForUser(userId string) (model.Prefer }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetPreferencesForUser(userId) + resultVar0, resultVar1 := a.app.GetPreferencesForUser(userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -7393,7 +7393,7 @@ func (a *OpenTracingAppLayer) GetPrevPostIdFromPostList(postList *model.PostList return resultVar0 } -func (a *OpenTracingAppLayer) GetPrivateChannelsForTeam(teamId string, offset int, limit int) (*model.ChannelList, *model.AppError) { +func (a *OpenTracingAppLayer) GetPrivateChannelsForTeam(teamID string, offset int, limit int) (*model.ChannelList, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPrivateChannelsForTeam") @@ -7405,7 +7405,7 @@ func (a *OpenTracingAppLayer) GetPrivateChannelsForTeam(teamId string, offset in }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetPrivateChannelsForTeam(teamId, offset, limit) + resultVar0, resultVar1 := a.app.GetPrivateChannelsForTeam(teamID, offset, limit) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -7415,7 +7415,7 @@ func (a *OpenTracingAppLayer) GetPrivateChannelsForTeam(teamId string, offset in return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetProductNotices(userId string, teamId string, client model.NoticeClientType, clientVersion string, locale string) (model.NoticeMessages, *model.AppError) { +func (a *OpenTracingAppLayer) GetProductNotices(userID string, teamID string, client model.NoticeClientType, clientVersion string, locale string) (model.NoticeMessages, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetProductNotices") @@ -7427,7 +7427,7 @@ func (a *OpenTracingAppLayer) GetProductNotices(userId string, teamId string, cl }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetProductNotices(userId, teamId, client, clientVersion, locale) + resultVar0, resultVar1 := a.app.GetProductNotices(userID, teamID, client, clientVersion, locale) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -7459,7 +7459,7 @@ func (a *OpenTracingAppLayer) GetProfileImage(user *model.User) ([]byte, bool, * return resultVar0, resultVar1, resultVar2 } -func (a *OpenTracingAppLayer) GetPublicChannelsByIdsForTeam(teamId string, channelIds []string) (*model.ChannelList, *model.AppError) { +func (a *OpenTracingAppLayer) GetPublicChannelsByIdsForTeam(teamID string, channelIds []string) (*model.ChannelList, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPublicChannelsByIdsForTeam") @@ -7471,7 +7471,7 @@ func (a *OpenTracingAppLayer) GetPublicChannelsByIdsForTeam(teamId string, chann }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetPublicChannelsByIdsForTeam(teamId, channelIds) + resultVar0, resultVar1 := a.app.GetPublicChannelsByIdsForTeam(teamID, channelIds) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -7481,7 +7481,7 @@ func (a *OpenTracingAppLayer) GetPublicChannelsByIdsForTeam(teamId string, chann return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetPublicChannelsForTeam(teamId string, offset int, limit int) (*model.ChannelList, *model.AppError) { +func (a *OpenTracingAppLayer) GetPublicChannelsForTeam(teamID string, offset int, limit int) (*model.ChannelList, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPublicChannelsForTeam") @@ -7493,7 +7493,7 @@ func (a *OpenTracingAppLayer) GetPublicChannelsForTeam(teamId string, offset int }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetPublicChannelsForTeam(teamId, offset, limit) + resultVar0, resultVar1 := a.app.GetPublicChannelsForTeam(teamID, offset, limit) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -7547,7 +7547,7 @@ func (a *OpenTracingAppLayer) GetReactionsForPost(postId string) ([]*model.React return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetRecentlyActiveUsersForTeam(teamId string) (map[string]*model.User, *model.AppError) { +func (a *OpenTracingAppLayer) GetRecentlyActiveUsersForTeam(teamID string) (map[string]*model.User, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRecentlyActiveUsersForTeam") @@ -7559,7 +7559,7 @@ func (a *OpenTracingAppLayer) GetRecentlyActiveUsersForTeam(teamId string) (map[ }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetRecentlyActiveUsersForTeam(teamId) + resultVar0, resultVar1 := a.app.GetRecentlyActiveUsersForTeam(teamID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -7569,7 +7569,7 @@ func (a *OpenTracingAppLayer) GetRecentlyActiveUsersForTeam(teamId string) (map[ return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetRecentlyActiveUsersForTeamPage(teamId string, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { +func (a *OpenTracingAppLayer) GetRecentlyActiveUsersForTeamPage(teamID string, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRecentlyActiveUsersForTeamPage") @@ -7581,7 +7581,7 @@ func (a *OpenTracingAppLayer) GetRecentlyActiveUsersForTeamPage(teamId string, p }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetRecentlyActiveUsersForTeamPage(teamId, page, perPage, asAdmin, viewRestrictions) + resultVar0, resultVar1 := a.app.GetRecentlyActiveUsersForTeamPage(teamID, page, perPage, asAdmin, viewRestrictions) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -7818,7 +7818,7 @@ func (a *OpenTracingAppLayer) GetSchemeRolesForChannel(channelId string) (guestR return resultVar0, resultVar1, resultVar2, resultVar3 } -func (a *OpenTracingAppLayer) GetSchemeRolesForTeam(teamId string) (string, string, string, *model.AppError) { +func (a *OpenTracingAppLayer) GetSchemeRolesForTeam(teamID string) (string, string, string, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSchemeRolesForTeam") @@ -7830,7 +7830,7 @@ func (a *OpenTracingAppLayer) GetSchemeRolesForTeam(teamId string) (string, stri }() defer span.Finish() - resultVar0, resultVar1, resultVar2, resultVar3 := a.app.GetSchemeRolesForTeam(teamId) + resultVar0, resultVar1, resultVar2, resultVar3 := a.app.GetSchemeRolesForTeam(teamID) if resultVar3 != nil { span.LogFields(spanlog.Error(resultVar3)) @@ -7945,7 +7945,7 @@ func (a *OpenTracingAppLayer) GetSessionLengthInMillis(session *model.Session) i return resultVar0 } -func (a *OpenTracingAppLayer) GetSessions(userId string) ([]*model.Session, *model.AppError) { +func (a *OpenTracingAppLayer) GetSessions(userID string) ([]*model.Session, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSessions") @@ -7957,7 +7957,7 @@ func (a *OpenTracingAppLayer) GetSessions(userId string) ([]*model.Session, *mod }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetSessions(userId) + resultVar0, resultVar1 := a.app.GetSessions(userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -7967,7 +7967,7 @@ func (a *OpenTracingAppLayer) GetSessions(userId string) ([]*model.Session, *mod return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetSidebarCategories(userId string, teamId string) (*model.OrderedSidebarCategories, *model.AppError) { +func (a *OpenTracingAppLayer) GetSidebarCategories(userID string, teamID string) (*model.OrderedSidebarCategories, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSidebarCategories") @@ -7979,7 +7979,7 @@ func (a *OpenTracingAppLayer) GetSidebarCategories(userId string, teamId string) }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetSidebarCategories(userId, teamId) + resultVar0, resultVar1 := a.app.GetSidebarCategories(userID, teamID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -8011,7 +8011,7 @@ func (a *OpenTracingAppLayer) GetSidebarCategory(categoryId string) (*model.Side return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetSidebarCategoryOrder(userId string, teamId string) ([]string, *model.AppError) { +func (a *OpenTracingAppLayer) GetSidebarCategoryOrder(userID string, teamID string) ([]string, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSidebarCategoryOrder") @@ -8023,7 +8023,7 @@ func (a *OpenTracingAppLayer) GetSidebarCategoryOrder(userId string, teamId stri }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetSidebarCategoryOrder(userId, teamId) + resultVar0, resultVar1 := a.app.GetSidebarCategoryOrder(userID, teamID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -8072,7 +8072,7 @@ func (a *OpenTracingAppLayer) GetSiteURL() string { return resultVar0 } -func (a *OpenTracingAppLayer) GetStatus(userId string) (*model.Status, *model.AppError) { +func (a *OpenTracingAppLayer) GetStatus(userID string) (*model.Status, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetStatus") @@ -8084,7 +8084,7 @@ func (a *OpenTracingAppLayer) GetStatus(userId string) (*model.Status, *model.Ap }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetStatus(userId) + resultVar0, resultVar1 := a.app.GetStatus(userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -8094,7 +8094,7 @@ func (a *OpenTracingAppLayer) GetStatus(userId string) (*model.Status, *model.Ap return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetStatusFromCache(userId string) *model.Status { +func (a *OpenTracingAppLayer) GetStatusFromCache(userID string) *model.Status { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetStatusFromCache") @@ -8106,12 +8106,12 @@ func (a *OpenTracingAppLayer) GetStatusFromCache(userId string) *model.Status { }() defer span.Finish() - resultVar0 := a.app.GetStatusFromCache(userId) + resultVar0 := a.app.GetStatusFromCache(userID) return resultVar0 } -func (a *OpenTracingAppLayer) GetStatusesByIds(userIds []string) (map[string]interface{}, *model.AppError) { +func (a *OpenTracingAppLayer) GetStatusesByIds(userIDs []string) (map[string]interface{}, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetStatusesByIds") @@ -8123,7 +8123,7 @@ func (a *OpenTracingAppLayer) GetStatusesByIds(userIds []string) (map[string]int }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetStatusesByIds(userIds) + resultVar0, resultVar1 := a.app.GetStatusesByIds(userIDs) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -8150,7 +8150,7 @@ func (a *OpenTracingAppLayer) GetSuggestions(commandArgs *model.CommandArgs, com return resultVar0 } -func (a *OpenTracingAppLayer) GetTeam(teamId string) (*model.Team, *model.AppError) { +func (a *OpenTracingAppLayer) GetTeam(teamID string) (*model.Team, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeam") @@ -8162,7 +8162,7 @@ func (a *OpenTracingAppLayer) GetTeam(teamId string) (*model.Team, *model.AppErr }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetTeam(teamId) + resultVar0, resultVar1 := a.app.GetTeam(teamID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -8282,7 +8282,7 @@ func (a *OpenTracingAppLayer) GetTeamIdFromQuery(query url.Values) (string, *mod return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetTeamMember(teamId string, userId string) (*model.TeamMember, *model.AppError) { +func (a *OpenTracingAppLayer) GetTeamMember(teamID string, userID string) (*model.TeamMember, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamMember") @@ -8294,7 +8294,7 @@ func (a *OpenTracingAppLayer) GetTeamMember(teamId string, userId string) (*mode }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetTeamMember(teamId, userId) + resultVar0, resultVar1 := a.app.GetTeamMember(teamID, userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -8304,7 +8304,7 @@ func (a *OpenTracingAppLayer) GetTeamMember(teamId string, userId string) (*mode return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetTeamMembers(teamId string, offset int, limit int, teamMembersGetOptions *model.TeamMembersGetOptions) ([]*model.TeamMember, *model.AppError) { +func (a *OpenTracingAppLayer) GetTeamMembers(teamID string, offset int, limit int, teamMembersGetOptions *model.TeamMembersGetOptions) ([]*model.TeamMember, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamMembers") @@ -8316,7 +8316,7 @@ func (a *OpenTracingAppLayer) GetTeamMembers(teamId string, offset int, limit in }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetTeamMembers(teamId, offset, limit, teamMembersGetOptions) + resultVar0, resultVar1 := a.app.GetTeamMembers(teamID, offset, limit, teamMembersGetOptions) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -8326,7 +8326,7 @@ func (a *OpenTracingAppLayer) GetTeamMembers(teamId string, offset int, limit in return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetTeamMembersByIds(teamId string, userIds []string, restrictions *model.ViewUsersRestrictions) ([]*model.TeamMember, *model.AppError) { +func (a *OpenTracingAppLayer) GetTeamMembersByIds(teamID string, userIDs []string, restrictions *model.ViewUsersRestrictions) ([]*model.TeamMember, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamMembersByIds") @@ -8338,7 +8338,7 @@ func (a *OpenTracingAppLayer) GetTeamMembersByIds(teamId string, userIds []strin }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetTeamMembersByIds(teamId, userIds, restrictions) + resultVar0, resultVar1 := a.app.GetTeamMembersByIds(teamID, userIDs, restrictions) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -8348,7 +8348,7 @@ func (a *OpenTracingAppLayer) GetTeamMembersByIds(teamId string, userIds []strin return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetTeamMembersForUser(userId string) ([]*model.TeamMember, *model.AppError) { +func (a *OpenTracingAppLayer) GetTeamMembersForUser(userID string) ([]*model.TeamMember, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamMembersForUser") @@ -8360,7 +8360,7 @@ func (a *OpenTracingAppLayer) GetTeamMembersForUser(userId string) ([]*model.Tea }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetTeamMembersForUser(userId) + resultVar0, resultVar1 := a.app.GetTeamMembersForUser(userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -8370,7 +8370,7 @@ func (a *OpenTracingAppLayer) GetTeamMembersForUser(userId string) ([]*model.Tea return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetTeamMembersForUserWithPagination(userId string, page int, perPage int) ([]*model.TeamMember, *model.AppError) { +func (a *OpenTracingAppLayer) GetTeamMembersForUserWithPagination(userID string, page int, perPage int) ([]*model.TeamMember, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamMembersForUserWithPagination") @@ -8382,7 +8382,7 @@ func (a *OpenTracingAppLayer) GetTeamMembersForUserWithPagination(userId string, }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetTeamMembersForUserWithPagination(userId, page, perPage) + resultVar0, resultVar1 := a.app.GetTeamMembersForUserWithPagination(userID, page, perPage) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -8392,7 +8392,7 @@ func (a *OpenTracingAppLayer) GetTeamMembersForUserWithPagination(userId string, return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetTeamSchemeChannelRoles(teamId string) (guestRoleName string, userRoleName string, adminRoleName string, err *model.AppError) { +func (a *OpenTracingAppLayer) GetTeamSchemeChannelRoles(teamID string) (guestRoleName string, userRoleName string, adminRoleName string, err *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamSchemeChannelRoles") @@ -8404,7 +8404,7 @@ func (a *OpenTracingAppLayer) GetTeamSchemeChannelRoles(teamId string) (guestRol }() defer span.Finish() - resultVar0, resultVar1, resultVar2, resultVar3 := a.app.GetTeamSchemeChannelRoles(teamId) + resultVar0, resultVar1, resultVar2, resultVar3 := a.app.GetTeamSchemeChannelRoles(teamID) if resultVar3 != nil { span.LogFields(spanlog.Error(resultVar3)) @@ -8414,7 +8414,7 @@ func (a *OpenTracingAppLayer) GetTeamSchemeChannelRoles(teamId string) (guestRol return resultVar0, resultVar1, resultVar2, resultVar3 } -func (a *OpenTracingAppLayer) GetTeamStats(teamId string, restrictions *model.ViewUsersRestrictions) (*model.TeamStats, *model.AppError) { +func (a *OpenTracingAppLayer) GetTeamStats(teamID string, restrictions *model.ViewUsersRestrictions) (*model.TeamStats, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamStats") @@ -8426,7 +8426,7 @@ func (a *OpenTracingAppLayer) GetTeamStats(teamId string, restrictions *model.Vi }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetTeamStats(teamId, restrictions) + resultVar0, resultVar1 := a.app.GetTeamStats(teamID, restrictions) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -8436,7 +8436,7 @@ func (a *OpenTracingAppLayer) GetTeamStats(teamId string, restrictions *model.Vi return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetTeamUnread(teamId string, userId string) (*model.TeamUnread, *model.AppError) { +func (a *OpenTracingAppLayer) GetTeamUnread(teamID string, userID string) (*model.TeamUnread, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamUnread") @@ -8448,7 +8448,7 @@ func (a *OpenTracingAppLayer) GetTeamUnread(teamId string, userId string) (*mode }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetTeamUnread(teamId, userId) + resultVar0, resultVar1 := a.app.GetTeamUnread(teamID, userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -8502,7 +8502,7 @@ func (a *OpenTracingAppLayer) GetTeamsForSchemePage(scheme *model.Scheme, page i return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetTeamsForUser(userId string) ([]*model.Team, *model.AppError) { +func (a *OpenTracingAppLayer) GetTeamsForUser(userID string) ([]*model.Team, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamsForUser") @@ -8514,7 +8514,7 @@ func (a *OpenTracingAppLayer) GetTeamsForUser(userId string) ([]*model.Team, *mo }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetTeamsForUser(userId) + resultVar0, resultVar1 := a.app.GetTeamsForUser(userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -8524,7 +8524,7 @@ func (a *OpenTracingAppLayer) GetTeamsForUser(userId string) ([]*model.Team, *mo return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetTeamsUnreadForUser(excludeTeamId string, userId string) ([]*model.TeamUnread, *model.AppError) { +func (a *OpenTracingAppLayer) GetTeamsUnreadForUser(excludeTeamId string, userID string) ([]*model.TeamUnread, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamsUnreadForUser") @@ -8536,7 +8536,7 @@ func (a *OpenTracingAppLayer) GetTeamsUnreadForUser(excludeTeamId string, userId }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetTeamsUnreadForUser(excludeTeamId, userId) + resultVar0, resultVar1 := a.app.GetTeamsUnreadForUser(excludeTeamId, userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -8568,7 +8568,7 @@ func (a *OpenTracingAppLayer) GetTermsOfService(id string) (*model.TermsOfServic return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetThreadForUser(userId string, teamId string, threadId string, extended bool) (*model.ThreadResponse, *model.AppError) { +func (a *OpenTracingAppLayer) GetThreadForUser(userID string, teamID string, threadId string, extended bool) (*model.ThreadResponse, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetThreadForUser") @@ -8580,7 +8580,7 @@ func (a *OpenTracingAppLayer) GetThreadForUser(userId string, teamId string, thr }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetThreadForUser(userId, teamId, threadId, extended) + resultVar0, resultVar1 := a.app.GetThreadForUser(userID, teamID, threadId, extended) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -8590,7 +8590,7 @@ func (a *OpenTracingAppLayer) GetThreadForUser(userId string, teamId string, thr return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetThreadMembershipsForUser(userId string, teamId string) ([]*model.ThreadMembership, error) { +func (a *OpenTracingAppLayer) GetThreadMembershipsForUser(userID string, teamID string) ([]*model.ThreadMembership, error) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetThreadMembershipsForUser") @@ -8602,7 +8602,7 @@ func (a *OpenTracingAppLayer) GetThreadMembershipsForUser(userId string, teamId }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetThreadMembershipsForUser(userId, teamId) + resultVar0, resultVar1 := a.app.GetThreadMembershipsForUser(userID, teamID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -8612,7 +8612,7 @@ func (a *OpenTracingAppLayer) GetThreadMembershipsForUser(userId string, teamId return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetThreadsForUser(userId string, teamId string, options model.GetUserThreadsOpts) (*model.Threads, *model.AppError) { +func (a *OpenTracingAppLayer) GetThreadsForUser(userID string, teamID string, options model.GetUserThreadsOpts) (*model.Threads, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetThreadsForUser") @@ -8624,7 +8624,7 @@ func (a *OpenTracingAppLayer) GetThreadsForUser(userId string, teamId string, op }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetThreadsForUser(userId, teamId, options) + resultVar0, resultVar1 := a.app.GetThreadsForUser(userID, teamID, options) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -8678,7 +8678,7 @@ func (a *OpenTracingAppLayer) GetUploadSession(uploadId string) (*model.UploadSe return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetUploadSessionsForUser(userId string) ([]*model.UploadSession, *model.AppError) { +func (a *OpenTracingAppLayer) GetUploadSessionsForUser(userID string) ([]*model.UploadSession, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUploadSessionsForUser") @@ -8690,7 +8690,7 @@ func (a *OpenTracingAppLayer) GetUploadSessionsForUser(userId string) ([]*model. }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetUploadSessionsForUser(userId) + resultVar0, resultVar1 := a.app.GetUploadSessionsForUser(userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -8700,7 +8700,7 @@ func (a *OpenTracingAppLayer) GetUploadSessionsForUser(userId string) ([]*model. return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetUser(userId string) (*model.User, *model.AppError) { +func (a *OpenTracingAppLayer) GetUser(userID string) (*model.User, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUser") @@ -8712,7 +8712,7 @@ func (a *OpenTracingAppLayer) GetUser(userId string) (*model.User, *model.AppErr }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetUser(userId) + resultVar0, resultVar1 := a.app.GetUser(userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -8722,7 +8722,7 @@ func (a *OpenTracingAppLayer) GetUser(userId string) (*model.User, *model.AppErr return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetUserAccessToken(tokenId string, sanitize bool) (*model.UserAccessToken, *model.AppError) { +func (a *OpenTracingAppLayer) GetUserAccessToken(tokenID string, sanitize bool) (*model.UserAccessToken, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserAccessToken") @@ -8734,7 +8734,7 @@ func (a *OpenTracingAppLayer) GetUserAccessToken(tokenId string, sanitize bool) }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetUserAccessToken(tokenId, sanitize) + resultVar0, resultVar1 := a.app.GetUserAccessToken(tokenID, sanitize) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -8766,7 +8766,7 @@ func (a *OpenTracingAppLayer) GetUserAccessTokens(page int, perPage int) ([]*mod return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetUserAccessTokensForUser(userId string, page int, perPage int) ([]*model.UserAccessToken, *model.AppError) { +func (a *OpenTracingAppLayer) GetUserAccessTokensForUser(userID string, page int, perPage int) ([]*model.UserAccessToken, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserAccessTokensForUser") @@ -8778,7 +8778,7 @@ func (a *OpenTracingAppLayer) GetUserAccessTokensForUser(userId string, page int }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetUserAccessTokensForUser(userId, page, perPage) + resultVar0, resultVar1 := a.app.GetUserAccessTokensForUser(userID, page, perPage) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -8876,7 +8876,7 @@ func (a *OpenTracingAppLayer) GetUserForLogin(id string, loginId string) (*model return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetUserStatusesByIds(userIds []string) ([]*model.Status, *model.AppError) { +func (a *OpenTracingAppLayer) GetUserStatusesByIds(userIDs []string) ([]*model.Status, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserStatusesByIds") @@ -8888,7 +8888,7 @@ func (a *OpenTracingAppLayer) GetUserStatusesByIds(userIds []string) ([]*model.S }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetUserStatusesByIds(userIds) + resultVar0, resultVar1 := a.app.GetUserStatusesByIds(userIDs) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -8898,7 +8898,7 @@ func (a *OpenTracingAppLayer) GetUserStatusesByIds(userIds []string) ([]*model.S return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetUserTermsOfService(userId string) (*model.UserTermsOfService, *model.AppError) { +func (a *OpenTracingAppLayer) GetUserTermsOfService(userID string) (*model.UserTermsOfService, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserTermsOfService") @@ -8910,7 +8910,7 @@ func (a *OpenTracingAppLayer) GetUserTermsOfService(userId string) (*model.UserT }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetUserTermsOfService(userId) + resultVar0, resultVar1 := a.app.GetUserTermsOfService(userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -8964,7 +8964,7 @@ func (a *OpenTracingAppLayer) GetUsersByGroupChannelIds(channelIds []string, asA return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetUsersByIds(userIds []string, options *store.UserGetByIdsOpts) ([]*model.User, *model.AppError) { +func (a *OpenTracingAppLayer) GetUsersByIds(userIDs []string, options *store.UserGetByIdsOpts) ([]*model.User, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersByIds") @@ -8976,7 +8976,7 @@ func (a *OpenTracingAppLayer) GetUsersByIds(userIds []string, options *store.Use }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetUsersByIds(userIds, options) + resultVar0, resultVar1 := a.app.GetUsersByIds(userIDs, options) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -9157,7 +9157,7 @@ func (a *OpenTracingAppLayer) GetUsersInTeam(options *model.UserGetOptions) ([]* return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetUsersInTeamEtag(teamId string, restrictionsHash string) string { +func (a *OpenTracingAppLayer) GetUsersInTeamEtag(teamID string, restrictionsHash string) string { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInTeamEtag") @@ -9169,7 +9169,7 @@ func (a *OpenTracingAppLayer) GetUsersInTeamEtag(teamId string, restrictionsHash }() defer span.Finish() - resultVar0 := a.app.GetUsersInTeamEtag(teamId, restrictionsHash) + resultVar0 := a.app.GetUsersInTeamEtag(teamID, restrictionsHash) return resultVar0 } @@ -9196,7 +9196,7 @@ func (a *OpenTracingAppLayer) GetUsersInTeamPage(options *model.UserGetOptions, return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetUsersNotInChannel(teamId string, channelId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { +func (a *OpenTracingAppLayer) GetUsersNotInChannel(teamID string, channelId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersNotInChannel") @@ -9208,7 +9208,7 @@ func (a *OpenTracingAppLayer) GetUsersNotInChannel(teamId string, channelId stri }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetUsersNotInChannel(teamId, channelId, groupConstrained, offset, limit, viewRestrictions) + resultVar0, resultVar1 := a.app.GetUsersNotInChannel(teamID, channelId, groupConstrained, offset, limit, viewRestrictions) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -9218,7 +9218,7 @@ func (a *OpenTracingAppLayer) GetUsersNotInChannel(teamId string, channelId stri return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetUsersNotInChannelMap(teamId string, channelId string, groupConstrained bool, offset int, limit int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) (map[string]*model.User, *model.AppError) { +func (a *OpenTracingAppLayer) GetUsersNotInChannelMap(teamID string, channelId string, groupConstrained bool, offset int, limit int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) (map[string]*model.User, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersNotInChannelMap") @@ -9230,7 +9230,7 @@ func (a *OpenTracingAppLayer) GetUsersNotInChannelMap(teamId string, channelId s }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetUsersNotInChannelMap(teamId, channelId, groupConstrained, offset, limit, asAdmin, viewRestrictions) + resultVar0, resultVar1 := a.app.GetUsersNotInChannelMap(teamID, channelId, groupConstrained, offset, limit, asAdmin, viewRestrictions) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -9240,7 +9240,7 @@ func (a *OpenTracingAppLayer) GetUsersNotInChannelMap(teamId string, channelId s return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetUsersNotInChannelPage(teamId string, channelId string, groupConstrained bool, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { +func (a *OpenTracingAppLayer) GetUsersNotInChannelPage(teamID string, channelId string, groupConstrained bool, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersNotInChannelPage") @@ -9252,7 +9252,7 @@ func (a *OpenTracingAppLayer) GetUsersNotInChannelPage(teamId string, channelId }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetUsersNotInChannelPage(teamId, channelId, groupConstrained, page, perPage, asAdmin, viewRestrictions) + resultVar0, resultVar1 := a.app.GetUsersNotInChannelPage(teamID, channelId, groupConstrained, page, perPage, asAdmin, viewRestrictions) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -9262,7 +9262,7 @@ func (a *OpenTracingAppLayer) GetUsersNotInChannelPage(teamId string, channelId return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetUsersNotInTeam(teamId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { +func (a *OpenTracingAppLayer) GetUsersNotInTeam(teamID string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersNotInTeam") @@ -9274,7 +9274,7 @@ func (a *OpenTracingAppLayer) GetUsersNotInTeam(teamId string, groupConstrained }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetUsersNotInTeam(teamId, groupConstrained, offset, limit, viewRestrictions) + resultVar0, resultVar1 := a.app.GetUsersNotInTeam(teamID, groupConstrained, offset, limit, viewRestrictions) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -9284,7 +9284,7 @@ func (a *OpenTracingAppLayer) GetUsersNotInTeam(teamId string, groupConstrained return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetUsersNotInTeamEtag(teamId string, restrictionsHash string) string { +func (a *OpenTracingAppLayer) GetUsersNotInTeamEtag(teamID string, restrictionsHash string) string { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersNotInTeamEtag") @@ -9296,12 +9296,12 @@ func (a *OpenTracingAppLayer) GetUsersNotInTeamEtag(teamId string, restrictionsH }() defer span.Finish() - resultVar0 := a.app.GetUsersNotInTeamEtag(teamId, restrictionsHash) + resultVar0 := a.app.GetUsersNotInTeamEtag(teamID, restrictionsHash) return resultVar0 } -func (a *OpenTracingAppLayer) GetUsersNotInTeamPage(teamId string, groupConstrained bool, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { +func (a *OpenTracingAppLayer) GetUsersNotInTeamPage(teamID string, groupConstrained bool, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersNotInTeamPage") @@ -9313,7 +9313,7 @@ func (a *OpenTracingAppLayer) GetUsersNotInTeamPage(teamId string, groupConstrai }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetUsersNotInTeamPage(teamId, groupConstrained, page, perPage, asAdmin, viewRestrictions) + resultVar0, resultVar1 := a.app.GetUsersNotInTeamPage(teamID, groupConstrained, page, perPage, asAdmin, viewRestrictions) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -9411,7 +9411,7 @@ func (a *OpenTracingAppLayer) GetVerifyEmailToken(token string) (*model.Token, * return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) GetViewUsersRestrictions(userId string) (*model.ViewUsersRestrictions, *model.AppError) { +func (a *OpenTracingAppLayer) GetViewUsersRestrictions(userID string) (*model.ViewUsersRestrictions, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetViewUsersRestrictions") @@ -9423,7 +9423,7 @@ func (a *OpenTracingAppLayer) GetViewUsersRestrictions(userId string) (*model.Vi }() defer span.Finish() - resultVar0, resultVar1 := a.app.GetViewUsersRestrictions(userId) + resultVar0, resultVar1 := a.app.GetViewUsersRestrictions(userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -9514,7 +9514,7 @@ func (a *OpenTracingAppLayer) HandleCommandResponsePost(command *model.Command, return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) HandleCommandWebhook(hookId string, response *model.CommandResponse) *model.AppError { +func (a *OpenTracingAppLayer) HandleCommandWebhook(hookID string, response *model.CommandResponse) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HandleCommandWebhook") @@ -9526,7 +9526,7 @@ func (a *OpenTracingAppLayer) HandleCommandWebhook(hookId string, response *mode }() defer span.Finish() - resultVar0 := a.app.HandleCommandWebhook(hookId, response) + resultVar0 := a.app.HandleCommandWebhook(hookID, response) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -9551,7 +9551,7 @@ func (a *OpenTracingAppLayer) HandleImages(previewPathList []string, thumbnailPa a.app.HandleImages(previewPathList, thumbnailPathList, fileData) } -func (a *OpenTracingAppLayer) HandleIncomingWebhook(hookId string, req *model.IncomingWebhookRequest) *model.AppError { +func (a *OpenTracingAppLayer) HandleIncomingWebhook(hookID string, req *model.IncomingWebhookRequest) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HandleIncomingWebhook") @@ -9563,7 +9563,7 @@ func (a *OpenTracingAppLayer) HandleIncomingWebhook(hookId string, req *model.In }() defer span.Finish() - resultVar0 := a.app.HandleIncomingWebhook(hookId, req) + resultVar0 := a.app.HandleIncomingWebhook(hookID, req) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -9639,7 +9639,7 @@ func (a *OpenTracingAppLayer) HasPermissionToChannelByPost(askingUserId string, return resultVar0 } -func (a *OpenTracingAppLayer) HasPermissionToTeam(askingUserId string, teamId string, permission *model.Permission) bool { +func (a *OpenTracingAppLayer) HasPermissionToTeam(askingUserId string, teamID string, permission *model.Permission) bool { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HasPermissionToTeam") @@ -9651,12 +9651,12 @@ func (a *OpenTracingAppLayer) HasPermissionToTeam(askingUserId string, teamId st }() defer span.Finish() - resultVar0 := a.app.HasPermissionToTeam(askingUserId, teamId, permission) + resultVar0 := a.app.HasPermissionToTeam(askingUserId, teamID, permission) return resultVar0 } -func (a *OpenTracingAppLayer) HasPermissionToUser(askingUserId string, userId string) bool { +func (a *OpenTracingAppLayer) HasPermissionToUser(askingUserId string, userID string) bool { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HasPermissionToUser") @@ -9668,7 +9668,7 @@ func (a *OpenTracingAppLayer) HasPermissionToUser(askingUserId string, userId st }() defer span.Finish() - resultVar0 := a.app.HasPermissionToUser(askingUserId, userId) + resultVar0 := a.app.HasPermissionToUser(askingUserId, userID) return resultVar0 } @@ -9937,7 +9937,7 @@ func (a *OpenTracingAppLayer) InvalidateAllEmailInvites() *model.AppError { return resultVar0 } -func (a *OpenTracingAppLayer) InvalidateCacheForUser(userId string) { +func (a *OpenTracingAppLayer) InvalidateCacheForUser(userID string) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InvalidateCacheForUser") @@ -9949,10 +9949,10 @@ func (a *OpenTracingAppLayer) InvalidateCacheForUser(userId string) { }() defer span.Finish() - a.app.InvalidateCacheForUser(userId) + a.app.InvalidateCacheForUser(userID) } -func (a *OpenTracingAppLayer) InvalidateWebConnSessionCacheForUser(userId string) { +func (a *OpenTracingAppLayer) InvalidateWebConnSessionCacheForUser(userID string) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InvalidateWebConnSessionCacheForUser") @@ -9964,10 +9964,10 @@ func (a *OpenTracingAppLayer) InvalidateWebConnSessionCacheForUser(userId string }() defer span.Finish() - a.app.InvalidateWebConnSessionCacheForUser(userId) + a.app.InvalidateWebConnSessionCacheForUser(userID) } -func (a *OpenTracingAppLayer) InviteGuestsToChannels(teamId string, guestsInvite *model.GuestsInvite, senderId string) *model.AppError { +func (a *OpenTracingAppLayer) InviteGuestsToChannels(teamID string, guestsInvite *model.GuestsInvite, senderId string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InviteGuestsToChannels") @@ -9979,7 +9979,7 @@ func (a *OpenTracingAppLayer) InviteGuestsToChannels(teamId string, guestsInvite }() defer span.Finish() - resultVar0 := a.app.InviteGuestsToChannels(teamId, guestsInvite, senderId) + resultVar0 := a.app.InviteGuestsToChannels(teamID, guestsInvite, senderId) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -9989,7 +9989,7 @@ func (a *OpenTracingAppLayer) InviteGuestsToChannels(teamId string, guestsInvite return resultVar0 } -func (a *OpenTracingAppLayer) InviteGuestsToChannelsGracefully(teamId string, guestsInvite *model.GuestsInvite, senderId string) ([]*model.EmailInviteWithError, *model.AppError) { +func (a *OpenTracingAppLayer) InviteGuestsToChannelsGracefully(teamID string, guestsInvite *model.GuestsInvite, senderId string) ([]*model.EmailInviteWithError, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InviteGuestsToChannelsGracefully") @@ -10001,7 +10001,7 @@ func (a *OpenTracingAppLayer) InviteGuestsToChannelsGracefully(teamId string, gu }() defer span.Finish() - resultVar0, resultVar1 := a.app.InviteGuestsToChannelsGracefully(teamId, guestsInvite, senderId) + resultVar0, resultVar1 := a.app.InviteGuestsToChannelsGracefully(teamID, guestsInvite, senderId) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -10011,7 +10011,7 @@ func (a *OpenTracingAppLayer) InviteGuestsToChannelsGracefully(teamId string, gu return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) InviteNewUsersToTeam(emailList []string, teamId string, senderId string) *model.AppError { +func (a *OpenTracingAppLayer) InviteNewUsersToTeam(emailList []string, teamID string, senderId string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InviteNewUsersToTeam") @@ -10023,7 +10023,7 @@ func (a *OpenTracingAppLayer) InviteNewUsersToTeam(emailList []string, teamId st }() defer span.Finish() - resultVar0 := a.app.InviteNewUsersToTeam(emailList, teamId, senderId) + resultVar0 := a.app.InviteNewUsersToTeam(emailList, teamID, senderId) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -10033,7 +10033,7 @@ func (a *OpenTracingAppLayer) InviteNewUsersToTeam(emailList []string, teamId st return resultVar0 } -func (a *OpenTracingAppLayer) InviteNewUsersToTeamGracefully(emailList []string, teamId string, senderId string) ([]*model.EmailInviteWithError, *model.AppError) { +func (a *OpenTracingAppLayer) InviteNewUsersToTeamGracefully(emailList []string, teamID string, senderId string) ([]*model.EmailInviteWithError, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InviteNewUsersToTeamGracefully") @@ -10045,7 +10045,7 @@ func (a *OpenTracingAppLayer) InviteNewUsersToTeamGracefully(emailList []string, }() defer span.Finish() - resultVar0, resultVar1 := a.app.InviteNewUsersToTeamGracefully(emailList, teamId, senderId) + resultVar0, resultVar1 := a.app.InviteNewUsersToTeamGracefully(emailList, teamID, senderId) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -10189,7 +10189,7 @@ func (a *OpenTracingAppLayer) IsUsernameTaken(name string) bool { return resultVar0 } -func (a *OpenTracingAppLayer) JoinChannel(channel *model.Channel, userId string) *model.AppError { +func (a *OpenTracingAppLayer) JoinChannel(channel *model.Channel, userID string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.JoinChannel") @@ -10201,7 +10201,7 @@ func (a *OpenTracingAppLayer) JoinChannel(channel *model.Channel, userId string) }() defer span.Finish() - resultVar0 := a.app.JoinChannel(channel, userId) + resultVar0 := a.app.JoinChannel(channel, userID) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -10211,7 +10211,7 @@ func (a *OpenTracingAppLayer) JoinChannel(channel *model.Channel, userId string) return resultVar0 } -func (a *OpenTracingAppLayer) JoinDefaultChannels(teamId string, user *model.User, shouldBeAdmin bool, userRequestorId string) *model.AppError { +func (a *OpenTracingAppLayer) JoinDefaultChannels(teamID string, user *model.User, shouldBeAdmin bool, userRequestorId string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.JoinDefaultChannels") @@ -10223,7 +10223,7 @@ func (a *OpenTracingAppLayer) JoinDefaultChannels(teamId string, user *model.Use }() defer span.Finish() - resultVar0 := a.app.JoinDefaultChannels(teamId, user, shouldBeAdmin, userRequestorId) + resultVar0 := a.app.JoinDefaultChannels(teamID, user, shouldBeAdmin, userRequestorId) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -10255,7 +10255,7 @@ func (a *OpenTracingAppLayer) JoinUserToTeam(team *model.Team, user *model.User, return resultVar0 } -func (a *OpenTracingAppLayer) LeaveChannel(channelId string, userId string) *model.AppError { +func (a *OpenTracingAppLayer) LeaveChannel(channelId string, userID string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LeaveChannel") @@ -10267,7 +10267,7 @@ func (a *OpenTracingAppLayer) LeaveChannel(channelId string, userId string) *mod }() defer span.Finish() - resultVar0 := a.app.LeaveChannel(channelId, userId) + resultVar0 := a.app.LeaveChannel(channelId, userID) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -10333,7 +10333,7 @@ func (a *OpenTracingAppLayer) LimitedClientConfigWithComputed() map[string]strin return resultVar0 } -func (a *OpenTracingAppLayer) ListAllCommands(teamId string, T goi18n.TranslateFunc) ([]*model.Command, *model.AppError) { +func (a *OpenTracingAppLayer) ListAllCommands(teamID string, T goi18n.TranslateFunc) ([]*model.Command, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ListAllCommands") @@ -10345,7 +10345,7 @@ func (a *OpenTracingAppLayer) ListAllCommands(teamId string, T goi18n.TranslateF }() defer span.Finish() - resultVar0, resultVar1 := a.app.ListAllCommands(teamId, T) + resultVar0, resultVar1 := a.app.ListAllCommands(teamID, T) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -10355,7 +10355,7 @@ func (a *OpenTracingAppLayer) ListAllCommands(teamId string, T goi18n.TranslateF return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) ListAutocompleteCommands(teamId string, T goi18n.TranslateFunc) ([]*model.Command, *model.AppError) { +func (a *OpenTracingAppLayer) ListAutocompleteCommands(teamID string, T goi18n.TranslateFunc) ([]*model.Command, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ListAutocompleteCommands") @@ -10366,10 +10366,10 @@ func (a *OpenTracingAppLayer) ListAutocompleteCommands(teamId string, T goi18n.T a.ctx = origCtx }() - span.SetTag("teamId", teamId) + span.SetTag("teamID", teamID) defer span.Finish() - resultVar0, resultVar1 := a.app.ListAutocompleteCommands(teamId, T) + resultVar0, resultVar1 := a.app.ListAutocompleteCommands(teamID, T) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -10445,7 +10445,7 @@ func (a *OpenTracingAppLayer) ListPluginKeys(pluginId string, page int, perPage return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) ListTeamCommands(teamId string) ([]*model.Command, *model.AppError) { +func (a *OpenTracingAppLayer) ListTeamCommands(teamID string) ([]*model.Command, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ListTeamCommands") @@ -10457,7 +10457,7 @@ func (a *OpenTracingAppLayer) ListTeamCommands(teamId string) ([]*model.Command, }() defer span.Finish() - resultVar0, resultVar1 := a.app.ListTeamCommands(teamId) + resultVar0, resultVar1 := a.app.ListTeamCommands(teamID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -10497,7 +10497,7 @@ func (a *OpenTracingAppLayer) LogAuditRecWithLevel(rec *audit.Record, level mlog a.app.LogAuditRecWithLevel(rec, level, err) } -func (a *OpenTracingAppLayer) LoginByOAuth(service string, userData io.Reader, teamId string, tokenUser *model.User) (*model.User, *model.AppError) { +func (a *OpenTracingAppLayer) LoginByOAuth(service string, userData io.Reader, teamID string, tokenUser *model.User) (*model.User, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LoginByOAuth") @@ -10509,7 +10509,7 @@ func (a *OpenTracingAppLayer) LoginByOAuth(service string, userData io.Reader, t }() defer span.Finish() - resultVar0, resultVar1 := a.app.LoginByOAuth(service, userData, teamId, tokenUser) + resultVar0, resultVar1 := a.app.LoginByOAuth(service, userData, teamID, tokenUser) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -10580,7 +10580,7 @@ func (a *OpenTracingAppLayer) MarkChannelAsUnreadFromPost(postID string, userID return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) MarkChannelsAsViewed(channelIds []string, userId string, currentSessionId string) (map[string]int64, *model.AppError) { +func (a *OpenTracingAppLayer) MarkChannelsAsViewed(channelIds []string, userID string, currentSessionId string) (map[string]int64, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MarkChannelsAsViewed") @@ -10592,7 +10592,7 @@ func (a *OpenTracingAppLayer) MarkChannelsAsViewed(channelIds []string, userId s }() defer span.Finish() - resultVar0, resultVar1 := a.app.MarkChannelsAsViewed(channelIds, userId, currentSessionId) + resultVar0, resultVar1 := a.app.MarkChannelsAsViewed(channelIds, userID, currentSessionId) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -10619,7 +10619,7 @@ func (a *OpenTracingAppLayer) MaxPostSize() int { return resultVar0 } -func (a *OpenTracingAppLayer) MentionsToPublicChannels(message string, teamId string) model.ChannelMentionMap { +func (a *OpenTracingAppLayer) MentionsToPublicChannels(message string, teamID string) model.ChannelMentionMap { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MentionsToPublicChannels") @@ -10631,12 +10631,12 @@ func (a *OpenTracingAppLayer) MentionsToPublicChannels(message string, teamId st }() defer span.Finish() - resultVar0 := a.app.MentionsToPublicChannels(message, teamId) + resultVar0 := a.app.MentionsToPublicChannels(message, teamID) return resultVar0 } -func (a *OpenTracingAppLayer) MentionsToTeamMembers(message string, teamId string) model.UserMentionMap { +func (a *OpenTracingAppLayer) MentionsToTeamMembers(message string, teamID string) model.UserMentionMap { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MentionsToTeamMembers") @@ -10648,7 +10648,7 @@ func (a *OpenTracingAppLayer) MentionsToTeamMembers(message string, teamId strin }() defer span.Finish() - resultVar0 := a.app.MentionsToTeamMembers(message, teamId) + resultVar0 := a.app.MentionsToTeamMembers(message, teamID) return resultVar0 } @@ -10946,7 +10946,7 @@ func (a *OpenTracingAppLayer) PatchBot(botUserId string, botPatch *model.BotPatc return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) PatchChannel(channel *model.Channel, patch *model.ChannelPatch, userId string) (*model.Channel, *model.AppError) { +func (a *OpenTracingAppLayer) PatchChannel(channel *model.Channel, patch *model.ChannelPatch, userID string) (*model.Channel, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchChannel") @@ -10958,7 +10958,7 @@ func (a *OpenTracingAppLayer) PatchChannel(channel *model.Channel, patch *model. }() defer span.Finish() - resultVar0, resultVar1 := a.app.PatchChannel(channel, patch, userId) + resultVar0, resultVar1 := a.app.PatchChannel(channel, patch, userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -11056,7 +11056,7 @@ func (a *OpenTracingAppLayer) PatchScheme(scheme *model.Scheme, patch *model.Sch return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) PatchTeam(teamId string, patch *model.TeamPatch) (*model.Team, *model.AppError) { +func (a *OpenTracingAppLayer) PatchTeam(teamID string, patch *model.TeamPatch) (*model.Team, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchTeam") @@ -11068,7 +11068,7 @@ func (a *OpenTracingAppLayer) PatchTeam(teamId string, patch *model.TeamPatch) ( }() defer span.Finish() - resultVar0, resultVar1 := a.app.PatchTeam(teamId, patch) + resultVar0, resultVar1 := a.app.PatchTeam(teamID, patch) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -11078,7 +11078,7 @@ func (a *OpenTracingAppLayer) PatchTeam(teamId string, patch *model.TeamPatch) ( return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) PatchUser(userId string, patch *model.UserPatch, asAdmin bool) (*model.User, *model.AppError) { +func (a *OpenTracingAppLayer) PatchUser(userID string, patch *model.UserPatch, asAdmin bool) (*model.User, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchUser") @@ -11090,7 +11090,7 @@ func (a *OpenTracingAppLayer) PatchUser(userId string, patch *model.UserPatch, a }() defer span.Finish() - resultVar0, resultVar1 := a.app.PatchUser(userId, patch, asAdmin) + resultVar0, resultVar1 := a.app.PatchUser(userID, patch, asAdmin) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -11188,7 +11188,7 @@ func (a *OpenTracingAppLayer) PermanentDeleteTeam(team *model.Team) *model.AppEr return resultVar0 } -func (a *OpenTracingAppLayer) PermanentDeleteTeamId(teamId string) *model.AppError { +func (a *OpenTracingAppLayer) PermanentDeleteTeamId(teamID string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PermanentDeleteTeamId") @@ -11200,7 +11200,7 @@ func (a *OpenTracingAppLayer) PermanentDeleteTeamId(teamId string) *model.AppErr }() defer span.Finish() - resultVar0 := a.app.PermanentDeleteTeamId(teamId) + resultVar0 := a.app.PermanentDeleteTeamId(teamID) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -11232,7 +11232,7 @@ func (a *OpenTracingAppLayer) PermanentDeleteUser(user *model.User) *model.AppEr return resultVar0 } -func (a *OpenTracingAppLayer) PluginCommandsForTeam(teamId string) []*model.Command { +func (a *OpenTracingAppLayer) PluginCommandsForTeam(teamID string) []*model.Command { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PluginCommandsForTeam") @@ -11244,7 +11244,7 @@ func (a *OpenTracingAppLayer) PluginCommandsForTeam(teamId string) []*model.Comm }() defer span.Finish() - resultVar0 := a.app.PluginCommandsForTeam(teamId) + resultVar0 := a.app.PluginCommandsForTeam(teamID) return resultVar0 } @@ -11322,7 +11322,7 @@ func (a *OpenTracingAppLayer) PostPatchWithProxyRemovedFromImageURLs(patch *mode return resultVar0 } -func (a *OpenTracingAppLayer) PostUpdateChannelDisplayNameMessage(userId string, channel *model.Channel, oldChannelDisplayName string, newChannelDisplayName string) *model.AppError { +func (a *OpenTracingAppLayer) PostUpdateChannelDisplayNameMessage(userID string, channel *model.Channel, oldChannelDisplayName string, newChannelDisplayName string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostUpdateChannelDisplayNameMessage") @@ -11334,7 +11334,7 @@ func (a *OpenTracingAppLayer) PostUpdateChannelDisplayNameMessage(userId string, }() defer span.Finish() - resultVar0 := a.app.PostUpdateChannelDisplayNameMessage(userId, channel, oldChannelDisplayName, newChannelDisplayName) + resultVar0 := a.app.PostUpdateChannelDisplayNameMessage(userID, channel, oldChannelDisplayName, newChannelDisplayName) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -11344,7 +11344,7 @@ func (a *OpenTracingAppLayer) PostUpdateChannelDisplayNameMessage(userId string, return resultVar0 } -func (a *OpenTracingAppLayer) PostUpdateChannelHeaderMessage(userId string, channel *model.Channel, oldChannelHeader string, newChannelHeader string) *model.AppError { +func (a *OpenTracingAppLayer) PostUpdateChannelHeaderMessage(userID string, channel *model.Channel, oldChannelHeader string, newChannelHeader string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostUpdateChannelHeaderMessage") @@ -11356,7 +11356,7 @@ func (a *OpenTracingAppLayer) PostUpdateChannelHeaderMessage(userId string, chan }() defer span.Finish() - resultVar0 := a.app.PostUpdateChannelHeaderMessage(userId, channel, oldChannelHeader, newChannelHeader) + resultVar0 := a.app.PostUpdateChannelHeaderMessage(userID, channel, oldChannelHeader, newChannelHeader) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -11366,7 +11366,7 @@ func (a *OpenTracingAppLayer) PostUpdateChannelHeaderMessage(userId string, chan return resultVar0 } -func (a *OpenTracingAppLayer) PostUpdateChannelPurposeMessage(userId string, channel *model.Channel, oldChannelPurpose string, newChannelPurpose string) *model.AppError { +func (a *OpenTracingAppLayer) PostUpdateChannelPurposeMessage(userID string, channel *model.Channel, oldChannelPurpose string, newChannelPurpose string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostUpdateChannelPurposeMessage") @@ -11378,7 +11378,7 @@ func (a *OpenTracingAppLayer) PostUpdateChannelPurposeMessage(userId string, cha }() defer span.Finish() - resultVar0 := a.app.PostUpdateChannelPurposeMessage(userId, channel, oldChannelPurpose, newChannelPurpose) + resultVar0 := a.app.PostUpdateChannelPurposeMessage(userID, channel, oldChannelPurpose, newChannelPurpose) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -11542,7 +11542,7 @@ func (a *OpenTracingAppLayer) PublishSkipClusterSend(message *model.WebSocketEve a.app.PublishSkipClusterSend(message) } -func (a *OpenTracingAppLayer) PublishUserTyping(userId string, channelId string, parentId string) *model.AppError { +func (a *OpenTracingAppLayer) PublishUserTyping(userID string, channelId string, parentId string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PublishUserTyping") @@ -11554,7 +11554,7 @@ func (a *OpenTracingAppLayer) PublishUserTyping(userId string, channelId string, }() defer span.Finish() - resultVar0 := a.app.PublishUserTyping(userId, channelId, parentId) + resultVar0 := a.app.PublishUserTyping(userID, channelId, parentId) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -11711,7 +11711,7 @@ func (a *OpenTracingAppLayer) RegenerateOAuthAppSecret(app *model.OAuthApp) (*mo return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) RegenerateTeamInviteId(teamId string) (*model.Team, *model.AppError) { +func (a *OpenTracingAppLayer) RegenerateTeamInviteId(teamID string) (*model.Team, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RegenerateTeamInviteId") @@ -11723,7 +11723,7 @@ func (a *OpenTracingAppLayer) RegenerateTeamInviteId(teamId string) (*model.Team }() defer span.Finish() - resultVar0, resultVar1 := a.app.RegenerateTeamInviteId(teamId) + resultVar0, resultVar1 := a.app.RegenerateTeamInviteId(teamID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -12005,7 +12005,7 @@ func (a *OpenTracingAppLayer) RemoveSamlPublicCertificate() *model.AppError { return resultVar0 } -func (a *OpenTracingAppLayer) RemoveTeamIcon(teamId string) *model.AppError { +func (a *OpenTracingAppLayer) RemoveTeamIcon(teamID string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveTeamIcon") @@ -12017,7 +12017,7 @@ func (a *OpenTracingAppLayer) RemoveTeamIcon(teamId string) *model.AppError { }() defer span.Finish() - resultVar0 := a.app.RemoveTeamIcon(teamId) + resultVar0 := a.app.RemoveTeamIcon(teamID) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -12049,7 +12049,7 @@ func (a *OpenTracingAppLayer) RemoveTeamMemberFromTeam(teamMember *model.TeamMem return resultVar0 } -func (a *OpenTracingAppLayer) RemoveUserFromChannel(userIdToRemove string, removerUserId string, channel *model.Channel) *model.AppError { +func (a *OpenTracingAppLayer) RemoveUserFromChannel(userIDToRemove string, removerUserId string, channel *model.Channel) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveUserFromChannel") @@ -12061,7 +12061,7 @@ func (a *OpenTracingAppLayer) RemoveUserFromChannel(userIdToRemove string, remov }() defer span.Finish() - resultVar0 := a.app.RemoveUserFromChannel(userIdToRemove, removerUserId, channel) + resultVar0 := a.app.RemoveUserFromChannel(userIDToRemove, removerUserId, channel) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -12071,7 +12071,7 @@ func (a *OpenTracingAppLayer) RemoveUserFromChannel(userIdToRemove string, remov return resultVar0 } -func (a *OpenTracingAppLayer) RemoveUserFromTeam(teamId string, userId string, requestorId string) *model.AppError { +func (a *OpenTracingAppLayer) RemoveUserFromTeam(teamID string, userID string, requestorId string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveUserFromTeam") @@ -12083,7 +12083,7 @@ func (a *OpenTracingAppLayer) RemoveUserFromTeam(teamId string, userId string, r }() defer span.Finish() - resultVar0 := a.app.RemoveUserFromTeam(teamId, userId, requestorId) + resultVar0 := a.app.RemoveUserFromTeam(teamID, userID, requestorId) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -12225,7 +12225,7 @@ func (a *OpenTracingAppLayer) ResetPermissionsSystem() *model.AppError { return resultVar0 } -func (a *OpenTracingAppLayer) RestoreChannel(channel *model.Channel, userId string) (*model.Channel, *model.AppError) { +func (a *OpenTracingAppLayer) RestoreChannel(channel *model.Channel, userID string) (*model.Channel, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RestoreChannel") @@ -12237,7 +12237,7 @@ func (a *OpenTracingAppLayer) RestoreChannel(channel *model.Channel, userId stri }() defer span.Finish() - resultVar0, resultVar1 := a.app.RestoreChannel(channel, userId) + resultVar0, resultVar1 := a.app.RestoreChannel(channel, userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -12247,7 +12247,7 @@ func (a *OpenTracingAppLayer) RestoreChannel(channel *model.Channel, userId stri return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) RestoreTeam(teamId string) *model.AppError { +func (a *OpenTracingAppLayer) RestoreTeam(teamID string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RestoreTeam") @@ -12259,7 +12259,7 @@ func (a *OpenTracingAppLayer) RestoreTeam(teamId string) *model.AppError { }() defer span.Finish() - resultVar0 := a.app.RestoreTeam(teamId) + resultVar0 := a.app.RestoreTeam(teamID) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -12269,7 +12269,7 @@ func (a *OpenTracingAppLayer) RestoreTeam(teamId string) *model.AppError { return resultVar0 } -func (a *OpenTracingAppLayer) RestrictUsersGetByPermissions(userId string, options *model.UserGetOptions) (*model.UserGetOptions, *model.AppError) { +func (a *OpenTracingAppLayer) RestrictUsersGetByPermissions(userID string, options *model.UserGetOptions) (*model.UserGetOptions, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RestrictUsersGetByPermissions") @@ -12281,7 +12281,7 @@ func (a *OpenTracingAppLayer) RestrictUsersGetByPermissions(userId string, optio }() defer span.Finish() - resultVar0, resultVar1 := a.app.RestrictUsersGetByPermissions(userId, options) + resultVar0, resultVar1 := a.app.RestrictUsersGetByPermissions(userID, options) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -12291,7 +12291,7 @@ func (a *OpenTracingAppLayer) RestrictUsersGetByPermissions(userId string, optio return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) RestrictUsersSearchByPermissions(userId string, options *model.UserSearchOptions) (*model.UserSearchOptions, *model.AppError) { +func (a *OpenTracingAppLayer) RestrictUsersSearchByPermissions(userID string, options *model.UserSearchOptions) (*model.UserSearchOptions, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RestrictUsersSearchByPermissions") @@ -12303,7 +12303,7 @@ func (a *OpenTracingAppLayer) RestrictUsersSearchByPermissions(userId string, op }() defer span.Finish() - resultVar0, resultVar1 := a.app.RestrictUsersSearchByPermissions(userId, options) + resultVar0, resultVar1 := a.app.RestrictUsersSearchByPermissions(userID, options) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -12335,7 +12335,7 @@ func (a *OpenTracingAppLayer) RevokeAccessToken(token string) *model.AppError { return resultVar0 } -func (a *OpenTracingAppLayer) RevokeAllSessions(userId string) *model.AppError { +func (a *OpenTracingAppLayer) RevokeAllSessions(userID string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeAllSessions") @@ -12347,7 +12347,7 @@ func (a *OpenTracingAppLayer) RevokeAllSessions(userId string) *model.AppError { }() defer span.Finish() - resultVar0 := a.app.RevokeAllSessions(userId) + resultVar0 := a.app.RevokeAllSessions(userID) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -12401,7 +12401,7 @@ func (a *OpenTracingAppLayer) RevokeSessionById(sessionId string) *model.AppErro return resultVar0 } -func (a *OpenTracingAppLayer) RevokeSessionsForDeviceId(userId string, deviceId string, currentSessionId string) *model.AppError { +func (a *OpenTracingAppLayer) RevokeSessionsForDeviceId(userID string, deviceId string, currentSessionId string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeSessionsForDeviceId") @@ -12413,7 +12413,7 @@ func (a *OpenTracingAppLayer) RevokeSessionsForDeviceId(userId string, deviceId }() defer span.Finish() - resultVar0 := a.app.RevokeSessionsForDeviceId(userId, deviceId, currentSessionId) + resultVar0 := a.app.RevokeSessionsForDeviceId(userID, deviceId, currentSessionId) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -12636,7 +12636,7 @@ func (a *OpenTracingAppLayer) SaveReactionForPost(reaction *model.Reaction) (*mo return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) SaveUserTermsOfService(userId string, termsOfServiceId string, accepted bool) *model.AppError { +func (a *OpenTracingAppLayer) SaveUserTermsOfService(userID string, termsOfServiceId string, accepted bool) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveUserTermsOfService") @@ -12648,7 +12648,7 @@ func (a *OpenTracingAppLayer) SaveUserTermsOfService(userId string, termsOfServi }() defer span.Finish() - resultVar0 := a.app.SaveUserTermsOfService(userId, termsOfServiceId, accepted) + resultVar0 := a.app.SaveUserTermsOfService(userID, termsOfServiceId, accepted) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -12719,7 +12719,7 @@ func (a *OpenTracingAppLayer) SearchAllTeams(searchOpts *model.TeamSearch) ([]*m return resultVar0, resultVar1, resultVar2 } -func (a *OpenTracingAppLayer) SearchArchivedChannels(teamId string, term string, userId string) (*model.ChannelList, *model.AppError) { +func (a *OpenTracingAppLayer) SearchArchivedChannels(teamID string, term string, userID string) (*model.ChannelList, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchArchivedChannels") @@ -12731,7 +12731,7 @@ func (a *OpenTracingAppLayer) SearchArchivedChannels(teamId string, term string, }() defer span.Finish() - resultVar0, resultVar1 := a.app.SearchArchivedChannels(teamId, term, userId) + resultVar0, resultVar1 := a.app.SearchArchivedChannels(teamID, term, userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -12741,7 +12741,7 @@ func (a *OpenTracingAppLayer) SearchArchivedChannels(teamId string, term string, return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) SearchChannels(teamId string, term string) (*model.ChannelList, *model.AppError) { +func (a *OpenTracingAppLayer) SearchChannels(teamID string, term string) (*model.ChannelList, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchChannels") @@ -12753,7 +12753,7 @@ func (a *OpenTracingAppLayer) SearchChannels(teamId string, term string) (*model }() defer span.Finish() - resultVar0, resultVar1 := a.app.SearchChannels(teamId, term) + resultVar0, resultVar1 := a.app.SearchChannels(teamID, term) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -12763,7 +12763,7 @@ func (a *OpenTracingAppLayer) SearchChannels(teamId string, term string) (*model return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) SearchChannelsForUser(userId string, teamId string, term string) (*model.ChannelList, *model.AppError) { +func (a *OpenTracingAppLayer) SearchChannelsForUser(userID string, teamID string, term string) (*model.ChannelList, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchChannelsForUser") @@ -12775,7 +12775,7 @@ func (a *OpenTracingAppLayer) SearchChannelsForUser(userId string, teamId string }() defer span.Finish() - resultVar0, resultVar1 := a.app.SearchChannelsForUser(userId, teamId, term) + resultVar0, resultVar1 := a.app.SearchChannelsForUser(userID, teamID, term) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -12785,7 +12785,7 @@ func (a *OpenTracingAppLayer) SearchChannelsForUser(userId string, teamId string return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) SearchChannelsUserNotIn(teamId string, userId string, term string) (*model.ChannelList, *model.AppError) { +func (a *OpenTracingAppLayer) SearchChannelsUserNotIn(teamID string, userID string, term string) (*model.ChannelList, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchChannelsUserNotIn") @@ -12797,7 +12797,7 @@ func (a *OpenTracingAppLayer) SearchChannelsUserNotIn(teamId string, userId stri }() defer span.Finish() - resultVar0, resultVar1 := a.app.SearchChannelsUserNotIn(teamId, userId, term) + resultVar0, resultVar1 := a.app.SearchChannelsUserNotIn(teamID, userID, term) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -12846,7 +12846,7 @@ func (a *OpenTracingAppLayer) SearchEngine() *searchengine.Broker { return resultVar0 } -func (a *OpenTracingAppLayer) SearchGroupChannels(userId string, term string) (*model.ChannelList, *model.AppError) { +func (a *OpenTracingAppLayer) SearchGroupChannels(userID string, term string) (*model.ChannelList, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchGroupChannels") @@ -12858,7 +12858,7 @@ func (a *OpenTracingAppLayer) SearchGroupChannels(userId string, term string) (* }() defer span.Finish() - resultVar0, resultVar1 := a.app.SearchGroupChannels(userId, term) + resultVar0, resultVar1 := a.app.SearchGroupChannels(userID, term) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -12868,7 +12868,7 @@ func (a *OpenTracingAppLayer) SearchGroupChannels(userId string, term string) (* return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) SearchPostsInTeam(teamId string, paramsList []*model.SearchParams) (*model.PostList, *model.AppError) { +func (a *OpenTracingAppLayer) SearchPostsInTeam(teamID string, paramsList []*model.SearchParams) (*model.PostList, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchPostsInTeam") @@ -12880,7 +12880,7 @@ func (a *OpenTracingAppLayer) SearchPostsInTeam(teamId string, paramsList []*mod }() defer span.Finish() - resultVar0, resultVar1 := a.app.SearchPostsInTeam(teamId, paramsList) + resultVar0, resultVar1 := a.app.SearchPostsInTeam(teamID, paramsList) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -12890,7 +12890,7 @@ func (a *OpenTracingAppLayer) SearchPostsInTeam(teamId string, paramsList []*mod return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) SearchPostsInTeamForUser(terms string, userId string, teamId string, isOrSearch bool, includeDeletedChannels bool, timeZoneOffset int, page int, perPage int) (*model.PostSearchResults, *model.AppError) { +func (a *OpenTracingAppLayer) SearchPostsInTeamForUser(terms string, userID string, teamID string, isOrSearch bool, includeDeletedChannels bool, timeZoneOffset int, page int, perPage int) (*model.PostSearchResults, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchPostsInTeamForUser") @@ -12902,7 +12902,7 @@ func (a *OpenTracingAppLayer) SearchPostsInTeamForUser(terms string, userId stri }() defer span.Finish() - resultVar0, resultVar1 := a.app.SearchPostsInTeamForUser(terms, userId, teamId, isOrSearch, includeDeletedChannels, timeZoneOffset, page, perPage) + resultVar0, resultVar1 := a.app.SearchPostsInTeamForUser(terms, userID, teamID, isOrSearch, includeDeletedChannels, timeZoneOffset, page, perPage) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -13044,7 +13044,7 @@ func (a *OpenTracingAppLayer) SearchUsersInGroup(groupID string, term string, op return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) SearchUsersInTeam(teamId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { +func (a *OpenTracingAppLayer) SearchUsersInTeam(teamID string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchUsersInTeam") @@ -13056,7 +13056,7 @@ func (a *OpenTracingAppLayer) SearchUsersInTeam(teamId string, term string, opti }() defer span.Finish() - resultVar0, resultVar1 := a.app.SearchUsersInTeam(teamId, term, options) + resultVar0, resultVar1 := a.app.SearchUsersInTeam(teamID, term, options) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -13066,7 +13066,7 @@ func (a *OpenTracingAppLayer) SearchUsersInTeam(teamId string, term string, opti return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) SearchUsersNotInChannel(teamId string, channelId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { +func (a *OpenTracingAppLayer) SearchUsersNotInChannel(teamID string, channelId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchUsersNotInChannel") @@ -13078,7 +13078,7 @@ func (a *OpenTracingAppLayer) SearchUsersNotInChannel(teamId string, channelId s }() defer span.Finish() - resultVar0, resultVar1 := a.app.SearchUsersNotInChannel(teamId, channelId, term, options) + resultVar0, resultVar1 := a.app.SearchUsersNotInChannel(teamID, channelId, term, options) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -13220,7 +13220,7 @@ func (a *OpenTracingAppLayer) SendEmailVerification(user *model.User, newEmail s return resultVar0 } -func (a *OpenTracingAppLayer) SendEphemeralPost(userId string, post *model.Post) *model.Post { +func (a *OpenTracingAppLayer) SendEphemeralPost(userID string, post *model.Post) *model.Post { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendEphemeralPost") @@ -13232,7 +13232,7 @@ func (a *OpenTracingAppLayer) SendEphemeralPost(userId string, post *model.Post) }() defer span.Finish() - resultVar0 := a.app.SendEphemeralPost(userId, post) + resultVar0 := a.app.SendEphemeralPost(userID, post) return resultVar0 } @@ -13436,7 +13436,7 @@ func (a *OpenTracingAppLayer) SessionHasPermissionToAny(session model.Session, p return resultVar0 } -func (a *OpenTracingAppLayer) SessionHasPermissionToCategory(session model.Session, userId string, teamId string, categoryId string) bool { +func (a *OpenTracingAppLayer) SessionHasPermissionToCategory(session model.Session, userID string, teamID string, categoryId string) bool { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToCategory") @@ -13448,7 +13448,7 @@ func (a *OpenTracingAppLayer) SessionHasPermissionToCategory(session model.Sessi }() defer span.Finish() - resultVar0 := a.app.SessionHasPermissionToCategory(session, userId, teamId, categoryId) + resultVar0 := a.app.SessionHasPermissionToCategory(session, userID, teamID, categoryId) return resultVar0 } @@ -13509,7 +13509,7 @@ func (a *OpenTracingAppLayer) SessionHasPermissionToManageBot(session model.Sess return resultVar0 } -func (a *OpenTracingAppLayer) SessionHasPermissionToTeam(session model.Session, teamId string, permission *model.Permission) bool { +func (a *OpenTracingAppLayer) SessionHasPermissionToTeam(session model.Session, teamID string, permission *model.Permission) bool { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToTeam") @@ -13521,12 +13521,12 @@ func (a *OpenTracingAppLayer) SessionHasPermissionToTeam(session model.Session, }() defer span.Finish() - resultVar0 := a.app.SessionHasPermissionToTeam(session, teamId, permission) + resultVar0 := a.app.SessionHasPermissionToTeam(session, teamID, permission) return resultVar0 } -func (a *OpenTracingAppLayer) SessionHasPermissionToUser(session model.Session, userId string) bool { +func (a *OpenTracingAppLayer) SessionHasPermissionToUser(session model.Session, userID string) bool { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToUser") @@ -13538,12 +13538,12 @@ func (a *OpenTracingAppLayer) SessionHasPermissionToUser(session model.Session, }() defer span.Finish() - resultVar0 := a.app.SessionHasPermissionToUser(session, userId) + resultVar0 := a.app.SessionHasPermissionToUser(session, userID) return resultVar0 } -func (a *OpenTracingAppLayer) SessionHasPermissionToUserOrBot(session model.Session, userId string) bool { +func (a *OpenTracingAppLayer) SessionHasPermissionToUserOrBot(session model.Session, userID string) bool { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToUserOrBot") @@ -13555,7 +13555,7 @@ func (a *OpenTracingAppLayer) SessionHasPermissionToUserOrBot(session model.Sess }() defer span.Finish() - resultVar0 := a.app.SessionHasPermissionToUserOrBot(session, userId) + resultVar0 := a.app.SessionHasPermissionToUserOrBot(session, userID) return resultVar0 } @@ -13577,7 +13577,7 @@ func (a *OpenTracingAppLayer) SessionIsRegistered(session model.Session) bool { return resultVar0 } -func (a *OpenTracingAppLayer) SetActiveChannel(userId string, channelId string) *model.AppError { +func (a *OpenTracingAppLayer) SetActiveChannel(userID string, channelId string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetActiveChannel") @@ -13589,7 +13589,7 @@ func (a *OpenTracingAppLayer) SetActiveChannel(userId string, channelId string) }() defer span.Finish() - resultVar0 := a.app.SetActiveChannel(userId, channelId) + resultVar0 := a.app.SetActiveChannel(userID, channelId) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -13783,7 +13783,7 @@ func (a *OpenTracingAppLayer) SetPluginsEnvironment(pluginsEnvironment *plugin.E a.app.SetPluginsEnvironment(pluginsEnvironment) } -func (a *OpenTracingAppLayer) SetProfileImage(userId string, imageData *multipart.FileHeader) *model.AppError { +func (a *OpenTracingAppLayer) SetProfileImage(userID string, imageData *multipart.FileHeader) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetProfileImage") @@ -13795,7 +13795,7 @@ func (a *OpenTracingAppLayer) SetProfileImage(userId string, imageData *multipar }() defer span.Finish() - resultVar0 := a.app.SetProfileImage(userId, imageData) + resultVar0 := a.app.SetProfileImage(userID, imageData) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -13805,7 +13805,7 @@ func (a *OpenTracingAppLayer) SetProfileImage(userId string, imageData *multipar return resultVar0 } -func (a *OpenTracingAppLayer) SetProfileImageFromFile(userId string, file io.Reader) *model.AppError { +func (a *OpenTracingAppLayer) SetProfileImageFromFile(userID string, file io.Reader) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetProfileImageFromFile") @@ -13817,7 +13817,7 @@ func (a *OpenTracingAppLayer) SetProfileImageFromFile(userId string, file io.Rea }() defer span.Finish() - resultVar0 := a.app.SetProfileImageFromFile(userId, file) + resultVar0 := a.app.SetProfileImageFromFile(userID, file) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -13827,7 +13827,7 @@ func (a *OpenTracingAppLayer) SetProfileImageFromFile(userId string, file io.Rea return resultVar0 } -func (a *OpenTracingAppLayer) SetProfileImageFromMultiPartFile(userId string, file multipart.File) *model.AppError { +func (a *OpenTracingAppLayer) SetProfileImageFromMultiPartFile(userID string, file multipart.File) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetProfileImageFromMultiPartFile") @@ -13839,7 +13839,7 @@ func (a *OpenTracingAppLayer) SetProfileImageFromMultiPartFile(userId string, fi }() defer span.Finish() - resultVar0 := a.app.SetProfileImageFromMultiPartFile(userId, file) + resultVar0 := a.app.SetProfileImageFromMultiPartFile(userID, file) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -13901,7 +13901,7 @@ func (a *OpenTracingAppLayer) SetSessionExpireInDays(session *model.Session, day a.app.SetSessionExpireInDays(session, days) } -func (a *OpenTracingAppLayer) SetStatusAwayIfNeeded(userId string, manual bool) { +func (a *OpenTracingAppLayer) SetStatusAwayIfNeeded(userID string, manual bool) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusAwayIfNeeded") @@ -13913,10 +13913,10 @@ func (a *OpenTracingAppLayer) SetStatusAwayIfNeeded(userId string, manual bool) }() defer span.Finish() - a.app.SetStatusAwayIfNeeded(userId, manual) + a.app.SetStatusAwayIfNeeded(userID, manual) } -func (a *OpenTracingAppLayer) SetStatusDoNotDisturb(userId string) { +func (a *OpenTracingAppLayer) SetStatusDoNotDisturb(userID string) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusDoNotDisturb") @@ -13928,10 +13928,10 @@ func (a *OpenTracingAppLayer) SetStatusDoNotDisturb(userId string) { }() defer span.Finish() - a.app.SetStatusDoNotDisturb(userId) + a.app.SetStatusDoNotDisturb(userID) } -func (a *OpenTracingAppLayer) SetStatusLastActivityAt(userId string, activityAt int64) { +func (a *OpenTracingAppLayer) SetStatusLastActivityAt(userID string, activityAt int64) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusLastActivityAt") @@ -13943,10 +13943,10 @@ func (a *OpenTracingAppLayer) SetStatusLastActivityAt(userId string, activityAt }() defer span.Finish() - a.app.SetStatusLastActivityAt(userId, activityAt) + a.app.SetStatusLastActivityAt(userID, activityAt) } -func (a *OpenTracingAppLayer) SetStatusOffline(userId string, manual bool) { +func (a *OpenTracingAppLayer) SetStatusOffline(userID string, manual bool) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusOffline") @@ -13958,10 +13958,10 @@ func (a *OpenTracingAppLayer) SetStatusOffline(userId string, manual bool) { }() defer span.Finish() - a.app.SetStatusOffline(userId, manual) + a.app.SetStatusOffline(userID, manual) } -func (a *OpenTracingAppLayer) SetStatusOnline(userId string, manual bool) { +func (a *OpenTracingAppLayer) SetStatusOnline(userID string, manual bool) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusOnline") @@ -13973,10 +13973,10 @@ func (a *OpenTracingAppLayer) SetStatusOnline(userId string, manual bool) { }() defer span.Finish() - a.app.SetStatusOnline(userId, manual) + a.app.SetStatusOnline(userID, manual) } -func (a *OpenTracingAppLayer) SetStatusOutOfOffice(userId string) { +func (a *OpenTracingAppLayer) SetStatusOutOfOffice(userID string) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusOutOfOffice") @@ -13988,10 +13988,10 @@ func (a *OpenTracingAppLayer) SetStatusOutOfOffice(userId string) { }() defer span.Finish() - a.app.SetStatusOutOfOffice(userId) + a.app.SetStatusOutOfOffice(userID) } -func (a *OpenTracingAppLayer) SetTeamIcon(teamId string, imageData *multipart.FileHeader) *model.AppError { +func (a *OpenTracingAppLayer) SetTeamIcon(teamID string, imageData *multipart.FileHeader) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetTeamIcon") @@ -14003,7 +14003,7 @@ func (a *OpenTracingAppLayer) SetTeamIcon(teamId string, imageData *multipart.Fi }() defer span.Finish() - resultVar0 := a.app.SetTeamIcon(teamId, imageData) + resultVar0 := a.app.SetTeamIcon(teamID, imageData) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -14035,7 +14035,7 @@ func (a *OpenTracingAppLayer) SetTeamIconFromFile(team *model.Team, file io.Read return resultVar0 } -func (a *OpenTracingAppLayer) SetTeamIconFromMultiPartFile(teamId string, file multipart.File) *model.AppError { +func (a *OpenTracingAppLayer) SetTeamIconFromMultiPartFile(teamID string, file multipart.File) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetTeamIconFromMultiPartFile") @@ -14047,7 +14047,7 @@ func (a *OpenTracingAppLayer) SetTeamIconFromMultiPartFile(teamId string, file m }() defer span.Finish() - resultVar0 := a.app.SetTeamIconFromMultiPartFile(teamId, file) + resultVar0 := a.app.SetTeamIconFromMultiPartFile(teamID, file) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -14079,7 +14079,7 @@ func (a *OpenTracingAppLayer) SlackImport(fileData multipart.File, fileSize int6 return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) SoftDeleteTeam(teamId string) *model.AppError { +func (a *OpenTracingAppLayer) SoftDeleteTeam(teamID string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SoftDeleteTeam") @@ -14091,7 +14091,7 @@ func (a *OpenTracingAppLayer) SoftDeleteTeam(teamId string) *model.AppError { }() defer span.Finish() - resultVar0 := a.app.SoftDeleteTeam(teamId) + resultVar0 := a.app.SoftDeleteTeam(teamID) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -14405,7 +14405,7 @@ func (a *OpenTracingAppLayer) TestElasticsearch(cfg *model.Config) *model.AppErr return resultVar0 } -func (a *OpenTracingAppLayer) TestEmail(userId string, cfg *model.Config) *model.AppError { +func (a *OpenTracingAppLayer) TestEmail(userID string, cfg *model.Config) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TestEmail") @@ -14417,7 +14417,7 @@ func (a *OpenTracingAppLayer) TestEmail(userId string, cfg *model.Config) *model }() defer span.Finish() - resultVar0 := a.app.TestEmail(userId, cfg) + resultVar0 := a.app.TestEmail(userID, cfg) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -14515,7 +14515,7 @@ func (a *OpenTracingAppLayer) TestSiteURL(siteURL string) *model.AppError { return resultVar0 } -func (a *OpenTracingAppLayer) ToggleMuteChannel(channelId string, userId string) (*model.ChannelMember, *model.AppError) { +func (a *OpenTracingAppLayer) ToggleMuteChannel(channelId string, userID string) (*model.ChannelMember, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ToggleMuteChannel") @@ -14527,7 +14527,7 @@ func (a *OpenTracingAppLayer) ToggleMuteChannel(channelId string, userId string) }() defer span.Finish() - resultVar0, resultVar1 := a.app.ToggleMuteChannel(channelId, userId) + resultVar0, resultVar1 := a.app.ToggleMuteChannel(channelId, userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -14569,7 +14569,7 @@ func (a *OpenTracingAppLayer) TriggerWebhook(payload *model.OutgoingWebhookPaylo a.app.TriggerWebhook(payload, hook, post, channel) } -func (a *OpenTracingAppLayer) UnregisterPluginCommand(pluginId string, teamId string, trigger string) { +func (a *OpenTracingAppLayer) UnregisterPluginCommand(pluginId string, teamID string, trigger string) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UnregisterPluginCommand") @@ -14581,7 +14581,7 @@ func (a *OpenTracingAppLayer) UnregisterPluginCommand(pluginId string, teamId st }() defer span.Finish() - a.app.UnregisterPluginCommand(pluginId, teamId, trigger) + a.app.UnregisterPluginCommand(pluginId, teamID, trigger) } func (a *OpenTracingAppLayer) UnregisterPluginCommands(pluginId string) { @@ -14687,7 +14687,7 @@ func (a *OpenTracingAppLayer) UpdateChannel(channel *model.Channel) (*model.Chan return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) UpdateChannelLastViewedAt(channelIds []string, userId string) *model.AppError { +func (a *OpenTracingAppLayer) UpdateChannelLastViewedAt(channelIds []string, userID string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateChannelLastViewedAt") @@ -14699,7 +14699,7 @@ func (a *OpenTracingAppLayer) UpdateChannelLastViewedAt(channelIds []string, use }() defer span.Finish() - resultVar0 := a.app.UpdateChannelLastViewedAt(channelIds, userId) + resultVar0 := a.app.UpdateChannelLastViewedAt(channelIds, userID) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -14709,7 +14709,7 @@ func (a *OpenTracingAppLayer) UpdateChannelLastViewedAt(channelIds []string, use return resultVar0 } -func (a *OpenTracingAppLayer) UpdateChannelMemberNotifyProps(data map[string]string, channelId string, userId string) (*model.ChannelMember, *model.AppError) { +func (a *OpenTracingAppLayer) UpdateChannelMemberNotifyProps(data map[string]string, channelId string, userID string) (*model.ChannelMember, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateChannelMemberNotifyProps") @@ -14721,7 +14721,7 @@ func (a *OpenTracingAppLayer) UpdateChannelMemberNotifyProps(data map[string]str }() defer span.Finish() - resultVar0, resultVar1 := a.app.UpdateChannelMemberNotifyProps(data, channelId, userId) + resultVar0, resultVar1 := a.app.UpdateChannelMemberNotifyProps(data, channelId, userID) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -14731,7 +14731,7 @@ func (a *OpenTracingAppLayer) UpdateChannelMemberNotifyProps(data map[string]str return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) UpdateChannelMemberRoles(channelId string, userId string, newRoles string) (*model.ChannelMember, *model.AppError) { +func (a *OpenTracingAppLayer) UpdateChannelMemberRoles(channelId string, userID string, newRoles string) (*model.ChannelMember, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateChannelMemberRoles") @@ -14743,7 +14743,7 @@ func (a *OpenTracingAppLayer) UpdateChannelMemberRoles(channelId string, userId }() defer span.Finish() - resultVar0, resultVar1 := a.app.UpdateChannelMemberRoles(channelId, userId, newRoles) + resultVar0, resultVar1 := a.app.UpdateChannelMemberRoles(channelId, userID, newRoles) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -14753,7 +14753,7 @@ func (a *OpenTracingAppLayer) UpdateChannelMemberRoles(channelId string, userId return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) UpdateChannelMemberSchemeRoles(channelId string, userId string, isSchemeGuest bool, isSchemeUser bool, isSchemeAdmin bool) (*model.ChannelMember, *model.AppError) { +func (a *OpenTracingAppLayer) UpdateChannelMemberSchemeRoles(channelId string, userID string, isSchemeGuest bool, isSchemeUser bool, isSchemeAdmin bool) (*model.ChannelMember, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateChannelMemberSchemeRoles") @@ -14765,7 +14765,7 @@ func (a *OpenTracingAppLayer) UpdateChannelMemberSchemeRoles(channelId string, u }() defer span.Finish() - resultVar0, resultVar1 := a.app.UpdateChannelMemberSchemeRoles(channelId, userId, isSchemeGuest, isSchemeUser, isSchemeAdmin) + resultVar0, resultVar1 := a.app.UpdateChannelMemberSchemeRoles(channelId, userID, isSchemeGuest, isSchemeUser, isSchemeAdmin) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -14856,7 +14856,7 @@ func (a *OpenTracingAppLayer) UpdateConfig(f func(*model.Config)) { a.app.UpdateConfig(f) } -func (a *OpenTracingAppLayer) UpdateEphemeralPost(userId string, post *model.Post) *model.Post { +func (a *OpenTracingAppLayer) UpdateEphemeralPost(userID string, post *model.Post) *model.Post { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateEphemeralPost") @@ -14868,7 +14868,7 @@ func (a *OpenTracingAppLayer) UpdateEphemeralPost(userId string, post *model.Pos }() defer span.Finish() - resultVar0 := a.app.UpdateEphemeralPost(userId, post) + resultVar0 := a.app.UpdateEphemeralPost(userID, post) return resultVar0 } @@ -14939,7 +14939,7 @@ func (a *OpenTracingAppLayer) UpdateHashedPassword(user *model.User, newHashedPa return resultVar0 } -func (a *OpenTracingAppLayer) UpdateHashedPasswordByUserId(userId string, newHashedPassword string) *model.AppError { +func (a *OpenTracingAppLayer) UpdateHashedPasswordByUserId(userID string, newHashedPassword string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateHashedPasswordByUserId") @@ -14951,7 +14951,7 @@ func (a *OpenTracingAppLayer) UpdateHashedPasswordByUserId(userId string, newHas }() defer span.Finish() - resultVar0 := a.app.UpdateHashedPasswordByUserId(userId, newHashedPassword) + resultVar0 := a.app.UpdateHashedPasswordByUserId(userID, newHashedPassword) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -14998,7 +14998,7 @@ func (a *OpenTracingAppLayer) UpdateLastActivityAtIfNeeded(session model.Session a.app.UpdateLastActivityAtIfNeeded(session) } -func (a *OpenTracingAppLayer) UpdateMfa(activate bool, userId string, token string) *model.AppError { +func (a *OpenTracingAppLayer) UpdateMfa(activate bool, userID string, token string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateMfa") @@ -15010,7 +15010,7 @@ func (a *OpenTracingAppLayer) UpdateMfa(activate bool, userId string, token stri }() defer span.Finish() - resultVar0 := a.app.UpdateMfa(activate, userId, token) + resultVar0 := a.app.UpdateMfa(activate, userID, token) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -15020,7 +15020,7 @@ func (a *OpenTracingAppLayer) UpdateMfa(activate bool, userId string, token stri return resultVar0 } -func (a *OpenTracingAppLayer) UpdateMobileAppBadge(userId string) { +func (a *OpenTracingAppLayer) UpdateMobileAppBadge(userID string) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateMobileAppBadge") @@ -15032,7 +15032,7 @@ func (a *OpenTracingAppLayer) UpdateMobileAppBadge(userId string) { }() defer span.Finish() - a.app.UpdateMobileAppBadge(userId) + a.app.UpdateMobileAppBadge(userID) } func (a *OpenTracingAppLayer) UpdateOAuthUserAttrs(userData io.Reader, user *model.User, provider einterfaces.OauthProvider, service string, tokenUser *model.User) *model.AppError { @@ -15123,7 +15123,7 @@ func (a *OpenTracingAppLayer) UpdatePassword(user *model.User, newPassword strin return resultVar0 } -func (a *OpenTracingAppLayer) UpdatePasswordAsUser(userId string, currentPassword string, newPassword string) *model.AppError { +func (a *OpenTracingAppLayer) UpdatePasswordAsUser(userID string, currentPassword string, newPassword string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdatePasswordAsUser") @@ -15135,7 +15135,7 @@ func (a *OpenTracingAppLayer) UpdatePasswordAsUser(userId string, currentPasswor }() defer span.Finish() - resultVar0 := a.app.UpdatePasswordAsUser(userId, currentPassword, newPassword) + resultVar0 := a.app.UpdatePasswordAsUser(userID, currentPassword, newPassword) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -15145,7 +15145,7 @@ func (a *OpenTracingAppLayer) UpdatePasswordAsUser(userId string, currentPasswor return resultVar0 } -func (a *OpenTracingAppLayer) UpdatePasswordByUserIdSendEmail(userId string, newPassword string, method string) *model.AppError { +func (a *OpenTracingAppLayer) UpdatePasswordByUserIdSendEmail(userID string, newPassword string, method string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdatePasswordByUserIdSendEmail") @@ -15157,7 +15157,7 @@ func (a *OpenTracingAppLayer) UpdatePasswordByUserIdSendEmail(userId string, new }() defer span.Finish() - resultVar0 := a.app.UpdatePasswordByUserIdSendEmail(userId, newPassword, method) + resultVar0 := a.app.UpdatePasswordByUserIdSendEmail(userID, newPassword, method) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -15211,7 +15211,7 @@ func (a *OpenTracingAppLayer) UpdatePost(post *model.Post, safeUpdate bool) (*mo return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) UpdatePreferences(userId string, preferences model.Preferences) *model.AppError { +func (a *OpenTracingAppLayer) UpdatePreferences(userID string, preferences model.Preferences) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdatePreferences") @@ -15223,7 +15223,7 @@ func (a *OpenTracingAppLayer) UpdatePreferences(userId string, preferences model }() defer span.Finish() - resultVar0 := a.app.UpdatePreferences(userId, preferences) + resultVar0 := a.app.UpdatePreferences(userID, preferences) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -15299,7 +15299,7 @@ func (a *OpenTracingAppLayer) UpdateScheme(scheme *model.Scheme) (*model.Scheme, return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) UpdateSessionsIsGuest(userId string, isGuest bool) { +func (a *OpenTracingAppLayer) UpdateSessionsIsGuest(userID string, isGuest bool) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateSessionsIsGuest") @@ -15311,10 +15311,10 @@ func (a *OpenTracingAppLayer) UpdateSessionsIsGuest(userId string, isGuest bool) }() defer span.Finish() - a.app.UpdateSessionsIsGuest(userId, isGuest) + a.app.UpdateSessionsIsGuest(userID, isGuest) } -func (a *OpenTracingAppLayer) UpdateSidebarCategories(userId string, teamId string, categories []*model.SidebarCategoryWithChannels) ([]*model.SidebarCategoryWithChannels, *model.AppError) { +func (a *OpenTracingAppLayer) UpdateSidebarCategories(userID string, teamID string, categories []*model.SidebarCategoryWithChannels) ([]*model.SidebarCategoryWithChannels, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateSidebarCategories") @@ -15326,7 +15326,7 @@ func (a *OpenTracingAppLayer) UpdateSidebarCategories(userId string, teamId stri }() defer span.Finish() - resultVar0, resultVar1 := a.app.UpdateSidebarCategories(userId, teamId, categories) + resultVar0, resultVar1 := a.app.UpdateSidebarCategories(userID, teamID, categories) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -15336,7 +15336,7 @@ func (a *OpenTracingAppLayer) UpdateSidebarCategories(userId string, teamId stri return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) UpdateSidebarCategoryOrder(userId string, teamId string, categoryOrder []string) *model.AppError { +func (a *OpenTracingAppLayer) UpdateSidebarCategoryOrder(userID string, teamID string, categoryOrder []string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateSidebarCategoryOrder") @@ -15348,7 +15348,7 @@ func (a *OpenTracingAppLayer) UpdateSidebarCategoryOrder(userId string, teamId s }() defer span.Finish() - resultVar0 := a.app.UpdateSidebarCategoryOrder(userId, teamId, categoryOrder) + resultVar0 := a.app.UpdateSidebarCategoryOrder(userID, teamID, categoryOrder) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -15380,7 +15380,7 @@ func (a *OpenTracingAppLayer) UpdateTeam(team *model.Team) (*model.Team, *model. return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) UpdateTeamMemberRoles(teamId string, userId string, newRoles string) (*model.TeamMember, *model.AppError) { +func (a *OpenTracingAppLayer) UpdateTeamMemberRoles(teamID string, userID string, newRoles string) (*model.TeamMember, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateTeamMemberRoles") @@ -15392,7 +15392,7 @@ func (a *OpenTracingAppLayer) UpdateTeamMemberRoles(teamId string, userId string }() defer span.Finish() - resultVar0, resultVar1 := a.app.UpdateTeamMemberRoles(teamId, userId, newRoles) + resultVar0, resultVar1 := a.app.UpdateTeamMemberRoles(teamID, userID, newRoles) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -15402,7 +15402,7 @@ func (a *OpenTracingAppLayer) UpdateTeamMemberRoles(teamId string, userId string return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) UpdateTeamMemberSchemeRoles(teamId string, userId string, isSchemeGuest bool, isSchemeUser bool, isSchemeAdmin bool) (*model.TeamMember, *model.AppError) { +func (a *OpenTracingAppLayer) UpdateTeamMemberSchemeRoles(teamID string, userID string, isSchemeGuest bool, isSchemeUser bool, isSchemeAdmin bool) (*model.TeamMember, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateTeamMemberSchemeRoles") @@ -15414,7 +15414,7 @@ func (a *OpenTracingAppLayer) UpdateTeamMemberSchemeRoles(teamId string, userId }() defer span.Finish() - resultVar0, resultVar1 := a.app.UpdateTeamMemberSchemeRoles(teamId, userId, isSchemeGuest, isSchemeUser, isSchemeAdmin) + resultVar0, resultVar1 := a.app.UpdateTeamMemberSchemeRoles(teamID, userID, isSchemeGuest, isSchemeUser, isSchemeAdmin) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -15424,7 +15424,7 @@ func (a *OpenTracingAppLayer) UpdateTeamMemberSchemeRoles(teamId string, userId return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) UpdateTeamPrivacy(teamId string, teamType string, allowOpenInvite bool) *model.AppError { +func (a *OpenTracingAppLayer) UpdateTeamPrivacy(teamID string, teamType string, allowOpenInvite bool) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateTeamPrivacy") @@ -15436,7 +15436,7 @@ func (a *OpenTracingAppLayer) UpdateTeamPrivacy(teamId string, teamType string, }() defer span.Finish() - resultVar0 := a.app.UpdateTeamPrivacy(teamId, teamType, allowOpenInvite) + resultVar0 := a.app.UpdateTeamPrivacy(teamID, teamType, allowOpenInvite) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -15468,7 +15468,7 @@ func (a *OpenTracingAppLayer) UpdateTeamScheme(team *model.Team) (*model.Team, * return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) UpdateThreadFollowForUser(userId string, threadId string, state bool) *model.AppError { +func (a *OpenTracingAppLayer) UpdateThreadFollowForUser(userID string, threadId string, state bool) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateThreadFollowForUser") @@ -15480,7 +15480,7 @@ func (a *OpenTracingAppLayer) UpdateThreadFollowForUser(userId string, threadId }() defer span.Finish() - resultVar0 := a.app.UpdateThreadFollowForUser(userId, threadId, state) + resultVar0 := a.app.UpdateThreadFollowForUser(userID, threadId, state) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -15490,7 +15490,7 @@ func (a *OpenTracingAppLayer) UpdateThreadFollowForUser(userId string, threadId return resultVar0 } -func (a *OpenTracingAppLayer) UpdateThreadReadForUser(userId string, teamId string, threadId string, timestamp int64) *model.AppError { +func (a *OpenTracingAppLayer) UpdateThreadReadForUser(userID string, teamID string, threadId string, timestamp int64) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateThreadReadForUser") @@ -15502,7 +15502,7 @@ func (a *OpenTracingAppLayer) UpdateThreadReadForUser(userId string, teamId stri }() defer span.Finish() - resultVar0 := a.app.UpdateThreadReadForUser(userId, teamId, threadId, timestamp) + resultVar0 := a.app.UpdateThreadReadForUser(userID, teamID, threadId, timestamp) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -15512,7 +15512,7 @@ func (a *OpenTracingAppLayer) UpdateThreadReadForUser(userId string, teamId stri return resultVar0 } -func (a *OpenTracingAppLayer) UpdateThreadsReadForUser(userId string, teamId string) *model.AppError { +func (a *OpenTracingAppLayer) UpdateThreadsReadForUser(userID string, teamID string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateThreadsReadForUser") @@ -15524,7 +15524,7 @@ func (a *OpenTracingAppLayer) UpdateThreadsReadForUser(userId string, teamId str }() defer span.Finish() - resultVar0 := a.app.UpdateThreadsReadForUser(userId, teamId) + resultVar0 := a.app.UpdateThreadsReadForUser(userID, teamID) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -15556,7 +15556,7 @@ func (a *OpenTracingAppLayer) UpdateUser(user *model.User, sendNotifications boo return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) UpdateUserActive(userId string, active bool) *model.AppError { +func (a *OpenTracingAppLayer) UpdateUserActive(userID string, active bool) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUserActive") @@ -15568,7 +15568,7 @@ func (a *OpenTracingAppLayer) UpdateUserActive(userId string, active bool) *mode }() defer span.Finish() - resultVar0 := a.app.UpdateUserActive(userId, active) + resultVar0 := a.app.UpdateUserActive(userID, active) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -15600,7 +15600,7 @@ func (a *OpenTracingAppLayer) UpdateUserAsUser(user *model.User, asAdmin bool) ( return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) UpdateUserAuth(userId string, userAuth *model.UserAuth) (*model.UserAuth, *model.AppError) { +func (a *OpenTracingAppLayer) UpdateUserAuth(userID string, userAuth *model.UserAuth) (*model.UserAuth, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUserAuth") @@ -15612,7 +15612,7 @@ func (a *OpenTracingAppLayer) UpdateUserAuth(userId string, userAuth *model.User }() defer span.Finish() - resultVar0, resultVar1 := a.app.UpdateUserAuth(userId, userAuth) + resultVar0, resultVar1 := a.app.UpdateUserAuth(userID, userAuth) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -15622,7 +15622,7 @@ func (a *OpenTracingAppLayer) UpdateUserAuth(userId string, userAuth *model.User return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) UpdateUserNotifyProps(userId string, props map[string]string, sendNotifications bool) (*model.User, *model.AppError) { +func (a *OpenTracingAppLayer) UpdateUserNotifyProps(userID string, props map[string]string, sendNotifications bool) (*model.User, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUserNotifyProps") @@ -15634,7 +15634,7 @@ func (a *OpenTracingAppLayer) UpdateUserNotifyProps(userId string, props map[str }() defer span.Finish() - resultVar0, resultVar1 := a.app.UpdateUserNotifyProps(userId, props, sendNotifications) + resultVar0, resultVar1 := a.app.UpdateUserNotifyProps(userID, props, sendNotifications) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -15644,7 +15644,7 @@ func (a *OpenTracingAppLayer) UpdateUserNotifyProps(userId string, props map[str return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) UpdateUserRoles(userId string, newRoles string, sendWebSocketEvent bool) (*model.User, *model.AppError) { +func (a *OpenTracingAppLayer) UpdateUserRoles(userID string, newRoles string, sendWebSocketEvent bool) (*model.User, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUserRoles") @@ -15656,7 +15656,7 @@ func (a *OpenTracingAppLayer) UpdateUserRoles(userId string, newRoles string, se }() defer span.Finish() - resultVar0, resultVar1 := a.app.UpdateUserRoles(userId, newRoles, sendWebSocketEvent) + resultVar0, resultVar1 := a.app.UpdateUserRoles(userID, newRoles, sendWebSocketEvent) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -15666,7 +15666,7 @@ func (a *OpenTracingAppLayer) UpdateUserRoles(userId string, newRoles string, se return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) UpdateViewedProductNotices(userId string, noticeIds []string) *model.AppError { +func (a *OpenTracingAppLayer) UpdateViewedProductNotices(userID string, noticeIds []string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateViewedProductNotices") @@ -15678,7 +15678,7 @@ func (a *OpenTracingAppLayer) UpdateViewedProductNotices(userId string, noticeId }() defer span.Finish() - resultVar0 := a.app.UpdateViewedProductNotices(userId, noticeIds) + resultVar0 := a.app.UpdateViewedProductNotices(userID, noticeIds) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -15688,7 +15688,7 @@ func (a *OpenTracingAppLayer) UpdateViewedProductNotices(userId string, noticeId return resultVar0 } -func (a *OpenTracingAppLayer) UpdateViewedProductNoticesForNewUser(userId string) { +func (a *OpenTracingAppLayer) UpdateViewedProductNoticesForNewUser(userID string) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateViewedProductNoticesForNewUser") @@ -15700,7 +15700,7 @@ func (a *OpenTracingAppLayer) UpdateViewedProductNoticesForNewUser(userId string }() defer span.Finish() - a.app.UpdateViewedProductNoticesForNewUser(userId) + a.app.UpdateViewedProductNoticesForNewUser(userID) } func (a *OpenTracingAppLayer) UpdateWebConnUserActivity(session model.Session, activityAt int64) { @@ -15806,7 +15806,7 @@ func (a *OpenTracingAppLayer) UploadFileX(channelId string, name string, input i return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) UploadFiles(teamId string, channelId string, userId string, files []io.ReadCloser, filenames []string, clientIds []string, now time.Time) (*model.FileUploadResponse, *model.AppError) { +func (a *OpenTracingAppLayer) UploadFiles(teamID string, channelId string, userID string, files []io.ReadCloser, filenames []string, clientIds []string, now time.Time) (*model.FileUploadResponse, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UploadFiles") @@ -15818,7 +15818,7 @@ func (a *OpenTracingAppLayer) UploadFiles(teamId string, channelId string, userI }() defer span.Finish() - resultVar0, resultVar1 := a.app.UploadFiles(teamId, channelId, userId, files, filenames, clientIds, now) + resultVar0, resultVar1 := a.app.UploadFiles(teamID, channelId, userID, files, filenames, clientIds, now) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -15828,7 +15828,7 @@ func (a *OpenTracingAppLayer) UploadFiles(teamId string, channelId string, userI return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) UploadMultipartFiles(teamId string, channelId string, userId string, fileHeaders []*multipart.FileHeader, clientIds []string, now time.Time) (*model.FileUploadResponse, *model.AppError) { +func (a *OpenTracingAppLayer) UploadMultipartFiles(teamID string, channelId string, userID string, fileHeaders []*multipart.FileHeader, clientIds []string, now time.Time) (*model.FileUploadResponse, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UploadMultipartFiles") @@ -15840,7 +15840,7 @@ func (a *OpenTracingAppLayer) UploadMultipartFiles(teamId string, channelId stri }() defer span.Finish() - resultVar0, resultVar1 := a.app.UploadMultipartFiles(teamId, channelId, userId, fileHeaders, clientIds, now) + resultVar0, resultVar1 := a.app.UploadMultipartFiles(teamID, channelId, userID, fileHeaders, clientIds, now) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -15894,7 +15894,7 @@ func (a *OpenTracingAppLayer) UpsertGroupSyncable(groupSyncable *model.GroupSync return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) UserCanSeeOtherUser(userId string, otherUserId string) (bool, *model.AppError) { +func (a *OpenTracingAppLayer) UserCanSeeOtherUser(userID string, otherUserId string) (bool, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UserCanSeeOtherUser") @@ -15906,7 +15906,7 @@ func (a *OpenTracingAppLayer) UserCanSeeOtherUser(userId string, otherUserId str }() defer span.Finish() - resultVar0, resultVar1 := a.app.UserCanSeeOtherUser(userId, otherUserId) + resultVar0, resultVar1 := a.app.UserCanSeeOtherUser(userID, otherUserId) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -15982,7 +15982,7 @@ func (a *OpenTracingAppLayer) VerifyPlugin(plugin io.ReadSeeker, signature io.Re return resultVar0 } -func (a *OpenTracingAppLayer) VerifyUserEmail(userId string, email string) *model.AppError { +func (a *OpenTracingAppLayer) VerifyUserEmail(userID string, email string) *model.AppError { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.VerifyUserEmail") @@ -15994,7 +15994,7 @@ func (a *OpenTracingAppLayer) VerifyUserEmail(userId string, email string) *mode }() defer span.Finish() - resultVar0 := a.app.VerifyUserEmail(userId, email) + resultVar0 := a.app.VerifyUserEmail(userID, email) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -16004,7 +16004,7 @@ func (a *OpenTracingAppLayer) VerifyUserEmail(userId string, email string) *mode return resultVar0 } -func (a *OpenTracingAppLayer) ViewChannel(view *model.ChannelView, userId string, currentSessionId string) (map[string]int64, *model.AppError) { +func (a *OpenTracingAppLayer) ViewChannel(view *model.ChannelView, userID string, currentSessionId string) (map[string]int64, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ViewChannel") @@ -16016,7 +16016,7 @@ func (a *OpenTracingAppLayer) ViewChannel(view *model.ChannelView, userId string }() defer span.Finish() - resultVar0, resultVar1 := a.app.ViewChannel(view, userId, currentSessionId) + resultVar0, resultVar1 := a.app.ViewChannel(view, userID, currentSessionId) if resultVar1 != nil { span.LogFields(spanlog.Error(resultVar1)) @@ -16026,7 +16026,7 @@ func (a *OpenTracingAppLayer) ViewChannel(view *model.ChannelView, userId string return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) WaitForChannelMembership(channelId string, userId string) { +func (a *OpenTracingAppLayer) WaitForChannelMembership(channelId string, userID string) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.WaitForChannelMembership") @@ -16038,7 +16038,7 @@ func (a *OpenTracingAppLayer) WaitForChannelMembership(channelId string, userId }() defer span.Finish() - a.app.WaitForChannelMembership(channelId, userId) + a.app.WaitForChannelMembership(channelId, userID) } func (a *OpenTracingAppLayer) WriteFile(fr io.Reader, path string) (int64, *model.AppError) { diff --git a/app/plugin_api.go b/app/plugin_api.go index 3b292795ad..82b75b4b15 100644 --- a/app/plugin_api.go +++ b/app/plugin_api.go @@ -66,8 +66,8 @@ func (api *PluginAPI) RegisterCommand(command *model.Command) error { return api.app.RegisterPluginCommand(api.id, command) } -func (api *PluginAPI) UnregisterCommand(teamId, trigger string) error { - api.app.UnregisterPluginCommand(api.id, teamId, trigger) +func (api *PluginAPI) UnregisterCommand(teamID, trigger string) error { + api.app.UnregisterPluginCommand(api.id, teamID, trigger) return nil } @@ -155,16 +155,16 @@ func (api *PluginAPI) CreateTeam(team *model.Team) (*model.Team, *model.AppError return api.app.CreateTeam(team) } -func (api *PluginAPI) DeleteTeam(teamId string) *model.AppError { - return api.app.SoftDeleteTeam(teamId) +func (api *PluginAPI) DeleteTeam(teamID string) *model.AppError { + return api.app.SoftDeleteTeam(teamID) } func (api *PluginAPI) GetTeams() ([]*model.Team, *model.AppError) { return api.app.GetAllTeams() } -func (api *PluginAPI) GetTeam(teamId string) (*model.Team, *model.AppError) { - return api.app.GetTeam(teamId) +func (api *PluginAPI) GetTeam(teamID string) (*model.Team, *model.AppError) { + return api.app.GetTeam(teamID) } func (api *PluginAPI) SearchTeams(term string) ([]*model.Team, *model.AppError) { @@ -176,64 +176,64 @@ func (api *PluginAPI) GetTeamByName(name string) (*model.Team, *model.AppError) return api.app.GetTeamByName(name) } -func (api *PluginAPI) GetTeamsUnreadForUser(userId string) ([]*model.TeamUnread, *model.AppError) { - return api.app.GetTeamsUnreadForUser("", userId) +func (api *PluginAPI) GetTeamsUnreadForUser(userID string) ([]*model.TeamUnread, *model.AppError) { + return api.app.GetTeamsUnreadForUser("", userID) } func (api *PluginAPI) UpdateTeam(team *model.Team) (*model.Team, *model.AppError) { return api.app.UpdateTeam(team) } -func (api *PluginAPI) GetTeamsForUser(userId string) ([]*model.Team, *model.AppError) { - return api.app.GetTeamsForUser(userId) +func (api *PluginAPI) GetTeamsForUser(userID string) ([]*model.Team, *model.AppError) { + return api.app.GetTeamsForUser(userID) } -func (api *PluginAPI) CreateTeamMember(teamId, userId string) (*model.TeamMember, *model.AppError) { - return api.app.AddTeamMember(teamId, userId) +func (api *PluginAPI) CreateTeamMember(teamID, userID string) (*model.TeamMember, *model.AppError) { + return api.app.AddTeamMember(teamID, userID) } -func (api *PluginAPI) CreateTeamMembers(teamId string, userIds []string, requestorId string) ([]*model.TeamMember, *model.AppError) { - members, err := api.app.AddTeamMembers(teamId, userIds, requestorId, false) +func (api *PluginAPI) CreateTeamMembers(teamID string, userIDs []string, requestorId string) ([]*model.TeamMember, *model.AppError) { + members, err := api.app.AddTeamMembers(teamID, userIDs, requestorId, false) if err != nil { return nil, err } return model.TeamMembersWithErrorToTeamMembers(members), nil } -func (api *PluginAPI) CreateTeamMembersGracefully(teamId string, userIds []string, requestorId string) ([]*model.TeamMemberWithError, *model.AppError) { - return api.app.AddTeamMembers(teamId, userIds, requestorId, true) +func (api *PluginAPI) CreateTeamMembersGracefully(teamID string, userIDs []string, requestorId string) ([]*model.TeamMemberWithError, *model.AppError) { + return api.app.AddTeamMembers(teamID, userIDs, requestorId, true) } -func (api *PluginAPI) DeleteTeamMember(teamId, userId, requestorId string) *model.AppError { - return api.app.RemoveUserFromTeam(teamId, userId, requestorId) +func (api *PluginAPI) DeleteTeamMember(teamID, userID, requestorId string) *model.AppError { + return api.app.RemoveUserFromTeam(teamID, userID, requestorId) } -func (api *PluginAPI) GetTeamMembers(teamId string, page, perPage int) ([]*model.TeamMember, *model.AppError) { - return api.app.GetTeamMembers(teamId, page*perPage, perPage, nil) +func (api *PluginAPI) GetTeamMembers(teamID string, page, perPage int) ([]*model.TeamMember, *model.AppError) { + return api.app.GetTeamMembers(teamID, page*perPage, perPage, nil) } -func (api *PluginAPI) GetTeamMember(teamId, userId string) (*model.TeamMember, *model.AppError) { - return api.app.GetTeamMember(teamId, userId) +func (api *PluginAPI) GetTeamMember(teamID, userID string) (*model.TeamMember, *model.AppError) { + return api.app.GetTeamMember(teamID, userID) } -func (api *PluginAPI) GetTeamMembersForUser(userId string, page int, perPage int) ([]*model.TeamMember, *model.AppError) { - return api.app.GetTeamMembersForUserWithPagination(userId, page, perPage) +func (api *PluginAPI) GetTeamMembersForUser(userID string, page int, perPage int) ([]*model.TeamMember, *model.AppError) { + return api.app.GetTeamMembersForUserWithPagination(userID, page, perPage) } -func (api *PluginAPI) UpdateTeamMemberRoles(teamId, userId, newRoles string) (*model.TeamMember, *model.AppError) { - return api.app.UpdateTeamMemberRoles(teamId, userId, newRoles) +func (api *PluginAPI) UpdateTeamMemberRoles(teamID, userID, newRoles string) (*model.TeamMember, *model.AppError) { + return api.app.UpdateTeamMemberRoles(teamID, userID, newRoles) } -func (api *PluginAPI) GetTeamStats(teamId string) (*model.TeamStats, *model.AppError) { - return api.app.GetTeamStats(teamId, nil) +func (api *PluginAPI) GetTeamStats(teamID string) (*model.TeamStats, *model.AppError) { + return api.app.GetTeamStats(teamID, nil) } func (api *PluginAPI) CreateUser(user *model.User) (*model.User, *model.AppError) { return api.app.CreateUser(user) } -func (api *PluginAPI) DeleteUser(userId string) *model.AppError { - user, err := api.app.GetUser(userId) +func (api *PluginAPI) DeleteUser(userID string) *model.AppError { + user, err := api.app.GetUser(userID) if err != nil { return err } @@ -245,8 +245,8 @@ func (api *PluginAPI) GetUsers(options *model.UserGetOptions) ([]*model.User, *m return api.app.GetUsers(options) } -func (api *PluginAPI) GetUser(userId string) (*model.User, *model.AppError) { - return api.app.GetUser(userId) +func (api *PluginAPI) GetUser(userID string) (*model.User, *model.AppError) { + return api.app.GetUser(userID) } func (api *PluginAPI) GetUserByEmail(email string) (*model.User, *model.AppError) { @@ -261,54 +261,54 @@ func (api *PluginAPI) GetUsersByUsernames(usernames []string) ([]*model.User, *m return api.app.GetUsersByUsernames(usernames, true, nil) } -func (api *PluginAPI) GetUsersInTeam(teamId string, page int, perPage int) ([]*model.User, *model.AppError) { - options := &model.UserGetOptions{InTeamId: teamId, Page: page, PerPage: perPage} +func (api *PluginAPI) GetUsersInTeam(teamID string, page int, perPage int) ([]*model.User, *model.AppError) { + options := &model.UserGetOptions{InTeamId: teamID, Page: page, PerPage: perPage} return api.app.GetUsersInTeam(options) } -func (api *PluginAPI) GetPreferencesForUser(userId string) ([]model.Preference, *model.AppError) { - return api.app.GetPreferencesForUser(userId) +func (api *PluginAPI) GetPreferencesForUser(userID string) ([]model.Preference, *model.AppError) { + return api.app.GetPreferencesForUser(userID) } -func (api *PluginAPI) UpdatePreferencesForUser(userId string, preferences []model.Preference) *model.AppError { - return api.app.UpdatePreferences(userId, preferences) +func (api *PluginAPI) UpdatePreferencesForUser(userID string, preferences []model.Preference) *model.AppError { + return api.app.UpdatePreferences(userID, preferences) } -func (api *PluginAPI) DeletePreferencesForUser(userId string, preferences []model.Preference) *model.AppError { - return api.app.DeletePreferences(userId, preferences) +func (api *PluginAPI) DeletePreferencesForUser(userID string, preferences []model.Preference) *model.AppError { + return api.app.DeletePreferences(userID, preferences) } func (api *PluginAPI) UpdateUser(user *model.User) (*model.User, *model.AppError) { return api.app.UpdateUser(user, true) } -func (api *PluginAPI) UpdateUserActive(userId string, active bool) *model.AppError { - return api.app.UpdateUserActive(userId, active) +func (api *PluginAPI) UpdateUserActive(userID string, active bool) *model.AppError { + return api.app.UpdateUserActive(userID, active) } -func (api *PluginAPI) GetUserStatus(userId string) (*model.Status, *model.AppError) { - return api.app.GetStatus(userId) +func (api *PluginAPI) GetUserStatus(userID string) (*model.Status, *model.AppError) { + return api.app.GetStatus(userID) } -func (api *PluginAPI) GetUserStatusesByIds(userIds []string) ([]*model.Status, *model.AppError) { - return api.app.GetUserStatusesByIds(userIds) +func (api *PluginAPI) GetUserStatusesByIds(userIDs []string) ([]*model.Status, *model.AppError) { + return api.app.GetUserStatusesByIds(userIDs) } -func (api *PluginAPI) UpdateUserStatus(userId, status string) (*model.Status, *model.AppError) { +func (api *PluginAPI) UpdateUserStatus(userID, status string) (*model.Status, *model.AppError) { switch status { case model.STATUS_ONLINE: - api.app.SetStatusOnline(userId, true) + api.app.SetStatusOnline(userID, true) case model.STATUS_OFFLINE: - api.app.SetStatusOffline(userId, true) + api.app.SetStatusOffline(userID, true) case model.STATUS_AWAY: - api.app.SetStatusAwayIfNeeded(userId, true) + api.app.SetStatusAwayIfNeeded(userID, true) case model.STATUS_DND: - api.app.SetStatusDoNotDisturb(userId) + api.app.SetStatusDoNotDisturb(userID) default: return nil, model.NewAppError("UpdateUserStatus", "plugin.api.update_user_status.bad_status", nil, "unrecognized status", http.StatusBadRequest) } - return api.app.GetStatus(userId) + return api.app.GetStatus(userID) } func (api *PluginAPI) GetUsersInChannel(channelId, sortBy string, page, perPage int) ([]*model.User, *model.AppError) { @@ -330,12 +330,12 @@ func (api *PluginAPI) GetUsersInChannel(channelId, sortBy string, page, perPage } } -func (api *PluginAPI) GetLDAPUserAttributes(userId string, attributes []string) (map[string]string, *model.AppError) { +func (api *PluginAPI) GetLDAPUserAttributes(userID string, attributes []string) (map[string]string, *model.AppError) { if api.app.Ldap() == nil { return nil, model.NewAppError("GetLdapUserAttributes", "ent.ldap.disabled.app_error", nil, "", http.StatusNotImplemented) } - user, err := api.app.GetUser(userId) + user, err := api.app.GetUser(userID) if err != nil { return nil, err } @@ -365,8 +365,8 @@ func (api *PluginAPI) DeleteChannel(channelId string) *model.AppError { return api.app.DeleteChannel(channel, "") } -func (api *PluginAPI) GetPublicChannelsForTeam(teamId string, page, perPage int) ([]*model.Channel, *model.AppError) { - channels, err := api.app.GetPublicChannelsForTeam(teamId, page*perPage, perPage) +func (api *PluginAPI) GetPublicChannelsForTeam(teamID string, page, perPage int) ([]*model.Channel, *model.AppError) { + channels, err := api.app.GetPublicChannelsForTeam(teamID, page*perPage, perPage) if err != nil { return nil, err } @@ -377,16 +377,16 @@ func (api *PluginAPI) GetChannel(channelId string) (*model.Channel, *model.AppEr return api.app.GetChannel(channelId) } -func (api *PluginAPI) GetChannelByName(teamId, name string, includeDeleted bool) (*model.Channel, *model.AppError) { - return api.app.GetChannelByName(name, teamId, includeDeleted) +func (api *PluginAPI) GetChannelByName(teamID, name string, includeDeleted bool) (*model.Channel, *model.AppError) { + return api.app.GetChannelByName(name, teamID, includeDeleted) } func (api *PluginAPI) GetChannelByNameForTeamName(teamName, channelName string, includeDeleted bool) (*model.Channel, *model.AppError) { return api.app.GetChannelByNameForTeamName(channelName, teamName, includeDeleted) } -func (api *PluginAPI) GetChannelsForTeamForUser(teamId, userId string, includeDeleted bool) ([]*model.Channel, *model.AppError) { - channels, err := api.app.GetChannelsForUser(teamId, userId, includeDeleted, 0) +func (api *PluginAPI) GetChannelsForTeamForUser(teamID, userID string, includeDeleted bool) ([]*model.Channel, *model.AppError) { + channels, err := api.app.GetChannelsForUser(teamID, userID, includeDeleted, 0) if err != nil { return nil, err } @@ -405,20 +405,20 @@ func (api *PluginAPI) GetChannelStats(channelId string) (*model.ChannelStats, *m return &model.ChannelStats{ChannelId: channelId, MemberCount: memberCount, GuestCount: guestCount}, nil } -func (api *PluginAPI) GetDirectChannel(userId1, userId2 string) (*model.Channel, *model.AppError) { - return api.app.GetOrCreateDirectChannel(userId1, userId2) +func (api *PluginAPI) GetDirectChannel(userID1, userID2 string) (*model.Channel, *model.AppError) { + return api.app.GetOrCreateDirectChannel(userID1, userID2) } -func (api *PluginAPI) GetGroupChannel(userIds []string) (*model.Channel, *model.AppError) { - return api.app.CreateGroupChannel(userIds, "") +func (api *PluginAPI) GetGroupChannel(userIDs []string) (*model.Channel, *model.AppError) { + return api.app.CreateGroupChannel(userIDs, "") } func (api *PluginAPI) UpdateChannel(channel *model.Channel) (*model.Channel, *model.AppError) { return api.app.UpdateChannel(channel) } -func (api *PluginAPI) SearchChannels(teamId string, term string) ([]*model.Channel, *model.AppError) { - channels, err := api.app.SearchChannels(teamId, term) +func (api *PluginAPI) SearchChannels(teamID string, term string) ([]*model.Channel, *model.AppError) { + channels, err := api.app.SearchChannels(teamID, term) if err != nil { return nil, err } @@ -434,15 +434,15 @@ func (api *PluginAPI) SearchUsers(search *model.UserSearch) ([]*model.User, *mod return api.app.SearchUsers(search, pluginSearchUsersOptions) } -func (api *PluginAPI) SearchPostsInTeam(teamId string, paramsList []*model.SearchParams) ([]*model.Post, *model.AppError) { - postList, err := api.app.SearchPostsInTeam(teamId, paramsList) +func (api *PluginAPI) SearchPostsInTeam(teamID string, paramsList []*model.SearchParams) ([]*model.Post, *model.AppError) { + postList, err := api.app.SearchPostsInTeam(teamID, paramsList) if err != nil { return nil, err } return postList.ToSlice(), nil } -func (api *PluginAPI) SearchPostsInTeamForUser(teamId string, userId string, searchParams model.SearchParameter) (*model.PostSearchResults, *model.AppError) { +func (api *PluginAPI) SearchPostsInTeamForUser(teamID string, userID string, searchParams model.SearchParameter) (*model.PostSearchResults, *model.AppError) { var terms string if searchParams.Terms != nil { terms = *searchParams.Terms @@ -473,10 +473,10 @@ func (api *PluginAPI) SearchPostsInTeamForUser(teamId string, userId string, sea includeDeletedChannels = *searchParams.IncludeDeletedChannels } - return api.app.SearchPostsInTeamForUser(terms, userId, teamId, isOrSearch, includeDeletedChannels, timeZoneOffset, page, perPage) + return api.app.SearchPostsInTeamForUser(terms, userID, teamID, isOrSearch, includeDeletedChannels, timeZoneOffset, page, perPage) } -func (api *PluginAPI) AddChannelMember(channelId, userId string) (*model.ChannelMember, *model.AppError) { +func (api *PluginAPI) AddChannelMember(channelId, userID string) (*model.ChannelMember, *model.AppError) { // For now, don't allow overriding these via the plugin API. userRequestorId := "" postRootId := "" @@ -486,10 +486,10 @@ func (api *PluginAPI) AddChannelMember(channelId, userId string) (*model.Channel return nil, err } - return api.app.AddChannelMember(userId, channel, userRequestorId, postRootId) + return api.app.AddChannelMember(userID, channel, userRequestorId, postRootId) } -func (api *PluginAPI) AddUserToChannel(channelId, userId, asUserId string) (*model.ChannelMember, *model.AppError) { +func (api *PluginAPI) AddUserToChannel(channelId, userID, asUserId string) (*model.ChannelMember, *model.AppError) { postRootId := "" channel, err := api.GetChannel(channelId) @@ -497,35 +497,35 @@ func (api *PluginAPI) AddUserToChannel(channelId, userId, asUserId string) (*mod return nil, err } - return api.app.AddChannelMember(userId, channel, asUserId, postRootId) + return api.app.AddChannelMember(userID, channel, asUserId, postRootId) } -func (api *PluginAPI) GetChannelMember(channelId, userId string) (*model.ChannelMember, *model.AppError) { - return api.app.GetChannelMember(channelId, userId) +func (api *PluginAPI) GetChannelMember(channelId, userID string) (*model.ChannelMember, *model.AppError) { + return api.app.GetChannelMember(channelId, userID) } func (api *PluginAPI) GetChannelMembers(channelId string, page, perPage int) (*model.ChannelMembers, *model.AppError) { return api.app.GetChannelMembersPage(channelId, page, perPage) } -func (api *PluginAPI) GetChannelMembersByIds(channelId string, userIds []string) (*model.ChannelMembers, *model.AppError) { - return api.app.GetChannelMembersByIds(channelId, userIds) +func (api *PluginAPI) GetChannelMembersByIds(channelId string, userIDs []string) (*model.ChannelMembers, *model.AppError) { + return api.app.GetChannelMembersByIds(channelId, userIDs) } -func (api *PluginAPI) GetChannelMembersForUser(teamId, userId string, page, perPage int) ([]*model.ChannelMember, *model.AppError) { - return api.app.GetChannelMembersForUserWithPagination(teamId, userId, page, perPage) +func (api *PluginAPI) GetChannelMembersForUser(teamID, userID string, page, perPage int) ([]*model.ChannelMember, *model.AppError) { + return api.app.GetChannelMembersForUserWithPagination(teamID, userID, page, perPage) } -func (api *PluginAPI) UpdateChannelMemberRoles(channelId, userId, newRoles string) (*model.ChannelMember, *model.AppError) { - return api.app.UpdateChannelMemberRoles(channelId, userId, newRoles) +func (api *PluginAPI) UpdateChannelMemberRoles(channelId, userID, newRoles string) (*model.ChannelMember, *model.AppError) { + return api.app.UpdateChannelMemberRoles(channelId, userID, newRoles) } -func (api *PluginAPI) UpdateChannelMemberNotifications(channelId, userId string, notifications map[string]string) (*model.ChannelMember, *model.AppError) { - return api.app.UpdateChannelMemberNotifyProps(notifications, channelId, userId) +func (api *PluginAPI) UpdateChannelMemberNotifications(channelId, userID string, notifications map[string]string) (*model.ChannelMember, *model.AppError) { + return api.app.UpdateChannelMemberNotifyProps(notifications, channelId, userID) } -func (api *PluginAPI) DeleteChannelMember(channelId, userId string) *model.AppError { - return api.app.LeaveChannel(channelId, userId) +func (api *PluginAPI) DeleteChannelMember(channelId, userID string) *model.AppError { + return api.app.LeaveChannel(channelId, userID) } func (api *PluginAPI) GetGroup(groupId string) (*model.Group, *model.AppError) { @@ -536,8 +536,8 @@ func (api *PluginAPI) GetGroupByName(name string) (*model.Group, *model.AppError return api.app.GetGroupByName(name, model.GroupSearchOpts{}) } -func (api *PluginAPI) GetGroupsForUser(userId string) ([]*model.Group, *model.AppError) { - return api.app.GetGroupsByUserId(userId) +func (api *PluginAPI) GetGroupsForUser(userID string) ([]*model.Group, *model.AppError) { + return api.app.GetGroupsByUserId(userID) } func (api *PluginAPI) CreatePost(post *model.Post) (*model.Post, *model.AppError) { @@ -556,16 +556,16 @@ func (api *PluginAPI) GetReactions(postId string) ([]*model.Reaction, *model.App return api.app.GetReactionsForPost(postId) } -func (api *PluginAPI) SendEphemeralPost(userId string, post *model.Post) *model.Post { - return api.app.SendEphemeralPost(userId, post) +func (api *PluginAPI) SendEphemeralPost(userID string, post *model.Post) *model.Post { + return api.app.SendEphemeralPost(userID, post) } -func (api *PluginAPI) UpdateEphemeralPost(userId string, post *model.Post) *model.Post { - return api.app.UpdateEphemeralPost(userId, post) +func (api *PluginAPI) UpdateEphemeralPost(userID string, post *model.Post) *model.Post { + return api.app.UpdateEphemeralPost(userID, post) } -func (api *PluginAPI) DeleteEphemeralPost(userId, postId string) { - api.app.DeleteEphemeralPost(userId, postId) +func (api *PluginAPI) DeleteEphemeralPost(userID, postId string) { + api.app.DeleteEphemeralPost(userID, postId) } func (api *PluginAPI) DeletePost(postId string) *model.AppError { @@ -601,8 +601,8 @@ func (api *PluginAPI) UpdatePost(post *model.Post) (*model.Post, *model.AppError return api.app.UpdatePost(post, false) } -func (api *PluginAPI) GetProfileImage(userId string) ([]byte, *model.AppError) { - user, err := api.app.GetUser(userId) +func (api *PluginAPI) GetProfileImage(userID string) ([]byte, *model.AppError) { + user, err := api.app.GetUser(userID) if err != nil { return nil, err } @@ -611,13 +611,13 @@ func (api *PluginAPI) GetProfileImage(userId string) ([]byte, *model.AppError) { return data, err } -func (api *PluginAPI) SetProfileImage(userId string, data []byte) *model.AppError { - _, err := api.app.GetUser(userId) +func (api *PluginAPI) SetProfileImage(userID string, data []byte) *model.AppError { + _, err := api.app.GetUser(userID) if err != nil { return err } - return api.app.SetProfileImageFromFile(userId, bytes.NewReader(data)) + return api.app.SetProfileImageFromFile(userID, bytes.NewReader(data)) } func (api *PluginAPI) GetEmojiList(sortBy string, page, perPage int) ([]*model.Emoji, *model.AppError) { @@ -632,8 +632,8 @@ func (api *PluginAPI) GetEmoji(emojiId string) (*model.Emoji, *model.AppError) { return api.app.GetEmoji(emojiId) } -func (api *PluginAPI) CopyFileInfos(userId string, fileIds []string) ([]string, *model.AppError) { - return api.app.CopyFileInfos(userId, fileIds) +func (api *PluginAPI) CopyFileInfos(userID string, fileIds []string) ([]string, *model.AppError) { + return api.app.CopyFileInfos(userID, fileIds) } func (api *PluginAPI) GetFileInfo(fileId string) (*model.FileInfo, *model.AppError) { @@ -677,8 +677,8 @@ func (api *PluginAPI) GetEmojiImage(emojiId string) ([]byte, string, *model.AppE return api.app.GetEmojiImage(emojiId) } -func (api *PluginAPI) GetTeamIcon(teamId string) ([]byte, *model.AppError) { - team, err := api.app.GetTeam(teamId) +func (api *PluginAPI) GetTeamIcon(teamID string) ([]byte, *model.AppError) { + team, err := api.app.GetTeam(teamID) if err != nil { return nil, err } @@ -690,8 +690,8 @@ func (api *PluginAPI) GetTeamIcon(teamId string) ([]byte, *model.AppError) { return data, nil } -func (api *PluginAPI) SetTeamIcon(teamId string, data []byte) *model.AppError { - team, err := api.app.GetTeam(teamId) +func (api *PluginAPI) SetTeamIcon(teamID string, data []byte) *model.AppError { + team, err := api.app.GetTeam(teamID) if err != nil { return err } @@ -703,13 +703,13 @@ func (api *PluginAPI) OpenInteractiveDialog(dialog model.OpenDialogRequest) *mod return api.app.OpenInteractiveDialog(dialog) } -func (api *PluginAPI) RemoveTeamIcon(teamId string) *model.AppError { - _, err := api.app.GetTeam(teamId) +func (api *PluginAPI) RemoveTeamIcon(teamID string) *model.AppError { + _, err := api.app.GetTeam(teamID) if err != nil { return err } - err = api.app.RemoveTeamIcon(teamId) + err = api.app.RemoveTeamIcon(teamID) if err != nil { return err } @@ -824,16 +824,16 @@ func (api *PluginAPI) PublishWebSocketEvent(event string, payload map[string]int api.app.Publish(ev) } -func (api *PluginAPI) HasPermissionTo(userId string, permission *model.Permission) bool { - return api.app.HasPermissionTo(userId, permission) +func (api *PluginAPI) HasPermissionTo(userID string, permission *model.Permission) bool { + return api.app.HasPermissionTo(userID, permission) } -func (api *PluginAPI) HasPermissionToTeam(userId, teamId string, permission *model.Permission) bool { - return api.app.HasPermissionToTeam(userId, teamId, permission) +func (api *PluginAPI) HasPermissionToTeam(userID, teamID string, permission *model.Permission) bool { + return api.app.HasPermissionToTeam(userID, teamID, permission) } -func (api *PluginAPI) HasPermissionToChannel(userId, channelId string, permission *model.Permission) bool { - return api.app.HasPermissionToChannel(userId, channelId, permission) +func (api *PluginAPI) HasPermissionToChannel(userID, channelId string, permission *model.Permission) bool { + return api.app.HasPermissionToChannel(userID, channelId, permission) } func (api *PluginAPI) LogDebug(msg string, keyValuePairs ...interface{}) { @@ -865,12 +865,12 @@ func (api *PluginAPI) CreateBot(bot *model.Bot) (*model.Bot, *model.AppError) { return api.app.CreateBot(bot) } -func (api *PluginAPI) PatchBot(userId string, botPatch *model.BotPatch) (*model.Bot, *model.AppError) { - return api.app.PatchBot(userId, botPatch) +func (api *PluginAPI) PatchBot(userID string, botPatch *model.BotPatch) (*model.Bot, *model.AppError) { + return api.app.PatchBot(userID, botPatch) } -func (api *PluginAPI) GetBot(userId string, includeDeleted bool) (*model.Bot, *model.AppError) { - return api.app.GetBot(userId, includeDeleted) +func (api *PluginAPI) GetBot(userID string, includeDeleted bool) (*model.Bot, *model.AppError) { + return api.app.GetBot(userID, includeDeleted) } func (api *PluginAPI) GetBots(options *model.BotGetOptions) ([]*model.Bot, *model.AppError) { @@ -879,40 +879,40 @@ func (api *PluginAPI) GetBots(options *model.BotGetOptions) ([]*model.Bot, *mode return []*model.Bot(bots), err } -func (api *PluginAPI) UpdateBotActive(userId string, active bool) (*model.Bot, *model.AppError) { - return api.app.UpdateBotActive(userId, active) +func (api *PluginAPI) UpdateBotActive(userID string, active bool) (*model.Bot, *model.AppError) { + return api.app.UpdateBotActive(userID, active) } -func (api *PluginAPI) PermanentDeleteBot(userId string) *model.AppError { - return api.app.PermanentDeleteBot(userId) +func (api *PluginAPI) PermanentDeleteBot(userID string) *model.AppError { + return api.app.PermanentDeleteBot(userID) } -func (api *PluginAPI) GetBotIconImage(userId string) ([]byte, *model.AppError) { - if _, err := api.app.GetBot(userId, true); err != nil { +func (api *PluginAPI) GetBotIconImage(userID string) ([]byte, *model.AppError) { + if _, err := api.app.GetBot(userID, true); err != nil { return nil, err } - return api.app.GetBotIconImage(userId) + return api.app.GetBotIconImage(userID) } -func (api *PluginAPI) SetBotIconImage(userId string, data []byte) *model.AppError { - if _, err := api.app.GetBot(userId, true); err != nil { +func (api *PluginAPI) SetBotIconImage(userID string, data []byte) *model.AppError { + if _, err := api.app.GetBot(userID, true); err != nil { return err } - return api.app.SetBotIconImage(userId, bytes.NewReader(data)) + return api.app.SetBotIconImage(userID, bytes.NewReader(data)) } -func (api *PluginAPI) DeleteBotIconImage(userId string) *model.AppError { - if _, err := api.app.GetBot(userId, true); err != nil { +func (api *PluginAPI) DeleteBotIconImage(userID string) *model.AppError { + if _, err := api.app.GetBot(userID, true); err != nil { return err } - return api.app.DeleteBotIconImage(userId) + return api.app.DeleteBotIconImage(userID) } -func (api *PluginAPI) PublishUserTyping(userId, channelId, parentId string) *model.AppError { - return api.app.PublishUserTyping(userId, channelId, parentId) +func (api *PluginAPI) PublishUserTyping(userID, channelId, parentId string) *model.AppError { + return api.app.PublishUserTyping(userID, channelId, parentId) } func (api *PluginAPI) PluginHTTP(request *http.Request) *http.Response { diff --git a/app/plugin_api_test.go b/app/plugin_api_test.go index 09400ee14d..16c93148fc 100644 --- a/app/plugin_api_test.go +++ b/app/plugin_api_test.go @@ -1275,10 +1275,10 @@ func TestPluginCreatePostWithUploadedFile(t *testing.T) { require.Nil(t, err) assert.Equal(t, data, actualData) - userId := th.BasicUser.Id + userID := th.BasicUser.Id post, err := api.CreatePost(&model.Post{ Message: "test", - UserId: userId, + UserId: userID, ChannelId: channelId, FileIds: model.StringArray{fileInfo.Id}, }) @@ -1711,8 +1711,8 @@ func TestPluginAPISearchPostsInTeamByUser(t *testing.T) { testCases := []struct { description string - teamId string - userId string + teamID string + userID string params model.SearchParameter expectedPostsLen int }{ @@ -1741,7 +1741,7 @@ func TestPluginAPISearchPostsInTeamByUser(t *testing.T) { for _, testCase := range testCases { t.Run(testCase.description, func(t *testing.T) { - searchResults, err := api.SearchPostsInTeamForUser(testCase.teamId, testCase.userId, testCase.params) + searchResults, err := api.SearchPostsInTeamForUser(testCase.teamID, testCase.userID, testCase.params) assert.Nil(t, err) assert.Equal(t, testCase.expectedPostsLen, len(searchResults.Posts)) }) @@ -1753,7 +1753,7 @@ func TestPluginAPICreateCommandAndListCommands(t *testing.T) { defer th.TearDown() api := th.SetupPluginAPI() - foundCommand := func(listXCommand func(teamId string) ([]*model.Command, error)) bool { + foundCommand := func(listXCommand func(teamID string) ([]*model.Command, error)) bool { cmds, appErr := listXCommand(th.BasicTeam.Id) require.Nil(t, appErr) diff --git a/app/plugin_commands.go b/app/plugin_commands.go index bf7a96adae..090405b64e 100644 --- a/app/plugin_commands.go +++ b/app/plugin_commands.go @@ -72,7 +72,7 @@ func (a *App) RegisterPluginCommand(pluginId string, command *model.Command) err return nil } -func (a *App) UnregisterPluginCommand(pluginId, teamId, trigger string) { +func (a *App) UnregisterPluginCommand(pluginId, teamID, trigger string) { trigger = strings.ToLower(trigger) a.Srv().pluginCommandsLock.Lock() @@ -80,7 +80,7 @@ func (a *App) UnregisterPluginCommand(pluginId, teamId, trigger string) { var remaining []*PluginCommand for _, pc := range a.Srv().pluginCommands { - if pc.Command.TeamId != teamId || pc.Command.Trigger != trigger { + if pc.Command.TeamId != teamID || pc.Command.Trigger != trigger { remaining = append(remaining, pc) } } @@ -100,13 +100,13 @@ func (a *App) UnregisterPluginCommands(pluginId string) { a.Srv().pluginCommands = remaining } -func (a *App) PluginCommandsForTeam(teamId string) []*model.Command { +func (a *App) PluginCommandsForTeam(teamID string) []*model.Command { a.Srv().pluginCommandsLock.RLock() defer a.Srv().pluginCommandsLock.RUnlock() var commands []*model.Command for _, pc := range a.Srv().pluginCommands { - if pc.Command.TeamId == "" || pc.Command.TeamId == teamId { + if pc.Command.TeamId == "" || pc.Command.TeamId == teamID { commands = append(commands, pc.Command) } } @@ -148,8 +148,8 @@ func (a *App) tryExecutePluginCommand(args *model.CommandArgs) (*model.Command, return matched.Command, nil, model.NewAppError("ExecutePluginCommand", "model.plugin_command.error.app_error", nil, "err="+err.Error(), http.StatusInternalServerError) } - for username, userId := range a.MentionsToTeamMembers(args.Command, args.TeamId) { - args.AddUserMention(username, userId) + for username, userID := range a.MentionsToTeamMembers(args.Command, args.TeamId) { + args.AddUserMention(username, userID) } for channelName, channelId := range a.MentionsToPublicChannels(args.Command, args.TeamId) { diff --git a/app/plugin_requests.go b/app/plugin_requests.go index e517d435df..f7af912a68 100644 --- a/app/plugin_requests.go +++ b/app/plugin_requests.go @@ -157,18 +157,18 @@ func (a *App) servePluginRequest(w http.ResponseWriter, r *http.Request, handler if r.Header.Get(model.HEADER_REQUESTED_WITH) == model.HEADER_REQUESTED_WITH_XML && !csrfCheckPassed { csrfErrorMessage := "CSRF Check failed for request - Please migrate your plugin to either send a CSRF Header or Form Field, XMLHttpRequest is deprecated" sid := "" - userId := "" + userID := "" if session != nil { sid = session.Id - userId = session.UserId + userID = session.UserId } fields := []mlog.Field{ mlog.String("path", r.URL.Path), mlog.String("ip", r.RemoteAddr), mlog.String("session_id", sid), - mlog.String("user_id", userId), + mlog.String("user_id", userID), } if *a.Config().ServiceSettings.ExperimentalStrictCSRFEnforcement { diff --git a/app/post.go b/app/post.go index b939a2df77..1834301309 100644 --- a/app/post.go +++ b/app/post.go @@ -483,7 +483,7 @@ func (a *App) handlePostEvents(post *model.Post, user *model.User, channel *mode return nil } -func (a *App) SendEphemeralPost(userId string, post *model.Post) *model.Post { +func (a *App) SendEphemeralPost(userID string, post *model.Post) *model.Post { post.Type = model.POST_EPHEMERAL // fill in fields which haven't been specified which have sensible defaults @@ -498,7 +498,7 @@ func (a *App) SendEphemeralPost(userId string, post *model.Post) *model.Post { } post.GenerateActionIds() - message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_EPHEMERAL_MESSAGE, "", post.ChannelId, userId, nil) + message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_EPHEMERAL_MESSAGE, "", post.ChannelId, userID, nil) post = a.PreparePostForClient(post, true, false) post = model.AddPostActionCookies(post, a.PostActionCookieSecret()) message.Add("post", post.ToJson()) @@ -507,7 +507,7 @@ func (a *App) SendEphemeralPost(userId string, post *model.Post) *model.Post { return post } -func (a *App) UpdateEphemeralPost(userId string, post *model.Post) *model.Post { +func (a *App) UpdateEphemeralPost(userID string, post *model.Post) *model.Post { post.Type = model.POST_EPHEMERAL post.UpdateAt = model.GetMillis() @@ -516,7 +516,7 @@ func (a *App) UpdateEphemeralPost(userId string, post *model.Post) *model.Post { } post.GenerateActionIds() - message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_POST_EDITED, "", post.ChannelId, userId, nil) + message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_POST_EDITED, "", post.ChannelId, userID, nil) post = a.PreparePostForClient(post, true, false) post = model.AddPostActionCookies(post, a.PostActionCookieSecret()) message.Add("post", post.ToJson()) @@ -525,16 +525,16 @@ func (a *App) UpdateEphemeralPost(userId string, post *model.Post) *model.Post { return post } -func (a *App) DeleteEphemeralPost(userId, postId string) { +func (a *App) DeleteEphemeralPost(userID, postId string) { post := &model.Post{ Id: postId, - UserId: userId, + UserId: userID, Type: model.POST_EPHEMERAL, DeleteAt: model.GetMillis(), UpdateAt: model.GetMillis(), } - message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_POST_DELETED, "", "", userId, nil) + message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_POST_DELETED, "", "", userID, nil) message.Add("post", post.ToJson()) a.Publish(message) } @@ -764,8 +764,8 @@ func (a *App) GetPostThread(postId string, skipFetchThreads, collapsedThreads, c return posts, nil } -func (a *App) GetFlaggedPosts(userId string, offset int, limit int) (*model.PostList, *model.AppError) { - postList, err := a.Srv().Store.Post().GetFlaggedPosts(userId, offset, limit) +func (a *App) GetFlaggedPosts(userID string, offset int, limit int) (*model.PostList, *model.AppError) { + postList, err := a.Srv().Store.Post().GetFlaggedPosts(userID, offset, limit) if err != nil { return nil, model.NewAppError("GetFlaggedPosts", "app.post.get_flagged_posts.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -773,8 +773,8 @@ func (a *App) GetFlaggedPosts(userId string, offset int, limit int) (*model.Post return postList, nil } -func (a *App) GetFlaggedPostsForTeam(userId, teamId string, offset int, limit int) (*model.PostList, *model.AppError) { - postList, err := a.Srv().Store.Post().GetFlaggedPostsForTeam(userId, teamId, offset, limit) +func (a *App) GetFlaggedPostsForTeam(userID, teamID string, offset int, limit int) (*model.PostList, *model.AppError) { + postList, err := a.Srv().Store.Post().GetFlaggedPostsForTeam(userID, teamID, offset, limit) if err != nil { return nil, model.NewAppError("GetFlaggedPostsForTeam", "app.post.get_flagged_posts.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -782,8 +782,8 @@ func (a *App) GetFlaggedPostsForTeam(userId, teamId string, offset int, limit in return postList, nil } -func (a *App) GetFlaggedPostsForChannel(userId, channelId string, offset int, limit int) (*model.PostList, *model.AppError) { - postList, err := a.Srv().Store.Post().GetFlaggedPostsForChannel(userId, channelId, offset, limit) +func (a *App) GetFlaggedPostsForChannel(userID, channelId string, offset int, limit int) (*model.PostList, *model.AppError) { + postList, err := a.Srv().Store.Post().GetFlaggedPostsForChannel(userID, channelId, offset, limit) if err != nil { return nil, model.NewAppError("GetFlaggedPostsForChannel", "app.post.get_flagged_posts.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -791,7 +791,7 @@ func (a *App) GetFlaggedPostsForChannel(userId, channelId string, offset int, li return postList, nil } -func (a *App) GetPermalinkPost(postId string, userId string) (*model.PostList, *model.AppError) { +func (a *App) GetPermalinkPost(postId string, userID string) (*model.PostList, *model.AppError) { list, nErr := a.Srv().Store.Post().Get(postId, false, false, false) if nErr != nil { var nfErr *store.ErrNotFound @@ -816,7 +816,7 @@ func (a *App) GetPermalinkPost(postId string, userId string) (*model.PostList, * return nil, err } - if err = a.JoinChannel(channel, userId); err != nil { + if err = a.JoinChannel(channel, userID); err != nil { return nil, err } @@ -975,10 +975,10 @@ func (a *App) AddCursorIdsForPostList(originalList *model.PostList, afterPost, b originalList.NextPostId = nextPostId originalList.PrevPostId = prevPostId } -func (a *App) GetPostsForChannelAroundLastUnread(channelId, userId string, limitBefore, limitAfter int, skipFetchThreads bool, collapsedThreads, collapsedThreadsExtended bool) (*model.PostList, *model.AppError) { +func (a *App) GetPostsForChannelAroundLastUnread(channelId, userID string, limitBefore, limitAfter int, skipFetchThreads bool, collapsedThreads, collapsedThreadsExtended bool) (*model.PostList, *model.AppError) { var member *model.ChannelMember var err *model.AppError - if member, err = a.GetChannelMember(channelId, userId); err != nil { + if member, err = a.GetChannelMember(channelId, userID); err != nil { return nil, err } else if member.LastViewedAt == 0 { return model.NewPostList(), nil @@ -1083,18 +1083,18 @@ func (a *App) DeletePostFiles(post *model.Post) { } } -func (a *App) parseAndFetchChannelIdByNameFromInFilter(channelName, userId, teamId string, includeDeleted bool) (*model.Channel, error) { +func (a *App) parseAndFetchChannelIdByNameFromInFilter(channelName, userID, teamID string, includeDeleted bool) (*model.Channel, error) { if strings.HasPrefix(channelName, "@") && strings.Contains(channelName, ",") { - var userIds []string + var userIDs []string users, err := a.GetUsersByUsernames(strings.Split(channelName[1:], ","), false, nil) if err != nil { return nil, err } for _, user := range users { - userIds = append(userIds, user.Id) + userIDs = append(userIDs, user.Id) } - channel, err := a.GetGroupChannel(userIds) + channel, err := a.GetGroupChannel(userIDs) if err != nil { return nil, err } @@ -1106,21 +1106,21 @@ func (a *App) parseAndFetchChannelIdByNameFromInFilter(channelName, userId, team if err != nil { return nil, err } - channel, err := a.GetOrCreateDirectChannel(userId, user.Id) + channel, err := a.GetOrCreateDirectChannel(userID, user.Id) if err != nil { return nil, err } return channel, nil } - channel, err := a.GetChannelByName(channelName, teamId, includeDeleted) + channel, err := a.GetChannelByName(channelName, teamID, includeDeleted) if err != nil { return nil, err } return channel, nil } -func (a *App) searchPostsInTeam(teamId string, userId string, paramsList []*model.SearchParams, modifierFun func(*model.SearchParams)) (*model.PostList, *model.AppError) { +func (a *App) searchPostsInTeam(teamID string, userID string, paramsList []*model.SearchParams, modifierFun func(*model.SearchParams)) (*model.PostList, *model.AppError) { var wg sync.WaitGroup pchan := make(chan store.StoreResult, len(paramsList)) @@ -1135,7 +1135,7 @@ func (a *App) searchPostsInTeam(teamId string, userId string, paramsList []*mode go func(params *model.SearchParams) { defer wg.Done() - postList, err := a.Srv().Store.Post().Search(teamId, userId, params) + postList, err := a.Srv().Store.Post().Search(teamID, userID, params) pchan <- store.StoreResult{Data: postList, NErr: err} }(params) } @@ -1157,9 +1157,9 @@ func (a *App) searchPostsInTeam(teamId string, userId string, paramsList []*mode return posts, nil } -func (a *App) convertChannelNamesToChannelIds(channels []string, userId string, teamId string, includeDeletedChannels bool) []string { +func (a *App) convertChannelNamesToChannelIds(channels []string, userID string, teamID string, includeDeletedChannels bool) []string { for idx, channelName := range channels { - channel, err := a.parseAndFetchChannelIdByNameFromInFilter(channelName, userId, teamId, includeDeletedChannels) + channel, err := a.parseAndFetchChannelIdByNameFromInFilter(channelName, userID, teamID, includeDeletedChannels) if err != nil { mlog.Warn("error getting channel id by name from in filter", mlog.Err(err)) continue @@ -1181,22 +1181,22 @@ func (a *App) convertUserNameToUserIds(usernames []string) []string { return usernames } -func (a *App) SearchPostsInTeam(teamId string, paramsList []*model.SearchParams) (*model.PostList, *model.AppError) { +func (a *App) SearchPostsInTeam(teamID string, paramsList []*model.SearchParams) (*model.PostList, *model.AppError) { if !*a.Config().ServiceSettings.EnablePostSearch { - return nil, model.NewAppError("SearchPostsInTeam", "store.sql_post.search.disabled", nil, fmt.Sprintf("teamId=%v", teamId), http.StatusNotImplemented) + return nil, model.NewAppError("SearchPostsInTeam", "store.sql_post.search.disabled", nil, fmt.Sprintf("teamId=%v", teamID), http.StatusNotImplemented) } - return a.searchPostsInTeam(teamId, "", paramsList, func(params *model.SearchParams) { + return a.searchPostsInTeam(teamID, "", paramsList, func(params *model.SearchParams) { params.SearchWithoutUserId = true }) } -func (a *App) SearchPostsInTeamForUser(terms string, userId string, teamId string, isOrSearch bool, includeDeletedChannels bool, timeZoneOffset int, page, perPage int) (*model.PostSearchResults, *model.AppError) { +func (a *App) SearchPostsInTeamForUser(terms string, userID string, teamID string, isOrSearch bool, includeDeletedChannels bool, timeZoneOffset int, page, perPage int) (*model.PostSearchResults, *model.AppError) { var postSearchResults *model.PostSearchResults paramsList := model.ParseSearchParams(strings.TrimSpace(terms), timeZoneOffset) includeDeleted := includeDeletedChannels && *a.Config().TeamSettings.ExperimentalViewArchivedChannels if !*a.Config().ServiceSettings.EnablePostSearch { - return nil, model.NewAppError("SearchPostsInTeamForUser", "store.sql_post.search.disabled", nil, fmt.Sprintf("teamId=%v userId=%v", teamId, userId), http.StatusNotImplemented) + return nil, model.NewAppError("SearchPostsInTeamForUser", "store.sql_post.search.disabled", nil, fmt.Sprintf("teamId=%v userId=%v", teamID, userID), http.StatusNotImplemented) } finalParamsList := []*model.SearchParams{} @@ -1207,8 +1207,8 @@ func (a *App) SearchPostsInTeamForUser(terms string, userId string, teamId strin // Don't allow users to search for "*" if params.Terms != "*" { // Convert channel names to channel IDs - params.InChannels = a.convertChannelNamesToChannelIds(params.InChannels, userId, teamId, includeDeletedChannels) - params.ExcludedChannels = a.convertChannelNamesToChannelIds(params.ExcludedChannels, userId, teamId, includeDeletedChannels) + params.InChannels = a.convertChannelNamesToChannelIds(params.InChannels, userID, teamID, includeDeletedChannels) + params.ExcludedChannels = a.convertChannelNamesToChannelIds(params.ExcludedChannels, userID, teamID, includeDeletedChannels) // Convert usernames to user IDs params.FromUsers = a.convertUserNameToUserIds(params.FromUsers) @@ -1223,7 +1223,7 @@ func (a *App) SearchPostsInTeamForUser(terms string, userId string, teamId strin return model.MakePostSearchResults(model.NewPostList(), nil), nil } - postSearchResults, nErr := a.Srv().Store.Post().SearchPostsInTeamForUser(finalParamsList, userId, teamId, page, perPage) + postSearchResults, nErr := a.Srv().Store.Post().SearchPostsInTeamForUser(finalParamsList, userID, teamID, page, perPage) if nErr != nil { var appErr *model.AppError switch { @@ -1342,7 +1342,7 @@ func (a *App) MaxPostSize() int { } // countThreadMentions returns the number of times the user is mentioned in a specified thread after the timestamp. -func (a *App) countThreadMentions(user *model.User, post *model.Post, teamId string, timestamp int64) (int64, *model.AppError) { +func (a *App) countThreadMentions(user *model.User, post *model.Post, teamID string, timestamp int64) (int64, *model.AppError) { channel, err := a.GetChannel(post.ChannelId) if err != nil { return 0, err @@ -1376,8 +1376,8 @@ func (a *App) countThreadMentions(user *model.User, post *model.Post, teamId str } var team *model.Team - if teamId != "" { - team, err = a.GetTeam(teamId) + if teamID != "" { + team, err = a.GetTeam(teamID) if err != nil { return 0, err } @@ -1543,6 +1543,6 @@ func isPostMention(user *model.User, post *model.Post, keywords map[string][]str return false } -func (a *App) GetThreadMembershipsForUser(userId, teamId string) ([]*model.ThreadMembership, error) { - return a.Srv().Store.Thread().GetMembershipsForUser(userId, teamId) +func (a *App) GetThreadMembershipsForUser(userID, teamID string) ([]*model.ThreadMembership, error) { + return a.Srv().Store.Thread().GetMembershipsForUser(userID, teamID) } diff --git a/app/post_test.go b/app/post_test.go index a484e2ff0b..06e5171b80 100644 --- a/app/post_test.go +++ b/app/post_test.go @@ -624,13 +624,13 @@ func TestDeletePostWithFileAttachments(t *testing.T) { defer th.TearDown() // Create a post with a file attachment. - teamId := th.BasicTeam.Id + teamID := th.BasicTeam.Id channelId := th.BasicChannel.Id - userId := th.BasicUser.Id + userID := th.BasicUser.Id filename := "test" data := []byte("abcd") - info1, err := th.App.DoUploadFile(time.Date(2007, 2, 4, 1, 2, 3, 4, time.Local), teamId, channelId, userId, filename, data) + info1, err := th.App.DoUploadFile(time.Date(2007, 2, 4, 1, 2, 3, 4, time.Local), teamID, channelId, userID, filename, data) require.Nil(t, err) defer func() { th.App.Srv().Store.FileInfo().PermanentDelete(info1.Id) @@ -641,7 +641,7 @@ func TestDeletePostWithFileAttachments(t *testing.T) { Message: "asd", ChannelId: channelId, PendingPostId: model.NewId() + ":" + fmt.Sprint(model.GetMillis()), - UserId: userId, + UserId: userID, CreateAt: 0, FileIds: []string{info1.Id}, } @@ -650,7 +650,7 @@ func TestDeletePostWithFileAttachments(t *testing.T) { assert.Nil(t, err) // Delete the post. - post, err = th.App.DeletePost(post.Id, userId) + post, err = th.App.DeletePost(post.Id, userID) assert.Nil(t, err) // Wait for the cleanup routine to finish. diff --git a/app/preference.go b/app/preference.go index f3e0c93df7..03493531c0 100644 --- a/app/preference.go +++ b/app/preference.go @@ -10,16 +10,16 @@ import ( "github.com/mattermost/mattermost-server/v5/model" ) -func (a *App) GetPreferencesForUser(userId string) (model.Preferences, *model.AppError) { - preferences, err := a.Srv().Store.Preference().GetAll(userId) +func (a *App) GetPreferencesForUser(userID string) (model.Preferences, *model.AppError) { + preferences, err := a.Srv().Store.Preference().GetAll(userID) if err != nil { return nil, model.NewAppError("GetPreferencesForUser", "app.preference.get_all.app_error", nil, err.Error(), http.StatusBadRequest) } return preferences, nil } -func (a *App) GetPreferenceByCategoryForUser(userId string, category string) (model.Preferences, *model.AppError) { - preferences, err := a.Srv().Store.Preference().GetCategory(userId, category) +func (a *App) GetPreferenceByCategoryForUser(userID string, category string) (model.Preferences, *model.AppError) { + preferences, err := a.Srv().Store.Preference().GetCategory(userID, category) if err != nil { return nil, model.NewAppError("GetPreferenceByCategoryForUser", "app.preference.get_category.app_error", nil, err.Error(), http.StatusBadRequest) } @@ -30,19 +30,19 @@ func (a *App) GetPreferenceByCategoryForUser(userId string, category string) (mo return preferences, nil } -func (a *App) GetPreferenceByCategoryAndNameForUser(userId string, category string, preferenceName string) (*model.Preference, *model.AppError) { - res, err := a.Srv().Store.Preference().Get(userId, category, preferenceName) +func (a *App) GetPreferenceByCategoryAndNameForUser(userID string, category string, preferenceName string) (*model.Preference, *model.AppError) { + res, err := a.Srv().Store.Preference().Get(userID, category, preferenceName) if err != nil { return nil, model.NewAppError("GetPreferenceByCategoryAndNameForUser", "app.preference.get.app_error", nil, err.Error(), http.StatusBadRequest) } return res, nil } -func (a *App) UpdatePreferences(userId string, preferences model.Preferences) *model.AppError { +func (a *App) UpdatePreferences(userID string, preferences model.Preferences) *model.AppError { for _, preference := range preferences { - if userId != preference.UserId { + if userID != preference.UserId { return model.NewAppError("savePreferences", "api.preference.update_preferences.set.app_error", nil, - "userId="+userId+", preference.UserId="+preference.UserId, http.StatusForbidden) + "userId="+userID+", preference.UserId="+preference.UserId, http.StatusForbidden) } } @@ -60,28 +60,28 @@ func (a *App) UpdatePreferences(userId string, preferences model.Preferences) *m return model.NewAppError("UpdatePreferences", "api.preference.update_preferences.update_sidebar.app_error", nil, err.Error(), http.StatusInternalServerError) } - message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_SIDEBAR_CATEGORY_UPDATED, "", "", userId, nil) + message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_SIDEBAR_CATEGORY_UPDATED, "", "", userID, nil) // TODO this needs to be updated to include information on which categories changed a.Publish(message) - message = model.NewWebSocketEvent(model.WEBSOCKET_EVENT_PREFERENCES_CHANGED, "", "", userId, nil) + message = model.NewWebSocketEvent(model.WEBSOCKET_EVENT_PREFERENCES_CHANGED, "", "", userID, nil) message.Add("preferences", preferences.ToJson()) a.Publish(message) return nil } -func (a *App) DeletePreferences(userId string, preferences model.Preferences) *model.AppError { +func (a *App) DeletePreferences(userID string, preferences model.Preferences) *model.AppError { for _, preference := range preferences { - if userId != preference.UserId { + if userID != preference.UserId { err := model.NewAppError("DeletePreferences", "api.preference.delete_preferences.delete.app_error", nil, - "userId="+userId+", preference.UserId="+preference.UserId, http.StatusForbidden) + "userId="+userID+", preference.UserId="+preference.UserId, http.StatusForbidden) return err } } for _, preference := range preferences { - if err := a.Srv().Store.Preference().Delete(userId, preference.Category, preference.Name); err != nil { + if err := a.Srv().Store.Preference().Delete(userID, preference.Category, preference.Name); err != nil { return model.NewAppError("DeletePreferences", "app.preference.delete.app_error", nil, err.Error(), http.StatusBadRequest) } } @@ -90,11 +90,11 @@ func (a *App) DeletePreferences(userId string, preferences model.Preferences) *m return model.NewAppError("DeletePreferences", "api.preference.delete_preferences.update_sidebar.app_error", nil, err.Error(), http.StatusInternalServerError) } - message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_SIDEBAR_CATEGORY_UPDATED, "", "", userId, nil) + message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_SIDEBAR_CATEGORY_UPDATED, "", "", userID, nil) // TODO this needs to be updated to include information on which categories changed a.Publish(message) - message = model.NewWebSocketEvent(model.WEBSOCKET_EVENT_PREFERENCES_DELETED, "", "", userId, nil) + message = model.NewWebSocketEvent(model.WEBSOCKET_EVENT_PREFERENCES_DELETED, "", "", userID, nil) message.Add("preferences", preferences.ToJson()) a.Publish(message) diff --git a/app/product_notices.go b/app/product_notices.go index 4fb2ae80bf..ebe63a0d81 100644 --- a/app/product_notices.go +++ b/app/product_notices.go @@ -50,7 +50,7 @@ func cleanupVersion(originalVersion string) string { return strings.Join(versionPartsOut, ".") } -func noticeMatchesConditions(config *model.Config, preferences store.PreferenceStore, userId string, +func noticeMatchesConditions(config *model.Config, preferences store.PreferenceStore, userID string, client model.NoticeClientType, clientVersion string, postCount int64, userCount int64, isSystemAdmin bool, isTeamAdmin bool, isCloud bool, sku string, notice *model.ProductNotice) (bool, error) { cnd := notice.Conditions @@ -153,7 +153,7 @@ func noticeMatchesConditions(config *model.Config, preferences store.PreferenceS // check if user's config matches the notice for k, v := range cnd.UserConfig { - res, err := validateUserConfigEntry(preferences, userId, k, v) + res, err := validateUserConfigEntry(preferences, userID, k, v) if err != nil { return false, err } @@ -172,7 +172,7 @@ func noticeMatchesConditions(config *model.Config, preferences store.PreferenceS return true, nil } -func validateUserConfigEntry(preferences store.PreferenceStore, userId string, key string, expectedValue interface{}) (bool, error) { +func validateUserConfigEntry(preferences store.PreferenceStore, userID string, key string, expectedValue interface{}) (bool, error) { parts := strings.Split(key, ".") if len(parts) != 2 { return false, errors.New("Invalid format of user config. Must be in form of Category.SettingName") @@ -180,7 +180,7 @@ func validateUserConfigEntry(preferences store.PreferenceStore, userId string, k if _, ok := expectedValue.(string); !ok { return false, errors.New("Invalid format of user config. Value should be string") } - pref, err := preferences.Get(userId, parts[0], parts[1]) + pref, err := preferences.Get(userID, parts[0], parts[1]) if err != nil { return false, nil } @@ -204,9 +204,9 @@ func validateConfigEntry(conf *model.Config, path string, expectedValue interfac } // GetProductNotices is called from the frontend to fetch the product notices that are relevant to the caller -func (a *App) GetProductNotices(userId, teamId string, client model.NoticeClientType, clientVersion string, locale string) (model.NoticeMessages, *model.AppError) { +func (a *App) GetProductNotices(userID, teamID string, client model.NoticeClientType, clientVersion string, locale string) (model.NoticeMessages, *model.AppError) { isSystemAdmin := a.SessionHasPermissionTo(*a.Session(), model.PERMISSION_MANAGE_SYSTEM) - isTeamAdmin := a.SessionHasPermissionToTeam(*a.Session(), teamId, model.PERMISSION_MANAGE_TEAM) + isTeamAdmin := a.SessionHasPermissionToTeam(*a.Session(), teamID, model.PERMISSION_MANAGE_TEAM) // check if notices for regular users are disabled if !*a.Srv().Config().AnnouncementSettings.UserNoticesEnabled && !isSystemAdmin { @@ -218,7 +218,7 @@ func (a *App) GetProductNotices(userId, teamId string, client model.NoticeClient return []model.NoticeMessage{}, nil } - views, err := a.Srv().Store.ProductNotices().GetViews(userId) + views, err := a.Srv().Store.ProductNotices().GetViews(userID) if err != nil { return nil, model.NewAppError("GetProductNotices", "api.system.update_viewed_notices.failed", nil, err.Error(), http.StatusBadRequest) } @@ -253,7 +253,7 @@ func (a *App) GetProductNotices(userId, teamId string, client model.NoticeClient result, err := noticeMatchesConditions( a.Config(), a.Srv().Store.Preference(), - userId, + userID, client, clientVersion, cachedPostCount, @@ -281,8 +281,8 @@ func (a *App) GetProductNotices(userId, teamId string, client model.NoticeClient } // UpdateViewedProductNotices is called from the frontend to mark a set of notices as 'viewed' by user -func (a *App) UpdateViewedProductNotices(userId string, noticeIds []string) *model.AppError { - if err := a.Srv().Store.ProductNotices().View(userId, noticeIds); err != nil { +func (a *App) UpdateViewedProductNotices(userID string, noticeIds []string) *model.AppError { + if err := a.Srv().Store.ProductNotices().View(userID, noticeIds); err != nil { return model.NewAppError("UpdateViewedProductNotices", "api.system.update_viewed_notices.failed", nil, err.Error(), http.StatusBadRequest) } return nil @@ -290,13 +290,13 @@ func (a *App) UpdateViewedProductNotices(userId string, noticeIds []string) *mod // UpdateViewedProductNoticesForNewUser is called when new user is created to mark all current notices for this // user as viewed in order to avoid showing them imminently on first login -func (a *App) UpdateViewedProductNoticesForNewUser(userId string) { +func (a *App) UpdateViewedProductNoticesForNewUser(userID string) { var noticeIds []string for _, notice := range cachedNotices { noticeIds = append(noticeIds, notice.ID) } - if err := a.Srv().Store.ProductNotices().View(userId, noticeIds); err != nil { - mlog.Error("Cannot update product notices viewed state for user", mlog.String("userId", userId)) + if err := a.Srv().Store.ProductNotices().View(userID, noticeIds); err != nil { + mlog.Error("Cannot update product notices viewed state for user", mlog.String("userId", userID)) } } diff --git a/app/ratelimit.go b/app/ratelimit.go index 8b4562e2fe..9f0266c8ca 100644 --- a/app/ratelimit.go +++ b/app/ratelimit.go @@ -91,9 +91,9 @@ func (rl *RateLimiter) RateLimitWriter(key string, w http.ResponseWriter) bool { return limited } -func (rl *RateLimiter) UserIdRateLimit(userId string, w http.ResponseWriter) bool { +func (rl *RateLimiter) UserIdRateLimit(userID string, w http.ResponseWriter) bool { if rl.useAuth { - return rl.RateLimitWriter(userId, w) + return rl.RateLimitWriter(userID, w) } return false } diff --git a/app/session.go b/app/session.go index 97016f3712..2993ccdecc 100644 --- a/app/session.go +++ b/app/session.go @@ -144,9 +144,9 @@ func (a *App) GetSession(token string) (*model.Session, *model.AppError) { return session, nil } -func (a *App) GetSessions(userId string) ([]*model.Session, *model.AppError) { +func (a *App) GetSessions(userID string) ([]*model.Session, *model.AppError) { - sessions, err := a.Srv().Store.Session().GetSessions(userId) + sessions, err := a.Srv().Store.Session().GetSessions(userID) if err != nil { return nil, model.NewAppError("GetSessions", "app.session.get_sessions.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -154,10 +154,10 @@ func (a *App) GetSessions(userId string) ([]*model.Session, *model.AppError) { return sessions, nil } -func (a *App) UpdateSessionsIsGuest(userId string, isGuest bool) { - sessions, err := a.Srv().Store.Session().GetSessions(userId) +func (a *App) UpdateSessionsIsGuest(userID string, isGuest bool) { + sessions, err := a.Srv().Store.Session().GetSessions(userID) if err != nil { - mlog.Error("Unable to get user sessions", mlog.String("user_id", userId), mlog.Err(err)) + mlog.Error("Unable to get user sessions", mlog.String("user_id", userID), mlog.Err(err)) return } @@ -172,8 +172,8 @@ func (a *App) UpdateSessionsIsGuest(userId string, isGuest bool) { } } -func (a *App) RevokeAllSessions(userId string) *model.AppError { - sessions, err := a.Srv().Store.Session().GetSessions(userId) +func (a *App) RevokeAllSessions(userID string) *model.AppError { + sessions, err := a.Srv().Store.Session().GetSessions(userID) if err != nil { return model.NewAppError("RevokeAllSessions", "app.session.get_sessions.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -187,7 +187,7 @@ func (a *App) RevokeAllSessions(userId string) *model.AppError { } } - a.ClearSessionCacheForUser(userId) + a.ClearSessionCacheForUser(userID) return nil } @@ -209,14 +209,14 @@ func (a *App) RevokeSessionsFromAllUsers() *model.AppError { return nil } -func (a *App) ClearSessionCacheForUser(userId string) { - a.ClearSessionCacheForUserSkipClusterSend(userId) +func (a *App) ClearSessionCacheForUser(userID string) { + a.ClearSessionCacheForUserSkipClusterSend(userID) if a.Cluster() != nil { msg := &model.ClusterMessage{ Event: model.CLUSTER_EVENT_CLEAR_SESSION_CACHE_FOR_USER, SendType: model.CLUSTER_SEND_RELIABLE, - Data: userId, + Data: userID, } a.Cluster().SendClusterMessage(msg) } @@ -234,12 +234,12 @@ func (a *App) ClearSessionCacheForAllUsers() { } } -func (a *App) ClearSessionCacheForUserSkipClusterSend(userId string) { +func (a *App) ClearSessionCacheForUserSkipClusterSend(userID string) { if keys, err := a.Srv().sessionCache.Keys(); err == nil { var session *model.Session for _, key := range keys { if err := a.Srv().sessionCache.Get(key, &session); err == nil { - if session.UserId == userId { + if session.UserId == userID { a.Srv().sessionCache.Remove(key) if a.Metrics() != nil { a.Metrics().IncrementMemCacheInvalidationCounterSession() @@ -249,7 +249,7 @@ func (a *App) ClearSessionCacheForUserSkipClusterSend(userId string) { } } - a.InvalidateWebConnSessionCacheForUser(userId) + a.InvalidateWebConnSessionCacheForUser(userID) } func (a *App) ClearSessionCacheForAllUsersSkipClusterSend() { @@ -268,14 +268,14 @@ func (a *App) SessionCacheLength() int { return 0 } -func (a *App) RevokeSessionsForDeviceId(userId string, deviceId string, currentSessionId string) *model.AppError { - sessions, err := a.Srv().Store.Session().GetSessions(userId) +func (a *App) RevokeSessionsForDeviceId(userID string, deviceId string, currentSessionId string) *model.AppError { + sessions, err := a.Srv().Store.Session().GetSessions(userID) if err != nil { return model.NewAppError("RevokeSessionsForDeviceId", "app.session.get_sessions.app_error", nil, err.Error(), http.StatusInternalServerError) } for _, session := range sessions { if session.DeviceId == deviceId && session.Id != currentSessionId { - mlog.Debug("Revoking sessionId for userId. Re-login with the same device Id", mlog.String("session_id", session.Id), mlog.String("user_id", userId)) + mlog.Debug("Revoking sessionId for userId. Re-login with the same device Id", mlog.String("session_id", session.Id), mlog.String("user_id", userID)) if err := a.RevokeSession(session); err != nil { mlog.Warn("Could not revoke session for device", mlog.String("device_id", deviceId), mlog.Err(err)) } @@ -590,8 +590,8 @@ func (a *App) GetUserAccessTokens(page, perPage int) ([]*model.UserAccessToken, return tokens, nil } -func (a *App) GetUserAccessTokensForUser(userId string, page, perPage int) ([]*model.UserAccessToken, *model.AppError) { - tokens, err := a.Srv().Store.UserAccessToken().GetByUser(userId, page*perPage, perPage) +func (a *App) GetUserAccessTokensForUser(userID string, page, perPage int) ([]*model.UserAccessToken, *model.AppError) { + tokens, err := a.Srv().Store.UserAccessToken().GetByUser(userID, page*perPage, perPage) if err != nil { return nil, model.NewAppError("GetUserAccessTokensForUser", "app.user_access_token.get_by_user.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -603,8 +603,8 @@ func (a *App) GetUserAccessTokensForUser(userId string, page, perPage int) ([]*m } -func (a *App) GetUserAccessToken(tokenId string, sanitize bool) (*model.UserAccessToken, *model.AppError) { - token, err := a.Srv().Store.UserAccessToken().Get(tokenId) +func (a *App) GetUserAccessToken(tokenID string, sanitize bool) (*model.UserAccessToken, *model.AppError) { + token, err := a.Srv().Store.UserAccessToken().Get(tokenID) if err != nil { var nfErr *store.ErrNotFound switch { diff --git a/app/slack.go b/app/slack.go index 6449cd2acf..fcca21b1aa 100644 --- a/app/slack.go +++ b/app/slack.go @@ -82,13 +82,13 @@ func expandAnnouncement(text string) string { func replaceUserIds(userStore store.UserStore, text string) string { rgx, err := regexp.Compile("<@([a-zA-Z0-9]+)>") if err == nil { - userIds := make([]string, 0) + userIDs := make([]string, 0) matches := rgx.FindAllStringSubmatch(text, -1) for _, match := range matches { - userIds = append(userIds, match[1]) + userIDs = append(userIDs, match[1]) } - if users, err := userStore.GetProfileByIds(userIds, nil, true); err == nil { + if users, err := userStore.GetProfileByIds(userIDs, nil, true); err == nil { for _, user := range users { text = strings.Replace(text, "<@"+user.Id+">", "@"+user.Username, -1) } diff --git a/app/slack_test.go b/app/slack_test.go index b7c73d1a47..e016fa9512 100644 --- a/app/slack_test.go +++ b/app/slack_test.go @@ -25,9 +25,9 @@ func TestProcessSlackText(t *testing.T) { t.Fail() } - userId := th.BasicUser.Id + userID := th.BasicUser.Id username := th.BasicUser.Username - if th.App.ProcessSlackText("<@"+userId+"> hello") != "@"+username+" hello" { + if th.App.ProcessSlackText("<@"+userID+"> hello") != "@"+username+" hello" { t.Fail() } } @@ -36,7 +36,7 @@ func TestProcessSlackAnnouncement(t *testing.T) { th := Setup(t).InitBasic() defer th.TearDown() - userId := th.BasicUser.Id + userID := th.BasicUser.Id username := th.BasicUser.Username attachments := []*model.SlackAttachment{ @@ -53,13 +53,13 @@ func TestProcessSlackAnnouncement(t *testing.T) { }, }, { - Pretext: "<@" + userId + "> pretext", - Text: "<@" + userId + "> text", - Title: "<@" + userId + "> title", + Pretext: "<@" + userID + "> pretext", + Text: "<@" + userID + "> text", + Title: "<@" + userID + "> title", Fields: []*model.SlackAttachmentField{ { Title: "foo", - Value: "<@" + userId + "> bar", + Value: "<@" + userID + "> bar", Short: true, }, }, diff --git a/app/slashcommands/auto_channels.go b/app/slashcommands/auto_channels.go index 9c972def4f..b81c96c3b7 100644 --- a/app/slashcommands/auto_channels.go +++ b/app/slashcommands/auto_channels.go @@ -11,7 +11,7 @@ import ( type AutoChannelCreator struct { a *app.App - userId string + userID string team *model.Team Fuzzy bool DisplayNameLen utils.Range @@ -21,11 +21,11 @@ type AutoChannelCreator struct { ChannelType string } -func NewAutoChannelCreator(a *app.App, team *model.Team, userId string) *AutoChannelCreator { +func NewAutoChannelCreator(a *app.App, team *model.Team, userID string) *AutoChannelCreator { return &AutoChannelCreator{ a: a, team: team, - userId: userId, + userID: userID, Fuzzy: false, DisplayNameLen: ChannelDisplayNameLen, DisplayNameCharset: utils.ALPHANUMERIC, @@ -49,7 +49,7 @@ func (cfg *AutoChannelCreator) createRandomChannel() (*model.Channel, error) { DisplayName: displayName, Name: name, Type: cfg.ChannelType, - CreatorId: cfg.userId, + CreatorId: cfg.userID, } channel, err := cfg.a.CreateChannel(channel, true) diff --git a/app/slashcommands/helper_test.go b/app/slashcommands/helper_test.go index 697047292f..8dcecb4f1e 100644 --- a/app/slashcommands/helper_test.go +++ b/app/slashcommands/helper_test.go @@ -254,7 +254,7 @@ func (th *TestHelper) createChannel(team *model.Team, channelType string) *model return channel } -func (th *TestHelper) createChannelWithAnotherUser(team *model.Team, channelType, userId string) *model.Channel { +func (th *TestHelper) createChannelWithAnotherUser(team *model.Team, channelType, userID string) *model.Channel { id := model.NewId() channel := &model.Channel{ @@ -262,7 +262,7 @@ func (th *TestHelper) createChannelWithAnotherUser(team *model.Team, channelType Name: "name_" + id, Type: channelType, TeamId: team.Id, - CreatorId: userId, + CreatorId: userID, } utils.DisableDebugLogForTest() diff --git a/app/status.go b/app/status.go index e00cf53f23..6436bb5217 100644 --- a/app/status.go +++ b/app/status.go @@ -35,18 +35,18 @@ func (a *App) GetAllStatuses() map[string]*model.Status { } statusMap := map[string]*model.Status{} - if userIds, err := a.Srv().statusCache.Keys(); err == nil { - for _, userId := range userIds { - status := a.GetStatusFromCache(userId) + if userIDs, err := a.Srv().statusCache.Keys(); err == nil { + for _, userID := range userIDs { + status := a.GetStatusFromCache(userID) if status != nil { - statusMap[userId] = status + statusMap[userID] = status } } } return statusMap } -func (a *App) GetStatusesByIds(userIds []string) (map[string]interface{}, *model.AppError) { +func (a *App) GetStatusesByIds(userIDs []string) (map[string]interface{}, *model.AppError) { if !*a.Config().ServiceSettings.EnableUserStatuses { return map[string]interface{}{}, nil } @@ -55,15 +55,15 @@ func (a *App) GetStatusesByIds(userIds []string) (map[string]interface{}, *model metrics := a.Metrics() missingUserIds := []string{} - for _, userId := range userIds { + for _, userID := range userIDs { var status *model.Status - if err := a.Srv().statusCache.Get(userId, &status); err == nil { - statusMap[userId] = status.Status + if err := a.Srv().statusCache.Get(userID, &status); err == nil { + statusMap[userID] = status.Status if metrics != nil { metrics.IncrementMemCacheHitCounter("Status") } } else { - missingUserIds = append(missingUserIds, userId) + missingUserIds = append(missingUserIds, userID) if metrics != nil { metrics.IncrementMemCacheMissCounter("Status") } @@ -84,9 +84,9 @@ func (a *App) GetStatusesByIds(userIds []string) (map[string]interface{}, *model } // For the case where the user does not have a row in the Status table and cache - for _, userId := range missingUserIds { - if _, ok := statusMap[userId]; !ok { - statusMap[userId] = model.STATUS_OFFLINE + for _, userID := range missingUserIds { + if _, ok := statusMap[userID]; !ok { + statusMap[userID] = model.STATUS_OFFLINE } } @@ -94,7 +94,7 @@ func (a *App) GetStatusesByIds(userIds []string) (map[string]interface{}, *model } //GetUserStatusesByIds used by apiV4 -func (a *App) GetUserStatusesByIds(userIds []string) ([]*model.Status, *model.AppError) { +func (a *App) GetUserStatusesByIds(userIDs []string) ([]*model.Status, *model.AppError) { if !*a.Config().ServiceSettings.EnableUserStatuses { return []*model.Status{}, nil } @@ -103,15 +103,15 @@ func (a *App) GetUserStatusesByIds(userIds []string) ([]*model.Status, *model.Ap metrics := a.Metrics() missingUserIds := []string{} - for _, userId := range userIds { + for _, userID := range userIDs { var status *model.Status - if err := a.Srv().statusCache.Get(userId, &status); err == nil { + if err := a.Srv().statusCache.Get(userID, &status); err == nil { statusMap = append(statusMap, status) if metrics != nil { metrics.IncrementMemCacheHitCounter("Status") } } else { - missingUserIds = append(missingUserIds, userId) + missingUserIds = append(missingUserIds, userID) if metrics != nil { metrics.IncrementMemCacheMissCounter("Status") } @@ -145,8 +145,8 @@ func (a *App) GetUserStatusesByIds(userIds []string) ([]*model.Status, *model.Ap } } } - for _, userId := range missingUserIds { - statusMap = append(statusMap, &model.Status{UserId: userId, Status: "offline"}) + for _, userID := range missingUserIds { + statusMap = append(statusMap, &model.Status{UserId: userID, Status: "offline"}) } return statusMap, nil @@ -155,20 +155,20 @@ func (a *App) GetUserStatusesByIds(userIds []string) ([]*model.Status, *model.Ap // SetStatusLastActivityAt sets the last activity at for a user on the local app server and updates // status to away if needed. Used by the WS to set status to away if an 'online' device disconnects // while an 'away' device is still connected -func (a *App) SetStatusLastActivityAt(userId string, activityAt int64) { +func (a *App) SetStatusLastActivityAt(userID string, activityAt int64) { var status *model.Status var err *model.AppError - if status, err = a.GetStatus(userId); err != nil { + if status, err = a.GetStatus(userID); err != nil { return } status.LastActivityAt = activityAt a.AddStatusCacheSkipClusterSend(status) - a.SetStatusAwayIfNeeded(userId, false) + a.SetStatusAwayIfNeeded(userID, false) } -func (a *App) SetStatusOnline(userId string, manual bool) { +func (a *App) SetStatusOnline(userID string, manual bool) { if !*a.Config().ServiceSettings.EnableUserStatuses { return } @@ -181,8 +181,8 @@ func (a *App) SetStatusOnline(userId string, manual bool) { var status *model.Status var err *model.AppError - if status, err = a.GetStatus(userId); err != nil { - status = &model.Status{UserId: userId, Status: model.STATUS_ONLINE, Manual: false, LastActivityAt: model.GetMillis(), ActiveChannel: ""} + if status, err = a.GetStatus(userID); err != nil { + status = &model.Status{UserId: userID, Status: model.STATUS_ONLINE, Manual: false, LastActivityAt: model.GetMillis(), ActiveChannel: ""} broadcast = true } else { if status.Manual && !manual { @@ -209,11 +209,11 @@ func (a *App) SetStatusOnline(userId string, manual bool) { if status.Status != oldStatus || status.Manual != oldManual || status.LastActivityAt-oldTime > model.STATUS_MIN_UPDATE_TIME { if broadcast { if err := a.Srv().Store.Status().SaveOrUpdate(status); err != nil { - mlog.Warn("Failed to save status", mlog.String("user_id", userId), mlog.Err(err), mlog.String("user_id", userId)) + mlog.Warn("Failed to save status", mlog.String("user_id", userID), mlog.Err(err), mlog.String("user_id", userID)) } } else { if err := a.Srv().Store.Status().UpdateLastActivityAt(status.UserId, status.LastActivityAt); err != nil { - mlog.Error("Failed to save status", mlog.String("user_id", userId), mlog.Err(err), mlog.String("user_id", userId)) + mlog.Error("Failed to save status", mlog.String("user_id", userID), mlog.Err(err), mlog.String("user_id", userID)) } } } @@ -234,30 +234,30 @@ func (a *App) BroadcastStatus(status *model.Status) { a.Publish(event) } -func (a *App) SetStatusOffline(userId string, manual bool) { +func (a *App) SetStatusOffline(userID string, manual bool) { if !*a.Config().ServiceSettings.EnableUserStatuses { return } - status, err := a.GetStatus(userId) + status, err := a.GetStatus(userID) if err == nil && status.Manual && !manual { return // manually set status always overrides non-manual one } - status = &model.Status{UserId: userId, Status: model.STATUS_OFFLINE, Manual: manual, LastActivityAt: model.GetMillis(), ActiveChannel: ""} + status = &model.Status{UserId: userID, Status: model.STATUS_OFFLINE, Manual: manual, LastActivityAt: model.GetMillis(), ActiveChannel: ""} a.SaveAndBroadcastStatus(status) } -func (a *App) SetStatusAwayIfNeeded(userId string, manual bool) { +func (a *App) SetStatusAwayIfNeeded(userID string, manual bool) { if !*a.Config().ServiceSettings.EnableUserStatuses { return } - status, err := a.GetStatus(userId) + status, err := a.GetStatus(userID) if err != nil { - status = &model.Status{UserId: userId, Status: model.STATUS_OFFLINE, Manual: manual, LastActivityAt: 0, ActiveChannel: ""} + status = &model.Status{UserId: userID, Status: model.STATUS_OFFLINE, Manual: manual, LastActivityAt: 0, ActiveChannel: ""} } if !manual && status.Manual { @@ -281,15 +281,15 @@ func (a *App) SetStatusAwayIfNeeded(userId string, manual bool) { a.SaveAndBroadcastStatus(status) } -func (a *App) SetStatusDoNotDisturb(userId string) { +func (a *App) SetStatusDoNotDisturb(userID string) { if !*a.Config().ServiceSettings.EnableUserStatuses { return } - status, err := a.GetStatus(userId) + status, err := a.GetStatus(userID) if err != nil { - status = &model.Status{UserId: userId, Status: model.STATUS_OFFLINE, Manual: false, LastActivityAt: 0, ActiveChannel: ""} + status = &model.Status{UserId: userID, Status: model.STATUS_OFFLINE, Manual: false, LastActivityAt: 0, ActiveChannel: ""} } status.Status = model.STATUS_DND @@ -308,15 +308,15 @@ func (a *App) SaveAndBroadcastStatus(status *model.Status) { a.BroadcastStatus(status) } -func (a *App) SetStatusOutOfOffice(userId string) { +func (a *App) SetStatusOutOfOffice(userID string) { if !*a.Config().ServiceSettings.EnableUserStatuses { return } - status, err := a.GetStatus(userId) + status, err := a.GetStatus(userID) if err != nil { - status = &model.Status{UserId: userId, Status: model.STATUS_OUT_OF_OFFICE, Manual: false, LastActivityAt: 0, ActiveChannel: ""} + status = &model.Status{UserId: userID, Status: model.STATUS_OUT_OF_OFFICE, Manual: false, LastActivityAt: 0, ActiveChannel: ""} } status.Status = model.STATUS_OUT_OF_OFFICE @@ -325,9 +325,9 @@ func (a *App) SetStatusOutOfOffice(userId string) { a.SaveAndBroadcastStatus(status) } -func (a *App) GetStatusFromCache(userId string) *model.Status { +func (a *App) GetStatusFromCache(userID string) *model.Status { var status *model.Status - if err := a.Srv().statusCache.Get(userId, &status); err == nil { + if err := a.Srv().statusCache.Get(userID, &status); err == nil { statusCopy := &model.Status{} *statusCopy = *status return statusCopy @@ -336,17 +336,17 @@ func (a *App) GetStatusFromCache(userId string) *model.Status { return nil } -func (a *App) GetStatus(userId string) (*model.Status, *model.AppError) { +func (a *App) GetStatus(userID string) (*model.Status, *model.AppError) { if !*a.Config().ServiceSettings.EnableUserStatuses { return &model.Status{}, nil } - status := a.GetStatusFromCache(userId) + status := a.GetStatusFromCache(userID) if status != nil { return status, nil } - status, err := a.Srv().Store.Status().Get(userId) + status, err := a.Srv().Store.Status().Get(userID) if err != nil { var nfErr *store.ErrNotFound switch { diff --git a/app/team.go b/app/team.go index ba4dee4f17..6525777198 100644 --- a/app/team.go +++ b/app/team.go @@ -48,8 +48,8 @@ func (a *App) CreateTeam(team *model.Team) (*model.Team, *model.AppError) { return rteam, nil } -func (a *App) CreateTeamWithUser(team *model.Team, userId string) (*model.Team, *model.AppError) { - user, err := a.GetUser(userId) +func (a *App) CreateTeamWithUser(team *model.Team, userID string) (*model.Team, *model.AppError) { + user, err := a.GetUser(userID) if err != nil { return nil, err } @@ -237,8 +237,8 @@ func (a *App) UpdateTeamScheme(team *model.Team) (*model.Team, *model.AppError) return oldTeam, nil } -func (a *App) UpdateTeamPrivacy(teamId string, teamType string, allowOpenInvite bool) *model.AppError { - oldTeam, err := a.GetTeam(teamId) +func (a *App) UpdateTeamPrivacy(teamID string, teamType string, allowOpenInvite bool) *model.AppError { + oldTeam, err := a.GetTeam(teamID) if err != nil { return err } @@ -270,8 +270,8 @@ func (a *App) UpdateTeamPrivacy(teamId string, teamType string, allowOpenInvite return nil } -func (a *App) PatchTeam(teamId string, patch *model.TeamPatch) (*model.Team, *model.AppError) { - team, err := a.GetTeam(teamId) +func (a *App) PatchTeam(teamID string, patch *model.TeamPatch) (*model.Team, *model.AppError) { + team, err := a.GetTeam(teamID) if err != nil { return nil, err } @@ -295,8 +295,8 @@ func (a *App) PatchTeam(teamId string, patch *model.TeamPatch) (*model.Team, *mo return team, nil } -func (a *App) RegenerateTeamInviteId(teamId string) (*model.Team, *model.AppError) { - team, err := a.GetTeam(teamId) +func (a *App) RegenerateTeamInviteId(teamID string) (*model.Team, *model.AppError) { + team, err := a.GetTeam(teamID) if err != nil { return nil, err } @@ -327,18 +327,18 @@ func (a *App) sendTeamEvent(team *model.Team, event string) { *sanitizedTeam = *team sanitizedTeam.Sanitize() - teamId := "" // no filtering by teamId by default + teamID := "" // no filtering by teamID by default if event == model.WEBSOCKET_EVENT_UPDATE_TEAM { // in case of update_team event - we send the message only to members of that team - teamId = team.Id + teamID = team.Id } - message := model.NewWebSocketEvent(event, teamId, "", "", nil) + message := model.NewWebSocketEvent(event, teamID, "", "", nil) message.Add("team", sanitizedTeam.ToJson()) a.Publish(message) } -func (a *App) GetSchemeRolesForTeam(teamId string) (string, string, string, *model.AppError) { - team, err := a.GetTeam(teamId) +func (a *App) GetSchemeRolesForTeam(teamID string) (string, string, string, *model.AppError) { + team, err := a.GetTeam(teamID) if err != nil { return "", "", "", err } @@ -354,8 +354,8 @@ func (a *App) GetSchemeRolesForTeam(teamId string) (string, string, string, *mod return model.TEAM_GUEST_ROLE_ID, model.TEAM_USER_ROLE_ID, model.TEAM_ADMIN_ROLE_ID, nil } -func (a *App) UpdateTeamMemberRoles(teamId string, userId string, newRoles string) (*model.TeamMember, *model.AppError) { - member, nErr := a.Srv().Store.Team().GetMember(teamId, userId) +func (a *App) UpdateTeamMemberRoles(teamID string, userID string, newRoles string) (*model.TeamMember, *model.AppError) { + member, nErr := a.Srv().Store.Team().GetMember(teamID, userID) if nErr != nil { var nfErr *store.ErrNotFound switch { @@ -367,10 +367,10 @@ func (a *App) UpdateTeamMemberRoles(teamId string, userId string, newRoles strin } if member == nil { - return nil, model.NewAppError("UpdateTeamMemberRoles", "api.team.update_member_roles.not_a_member", nil, "userId="+userId+" teamId="+teamId, http.StatusBadRequest) + return nil, model.NewAppError("UpdateTeamMemberRoles", "api.team.update_member_roles.not_a_member", nil, "userId="+userID+" teamId="+teamID, http.StatusBadRequest) } - schemeGuestRole, schemeUserRole, schemeAdminRole, err := a.GetSchemeRolesForTeam(teamId) + schemeGuestRole, schemeUserRole, schemeAdminRole, err := a.GetSchemeRolesForTeam(teamID) if err != nil { return nil, err } @@ -429,15 +429,15 @@ func (a *App) UpdateTeamMemberRoles(teamId string, userId string, newRoles strin } } - a.ClearSessionCacheForUser(userId) + a.ClearSessionCacheForUser(userID) - a.sendUpdatedMemberRoleEvent(userId, member) + a.sendUpdatedMemberRoleEvent(userID, member) return member, nil } -func (a *App) UpdateTeamMemberSchemeRoles(teamId string, userId string, isSchemeGuest bool, isSchemeUser bool, isSchemeAdmin bool) (*model.TeamMember, *model.AppError) { - member, err := a.GetTeamMember(teamId, userId) +func (a *App) UpdateTeamMemberSchemeRoles(teamID string, userID string, isSchemeGuest bool, isSchemeUser bool, isSchemeAdmin bool) (*model.TeamMember, *model.AppError) { + member, err := a.GetTeamMember(teamID, userID) if err != nil { return nil, err } @@ -466,30 +466,30 @@ func (a *App) UpdateTeamMemberSchemeRoles(teamId string, userId string, isScheme } } - a.ClearSessionCacheForUser(userId) + a.ClearSessionCacheForUser(userID) - a.sendUpdatedMemberRoleEvent(userId, member) + a.sendUpdatedMemberRoleEvent(userID, member) return member, nil } -func (a *App) sendUpdatedMemberRoleEvent(userId string, member *model.TeamMember) { - message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_MEMBERROLE_UPDATED, "", "", userId, nil) +func (a *App) sendUpdatedMemberRoleEvent(userID string, member *model.TeamMember) { + message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_MEMBERROLE_UPDATED, "", "", userID, nil) message.Add("member", member.ToJson()) a.Publish(message) } -func (a *App) AddUserToTeam(teamId string, userId string, userRequestorId string) (*model.Team, *model.AppError) { +func (a *App) AddUserToTeam(teamID string, userID string, userRequestorId string) (*model.Team, *model.AppError) { tchan := make(chan store.StoreResult, 1) go func() { - team, err := a.Srv().Store.Team().Get(teamId) + team, err := a.Srv().Store.Team().Get(teamID) tchan <- store.StoreResult{Data: team, NErr: err} close(tchan) }() uchan := make(chan store.StoreResult, 1) go func() { - user, err := a.Srv().Store.User().Get(userId) + user, err := a.Srv().Store.User().Get(userID) uchan <- store.StoreResult{Data: user, NErr: err} close(uchan) }() @@ -525,8 +525,8 @@ func (a *App) AddUserToTeam(teamId string, userId string, userRequestorId string return team, nil } -func (a *App) AddUserToTeamByTeamId(teamId string, user *model.User) *model.AppError { - team, err := a.Srv().Store.Team().Get(teamId) +func (a *App) AddUserToTeamByTeamId(teamID string, user *model.User) *model.AppError { + team, err := a.Srv().Store.Team().Get(teamID) if err != nil { var nfErr *store.ErrNotFound switch { @@ -540,8 +540,8 @@ func (a *App) AddUserToTeamByTeamId(teamId string, user *model.User) *model.AppE return a.JoinUserToTeam(team, user, "") } -func (a *App) AddUserToTeamByToken(userId string, tokenId string) (*model.Team, *model.AppError) { - token, err := a.Srv().Store.Token().GetByToken(tokenId) +func (a *App) AddUserToTeamByToken(userID string, tokenID string) (*model.Team, *model.AppError) { + token, err := a.Srv().Store.Token().GetByToken(tokenID) if err != nil { return nil, model.NewAppError("AddUserToTeamByToken", "api.user.create_user.signup_link_invalid.app_error", nil, err.Error(), http.StatusBadRequest) } @@ -566,7 +566,7 @@ func (a *App) AddUserToTeamByToken(userId string, tokenId string) (*model.Team, uchan := make(chan store.StoreResult, 1) go func() { - user, err := a.Srv().Store.User().Get(userId) + user, err := a.Srv().Store.User().Get(userID) uchan <- store.StoreResult{Data: user, NErr: err} close(uchan) }() @@ -631,7 +631,7 @@ func (a *App) AddUserToTeamByToken(userId string, tokenId string) (*model.Team, return team, nil } -func (a *App) AddUserToTeamByInviteId(inviteId string, userId string) (*model.Team, *model.AppError) { +func (a *App) AddUserToTeamByInviteId(inviteId string, userID string) (*model.Team, *model.AppError) { tchan := make(chan store.StoreResult, 1) go func() { team, err := a.Srv().Store.Team().GetByInviteId(inviteId) @@ -641,7 +641,7 @@ func (a *App) AddUserToTeamByInviteId(inviteId string, userId string) (*model.Te uchan := make(chan store.StoreResult, 1) go func() { - user, err := a.Srv().Store.User().Get(userId) + user, err := a.Srv().Store.User().Get(userID) uchan <- store.StoreResult{Data: user, NErr: err} close(uchan) }() @@ -818,8 +818,8 @@ func (a *App) JoinUserToTeam(team *model.Team, user *model.User, userRequestorId return nil } -func (a *App) GetTeam(teamId string) (*model.Team, *model.AppError) { - team, err := a.Srv().Store.Team().Get(teamId) +func (a *App) GetTeam(teamID string) (*model.Team, *model.AppError) { + team, err := a.Srv().Store.Team().Get(teamID) if err != nil { var nfErr *store.ErrNotFound switch { @@ -988,8 +988,8 @@ func (a *App) SearchPrivateTeams(term string) ([]*model.Team, *model.AppError) { return teams, nil } -func (a *App) GetTeamsForUser(userId string) ([]*model.Team, *model.AppError) { - teams, err := a.Srv().Store.Team().GetTeamsByUserId(userId) +func (a *App) GetTeamsForUser(userID string) ([]*model.Team, *model.AppError) { + teams, err := a.Srv().Store.Team().GetTeamsByUserId(userID) if err != nil { return nil, model.NewAppError("GetTeamsForUser", "app.team.get_all.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -997,8 +997,8 @@ func (a *App) GetTeamsForUser(userId string) ([]*model.Team, *model.AppError) { return teams, nil } -func (a *App) GetTeamMember(teamId, userId string) (*model.TeamMember, *model.AppError) { - teamMember, err := a.Srv().Store.Team().GetMember(teamId, userId) +func (a *App) GetTeamMember(teamID, userID string) (*model.TeamMember, *model.AppError) { + teamMember, err := a.Srv().Store.Team().GetMember(teamID, userID) if err != nil { var nfErr *store.ErrNotFound switch { @@ -1012,8 +1012,8 @@ func (a *App) GetTeamMember(teamId, userId string) (*model.TeamMember, *model.Ap return teamMember, nil } -func (a *App) GetTeamMembersForUser(userId string) ([]*model.TeamMember, *model.AppError) { - teamMembers, err := a.Srv().Store.Team().GetTeamsForUser(context.Background(), userId) +func (a *App) GetTeamMembersForUser(userID string) ([]*model.TeamMember, *model.AppError) { + teamMembers, err := a.Srv().Store.Team().GetTeamsForUser(context.Background(), userID) if err != nil { return nil, model.NewAppError("GetTeamMembersForUser", "app.team.get_members.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -1021,8 +1021,8 @@ func (a *App) GetTeamMembersForUser(userId string) ([]*model.TeamMember, *model. return teamMembers, nil } -func (a *App) GetTeamMembersForUserWithPagination(userId string, page, perPage int) ([]*model.TeamMember, *model.AppError) { - teamMembers, err := a.Srv().Store.Team().GetTeamsForUserWithPagination(userId, page, perPage) +func (a *App) GetTeamMembersForUserWithPagination(userID string, page, perPage int) ([]*model.TeamMember, *model.AppError) { + teamMembers, err := a.Srv().Store.Team().GetTeamsForUserWithPagination(userID, page, perPage) if err != nil { return nil, model.NewAppError("GetTeamMembersForUserWithPagination", "app.team.get_members.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -1030,8 +1030,8 @@ func (a *App) GetTeamMembersForUserWithPagination(userId string, page, perPage i return teamMembers, nil } -func (a *App) GetTeamMembers(teamId string, offset int, limit int, teamMembersGetOptions *model.TeamMembersGetOptions) ([]*model.TeamMember, *model.AppError) { - teamMembers, err := a.Srv().Store.Team().GetMembers(teamId, offset, limit, teamMembersGetOptions) +func (a *App) GetTeamMembers(teamID string, offset int, limit int, teamMembersGetOptions *model.TeamMembersGetOptions) ([]*model.TeamMember, *model.AppError) { + teamMembers, err := a.Srv().Store.Team().GetMembers(teamID, offset, limit, teamMembersGetOptions) if err != nil { return nil, model.NewAppError("GetTeamMembers", "app.team.get_members.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -1039,8 +1039,8 @@ func (a *App) GetTeamMembers(teamId string, offset int, limit int, teamMembersGe return teamMembers, nil } -func (a *App) GetTeamMembersByIds(teamId string, userIds []string, restrictions *model.ViewUsersRestrictions) ([]*model.TeamMember, *model.AppError) { - teamMembers, err := a.Srv().Store.Team().GetMembersByIds(teamId, userIds, restrictions) +func (a *App) GetTeamMembersByIds(teamID string, userIDs []string, restrictions *model.ViewUsersRestrictions) ([]*model.TeamMember, *model.AppError) { + teamMembers, err := a.Srv().Store.Team().GetMembersByIds(teamID, userIDs, restrictions) if err != nil { return nil, model.NewAppError("GetTeamMembersByIds", "app.team.get_members_by_ids.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -1048,32 +1048,32 @@ func (a *App) GetTeamMembersByIds(teamId string, userIds []string, restrictions return teamMembers, nil } -func (a *App) AddTeamMember(teamId, userId string) (*model.TeamMember, *model.AppError) { - if _, err := a.AddUserToTeam(teamId, userId, ""); err != nil { +func (a *App) AddTeamMember(teamID, userID string) (*model.TeamMember, *model.AppError) { + if _, err := a.AddUserToTeam(teamID, userID, ""); err != nil { return nil, err } - teamMember, err := a.GetTeamMember(teamId, userId) + teamMember, err := a.GetTeamMember(teamID, userID) if err != nil { return nil, err } - message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_ADDED_TO_TEAM, "", "", userId, nil) - message.Add("team_id", teamId) - message.Add("user_id", userId) + message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_ADDED_TO_TEAM, "", "", userID, nil) + message.Add("team_id", teamID) + message.Add("user_id", userID) a.Publish(message) return teamMember, nil } -func (a *App) AddTeamMembers(teamId string, userIds []string, userRequestorId string, graceful bool) ([]*model.TeamMemberWithError, *model.AppError) { +func (a *App) AddTeamMembers(teamID string, userIDs []string, userRequestorId string, graceful bool) ([]*model.TeamMemberWithError, *model.AppError) { var membersWithErrors []*model.TeamMemberWithError - for _, userId := range userIds { - if _, err := a.AddUserToTeam(teamId, userId, userRequestorId); err != nil { + for _, userID := range userIDs { + if _, err := a.AddUserToTeam(teamID, userID, userRequestorId); err != nil { if graceful { membersWithErrors = append(membersWithErrors, &model.TeamMemberWithError{ - UserId: userId, + UserId: userID, Error: err, }) continue @@ -1081,31 +1081,31 @@ func (a *App) AddTeamMembers(teamId string, userIds []string, userRequestorId st return nil, err } - teamMember, err := a.GetTeamMember(teamId, userId) + teamMember, err := a.GetTeamMember(teamID, userID) if err != nil { return nil, err } membersWithErrors = append(membersWithErrors, &model.TeamMemberWithError{ - UserId: userId, + UserId: userID, Member: teamMember, }) - message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_ADDED_TO_TEAM, "", "", userId, nil) - message.Add("team_id", teamId) - message.Add("user_id", userId) + message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_ADDED_TO_TEAM, "", "", userID, nil) + message.Add("team_id", teamID) + message.Add("user_id", userID) a.Publish(message) } return membersWithErrors, nil } -func (a *App) AddTeamMemberByToken(userId, tokenId string) (*model.TeamMember, *model.AppError) { - team, err := a.AddUserToTeamByToken(userId, tokenId) +func (a *App) AddTeamMemberByToken(userID, tokenID string) (*model.TeamMember, *model.AppError) { + team, err := a.AddUserToTeamByToken(userID, tokenID) if err != nil { return nil, err } - teamMember, err := a.GetTeamMember(team.Id, userId) + teamMember, err := a.GetTeamMember(team.Id, userID) if err != nil { return nil, err } @@ -1113,8 +1113,8 @@ func (a *App) AddTeamMemberByToken(userId, tokenId string) (*model.TeamMember, * return teamMember, nil } -func (a *App) AddTeamMemberByInviteId(inviteId, userId string) (*model.TeamMember, *model.AppError) { - team, err := a.AddUserToTeamByInviteId(inviteId, userId) +func (a *App) AddTeamMemberByInviteId(inviteId, userID string) (*model.TeamMember, *model.AppError) { + team, err := a.AddUserToTeamByInviteId(inviteId, userID) if err != nil { return nil, err } @@ -1123,15 +1123,15 @@ func (a *App) AddTeamMemberByInviteId(inviteId, userId string) (*model.TeamMembe return nil, model.NewAppError("AddTeamMemberByInviteId", "app.team.invite_id.group_constrained.error", nil, "", http.StatusForbidden) } - teamMember, err := a.GetTeamMember(team.Id, userId) + teamMember, err := a.GetTeamMember(team.Id, userID) if err != nil { return nil, err } return teamMember, nil } -func (a *App) GetTeamUnread(teamId, userId string) (*model.TeamUnread, *model.AppError) { - channelUnreads, err := a.Srv().Store.Team().GetChannelUnreadsForTeam(teamId, userId) +func (a *App) GetTeamUnread(teamID, userID string) (*model.TeamUnread, *model.AppError) { + channelUnreads, err := a.Srv().Store.Team().GetChannelUnreadsForTeam(teamID, userID) if err != nil { return nil, model.NewAppError("GetTeamUnread", "app.team.get_unread.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -1139,7 +1139,7 @@ func (a *App) GetTeamUnread(teamId, userId string) (*model.TeamUnread, *model.Ap var teamUnread = &model.TeamUnread{ MsgCount: 0, MentionCount: 0, - TeamId: teamId, + TeamId: teamID, } for _, cu := range channelUnreads { @@ -1153,17 +1153,17 @@ func (a *App) GetTeamUnread(teamId, userId string) (*model.TeamUnread, *model.Ap return teamUnread, nil } -func (a *App) RemoveUserFromTeam(teamId string, userId string, requestorId string) *model.AppError { +func (a *App) RemoveUserFromTeam(teamID string, userID string, requestorId string) *model.AppError { tchan := make(chan store.StoreResult, 1) go func() { - team, err := a.Srv().Store.Team().Get(teamId) + team, err := a.Srv().Store.Team().Get(teamID) tchan <- store.StoreResult{Data: team, NErr: err} close(tchan) }() uchan := make(chan store.StoreResult, 1) go func() { - user, err := a.Srv().Store.User().Get(userId) + user, err := a.Srv().Store.User().Get(userID) uchan <- store.StoreResult{Data: user, NErr: err} close(uchan) }() @@ -1358,10 +1358,10 @@ func (a *App) postRemoveFromTeamMessage(user *model.User, channel *model.Channel return nil } -func (a *App) prepareInviteNewUsersToTeam(teamId, senderId string) (*model.User, *model.Team, *model.AppError) { +func (a *App) prepareInviteNewUsersToTeam(teamID, senderId string) (*model.User, *model.Team, *model.AppError) { tchan := make(chan store.StoreResult, 1) go func() { - team, err := a.Srv().Store.Team().Get(teamId) + team, err := a.Srv().Store.Team().Get(teamID) tchan <- store.StoreResult{Data: team, NErr: err} close(tchan) }() @@ -1440,7 +1440,7 @@ func (a *App) GetErrorListForEmailsOverLimit(emailList []string, cloudUserLimit return emailList, invitesNotSent, nil } -func (a *App) InviteNewUsersToTeamGracefully(emailList []string, teamId, senderId string) ([]*model.EmailInviteWithError, *model.AppError) { +func (a *App) InviteNewUsersToTeamGracefully(emailList []string, teamID, senderId string) ([]*model.EmailInviteWithError, *model.AppError) { if !*a.Config().ServiceSettings.EnableEmailInvitations { return nil, model.NewAppError("InviteNewUsersToTeam", "api.team.invite_members.disabled.app_error", nil, "", http.StatusNotImplemented) } @@ -1449,7 +1449,7 @@ func (a *App) InviteNewUsersToTeamGracefully(emailList []string, teamId, senderI err := model.NewAppError("InviteNewUsersToTeam", "api.team.invite_members.no_one.app_error", nil, "", http.StatusBadRequest) return nil, err } - user, team, err := a.prepareInviteNewUsersToTeam(teamId, senderId) + user, team, err := a.prepareInviteNewUsersToTeam(teamID, senderId) if err != nil { return nil, err } @@ -1480,14 +1480,14 @@ func (a *App) InviteNewUsersToTeamGracefully(emailList []string, teamId, senderI return inviteListWithErrors, nil } -func (a *App) prepareInviteGuestsToChannels(teamId string, guestsInvite *model.GuestsInvite, senderId string) (*model.User, *model.Team, []*model.Channel, *model.AppError) { +func (a *App) prepareInviteGuestsToChannels(teamID string, guestsInvite *model.GuestsInvite, senderId string) (*model.User, *model.Team, []*model.Channel, *model.AppError) { if err := guestsInvite.IsValid(); err != nil { return nil, nil, nil, err } tchan := make(chan store.StoreResult, 1) go func() { - team, err := a.Srv().Store.Team().Get(teamId) + team, err := a.Srv().Store.Team().Get(teamID) tchan <- store.StoreResult{Data: team, NErr: err} close(tchan) }() @@ -1535,19 +1535,19 @@ func (a *App) prepareInviteGuestsToChannels(teamId string, guestsInvite *model.G team := result.Data.(*model.Team) for _, channel := range channels { - if channel.TeamId != teamId { + if channel.TeamId != teamID { return nil, nil, nil, model.NewAppError("prepareInviteGuestsToChannels", "api.team.invite_guests.channel_in_invalid_team.app_error", nil, "", http.StatusBadRequest) } } return user, team, channels, nil } -func (a *App) InviteGuestsToChannelsGracefully(teamId string, guestsInvite *model.GuestsInvite, senderId string) ([]*model.EmailInviteWithError, *model.AppError) { +func (a *App) InviteGuestsToChannelsGracefully(teamID string, guestsInvite *model.GuestsInvite, senderId string) ([]*model.EmailInviteWithError, *model.AppError) { if !*a.Config().ServiceSettings.EnableEmailInvitations { return nil, model.NewAppError("InviteGuestsToChannelsGracefully", "api.team.invite_members.disabled.app_error", nil, "", http.StatusNotImplemented) } - user, team, channels, err := a.prepareInviteGuestsToChannels(teamId, guestsInvite, senderId) + user, team, channels, err := a.prepareInviteGuestsToChannels(teamID, guestsInvite, senderId) if err != nil { return nil, err } @@ -1582,7 +1582,7 @@ func (a *App) InviteGuestsToChannelsGracefully(teamId string, guestsInvite *mode return inviteListWithErrors, nil } -func (a *App) InviteNewUsersToTeam(emailList []string, teamId, senderId string) *model.AppError { +func (a *App) InviteNewUsersToTeam(emailList []string, teamID, senderId string) *model.AppError { if !*a.Config().ServiceSettings.EnableEmailInvitations { return model.NewAppError("InviteNewUsersToTeam", "api.team.invite_members.disabled.app_error", nil, "", http.StatusNotImplemented) } @@ -1592,7 +1592,7 @@ func (a *App) InviteNewUsersToTeam(emailList []string, teamId, senderId string) return err } - user, team, err := a.prepareInviteNewUsersToTeam(teamId, senderId) + user, team, err := a.prepareInviteNewUsersToTeam(teamID, senderId) if err != nil { return err } @@ -1620,12 +1620,12 @@ func (a *App) InviteNewUsersToTeam(emailList []string, teamId, senderId string) return nil } -func (a *App) InviteGuestsToChannels(teamId string, guestsInvite *model.GuestsInvite, senderId string) *model.AppError { +func (a *App) InviteGuestsToChannels(teamID string, guestsInvite *model.GuestsInvite, senderId string) *model.AppError { if !*a.Config().ServiceSettings.EnableEmailInvitations { return model.NewAppError("InviteNewUsersToTeam", "api.team.invite_members.disabled.app_error", nil, "", http.StatusNotImplemented) } - user, team, channels, err := a.prepareInviteGuestsToChannels(teamId, guestsInvite, senderId) + user, team, channels, err := a.prepareInviteGuestsToChannels(teamID, guestsInvite, senderId) if err != nil { return err } @@ -1662,8 +1662,8 @@ func (a *App) FindTeamByName(name string) bool { return true } -func (a *App) GetTeamsUnreadForUser(excludeTeamId string, userId string) ([]*model.TeamUnread, *model.AppError) { - data, err := a.Srv().Store.Team().GetChannelUnreadsForAllTeams(excludeTeamId, userId) +func (a *App) GetTeamsUnreadForUser(excludeTeamId string, userID string) ([]*model.TeamUnread, *model.AppError) { + data, err := a.Srv().Store.Team().GetChannelUnreadsForAllTeams(excludeTeamId, userID) if err != nil { return nil, model.NewAppError("GetTeamsUnreadForUser", "app.team.get_unread.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -1701,8 +1701,8 @@ func (a *App) GetTeamsUnreadForUser(excludeTeamId string, userId string) ([]*mod return members, nil } -func (a *App) PermanentDeleteTeamId(teamId string) *model.AppError { - team, err := a.GetTeam(teamId) +func (a *App) PermanentDeleteTeamId(teamID string) *model.AppError { + team, err := a.GetTeam(teamID) if err != nil { return err } @@ -1753,8 +1753,8 @@ func (a *App) PermanentDeleteTeam(team *model.Team) *model.AppError { return nil } -func (a *App) SoftDeleteTeam(teamId string) *model.AppError { - team, err := a.GetTeam(teamId) +func (a *App) SoftDeleteTeam(teamID string) *model.AppError { + team, err := a.GetTeam(teamID) if err != nil { return err } @@ -1779,8 +1779,8 @@ func (a *App) SoftDeleteTeam(teamId string) *model.AppError { return nil } -func (a *App) RestoreTeam(teamId string) *model.AppError { - team, err := a.GetTeam(teamId) +func (a *App) RestoreTeam(teamID string) *model.AppError { + team, err := a.GetTeam(teamID) if err != nil { return err } @@ -1804,22 +1804,22 @@ func (a *App) RestoreTeam(teamId string) *model.AppError { return nil } -func (a *App) GetTeamStats(teamId string, restrictions *model.ViewUsersRestrictions) (*model.TeamStats, *model.AppError) { +func (a *App) GetTeamStats(teamID string, restrictions *model.ViewUsersRestrictions) (*model.TeamStats, *model.AppError) { tchan := make(chan store.StoreResult, 1) go func() { - totalMemberCount, err := a.Srv().Store.Team().GetTotalMemberCount(teamId, restrictions) + totalMemberCount, err := a.Srv().Store.Team().GetTotalMemberCount(teamID, restrictions) tchan <- store.StoreResult{Data: totalMemberCount, NErr: err} close(tchan) }() achan := make(chan store.StoreResult, 1) go func() { - memberCount, err := a.Srv().Store.Team().GetActiveMemberCount(teamId, restrictions) + memberCount, err := a.Srv().Store.Team().GetActiveMemberCount(teamID, restrictions) achan <- store.StoreResult{Data: memberCount, NErr: err} close(achan) }() stats := &model.TeamStats{} - stats.TeamId = teamId + stats.TeamId = teamID result := <-tchan if result.NErr != nil { @@ -1837,11 +1837,11 @@ func (a *App) GetTeamStats(teamId string, restrictions *model.ViewUsersRestricti } func (a *App) GetTeamIdFromQuery(query url.Values) (string, *model.AppError) { - tokenId := query.Get("t") + tokenID := query.Get("t") inviteId := query.Get("id") - if tokenId != "" { - token, err := a.Srv().Store.Token().GetByToken(tokenId) + if tokenID != "" { + token, err := a.Srv().Store.Token().GetByToken(tokenID) if err != nil { return "", model.NewAppError("GetTeamIdFromQuery", "api.oauth.singup_with_oauth.invalid_link.app_error", nil, "", http.StatusBadRequest) } @@ -1910,17 +1910,17 @@ func (a *App) GetTeamIcon(team *model.Team) ([]byte, *model.AppError) { return data, nil } -func (a *App) SetTeamIcon(teamId string, imageData *multipart.FileHeader) *model.AppError { +func (a *App) SetTeamIcon(teamID string, imageData *multipart.FileHeader) *model.AppError { file, err := imageData.Open() if err != nil { return model.NewAppError("SetTeamIcon", "api.team.set_team_icon.open.app_error", nil, err.Error(), http.StatusBadRequest) } defer file.Close() - return a.SetTeamIconFromMultiPartFile(teamId, file) + return a.SetTeamIconFromMultiPartFile(teamID, file) } -func (a *App) SetTeamIconFromMultiPartFile(teamId string, file multipart.File) *model.AppError { - team, getTeamErr := a.GetTeam(teamId) +func (a *App) SetTeamIconFromMultiPartFile(teamID string, file multipart.File) *model.AppError { + team, getTeamErr := a.GetTeam(teamID) if getTeamErr != nil { return model.NewAppError("SetTeamIcon", "api.team.set_team_icon.get_team.app_error", nil, getTeamErr.Error(), http.StatusBadRequest) @@ -1988,13 +1988,13 @@ func (a *App) SetTeamIconFromFile(team *model.Team, file io.Reader) *model.AppEr return nil } -func (a *App) RemoveTeamIcon(teamId string) *model.AppError { - team, err := a.GetTeam(teamId) +func (a *App) RemoveTeamIcon(teamID string) *model.AppError { + team, err := a.GetTeam(teamID) if err != nil { return model.NewAppError("RemoveTeamIcon", "api.team.remove_team_icon.get_team.app_error", nil, err.Error(), http.StatusBadRequest) } - if err := a.Srv().Store.Team().UpdateLastTeamIconUpdate(teamId, 0); err != nil { + if err := a.Srv().Store.Team().UpdateLastTeamIconUpdate(teamID, 0); err != nil { return model.NewAppError("RemoveTeamIcon", "api.team.team_icon.update.app_error", nil, err.Error(), http.StatusBadRequest) } diff --git a/app/team_test.go b/app/team_test.go index fddfd6a653..5682c114c2 100644 --- a/app/team_test.go +++ b/app/team_test.go @@ -531,12 +531,12 @@ func TestSanitizeTeam(t *testing.T) { } t.Run("not a user of the team", func(t *testing.T) { - userId := model.NewId() + userID := model.NewId() session := model.Session{ Roles: model.SYSTEM_USER_ROLE_ID, TeamMembers: []*model.TeamMember{ { - UserId: userId, + UserId: userID, TeamId: model.NewId(), Roles: model.TEAM_USER_ROLE_ID, }, @@ -549,12 +549,12 @@ func TestSanitizeTeam(t *testing.T) { }) t.Run("user of the team", func(t *testing.T) { - userId := model.NewId() + userID := model.NewId() session := model.Session{ Roles: model.SYSTEM_USER_ROLE_ID, TeamMembers: []*model.TeamMember{ { - UserId: userId, + UserId: userID, TeamId: team.Id, Roles: model.TEAM_USER_ROLE_ID, }, @@ -567,12 +567,12 @@ func TestSanitizeTeam(t *testing.T) { }) t.Run("team admin", func(t *testing.T) { - userId := model.NewId() + userID := model.NewId() session := model.Session{ Roles: model.SYSTEM_USER_ROLE_ID, TeamMembers: []*model.TeamMember{ { - UserId: userId, + UserId: userID, TeamId: team.Id, Roles: model.TEAM_USER_ROLE_ID + " " + model.TEAM_ADMIN_ROLE_ID, }, @@ -585,12 +585,12 @@ func TestSanitizeTeam(t *testing.T) { }) t.Run("team admin of another team", func(t *testing.T) { - userId := model.NewId() + userID := model.NewId() session := model.Session{ Roles: model.SYSTEM_USER_ROLE_ID, TeamMembers: []*model.TeamMember{ { - UserId: userId, + UserId: userID, TeamId: model.NewId(), Roles: model.TEAM_USER_ROLE_ID + " " + model.TEAM_ADMIN_ROLE_ID, }, @@ -603,12 +603,12 @@ func TestSanitizeTeam(t *testing.T) { }) t.Run("system admin, not a user of team", func(t *testing.T) { - userId := model.NewId() + userID := model.NewId() session := model.Session{ Roles: model.SYSTEM_USER_ROLE_ID + " " + model.SYSTEM_ADMIN_ROLE_ID, TeamMembers: []*model.TeamMember{ { - UserId: userId, + UserId: userID, TeamId: model.NewId(), Roles: model.TEAM_USER_ROLE_ID, }, @@ -621,12 +621,12 @@ func TestSanitizeTeam(t *testing.T) { }) t.Run("system admin, user of team", func(t *testing.T) { - userId := model.NewId() + userID := model.NewId() session := model.Session{ Roles: model.SYSTEM_USER_ROLE_ID + " " + model.SYSTEM_ADMIN_ROLE_ID, TeamMembers: []*model.TeamMember{ { - UserId: userId, + UserId: userID, TeamId: team.Id, Roles: model.TEAM_USER_ROLE_ID, }, @@ -657,17 +657,17 @@ func TestSanitizeTeams(t *testing.T) { }, } - userId := model.NewId() + userID := model.NewId() session := model.Session{ Roles: model.SYSTEM_USER_ROLE_ID, TeamMembers: []*model.TeamMember{ { - UserId: userId, + UserId: userID, TeamId: teams[0].Id, Roles: model.TEAM_USER_ROLE_ID, }, { - UserId: userId, + UserId: userID, TeamId: teams[1].Id, Roles: model.TEAM_USER_ROLE_ID + " " + model.TEAM_ADMIN_ROLE_ID, }, @@ -694,12 +694,12 @@ func TestSanitizeTeams(t *testing.T) { }, } - userId := model.NewId() + userID := model.NewId() session := model.Session{ Roles: model.SYSTEM_USER_ROLE_ID + " " + model.SYSTEM_ADMIN_ROLE_ID, TeamMembers: []*model.TeamMember{ { - UserId: userId, + UserId: userID, TeamId: teams[0].Id, Roles: model.TEAM_USER_ROLE_ID, }, diff --git a/app/terms_of_service.go b/app/terms_of_service.go index 5df07124fc..ebfb0cec92 100644 --- a/app/terms_of_service.go +++ b/app/terms_of_service.go @@ -11,13 +11,13 @@ import ( "github.com/mattermost/mattermost-server/v5/store" ) -func (a *App) CreateTermsOfService(text, userId string) (*model.TermsOfService, *model.AppError) { +func (a *App) CreateTermsOfService(text, userID string) (*model.TermsOfService, *model.AppError) { termsOfService := &model.TermsOfService{ Text: text, - UserId: userId, + UserId: userID, } - if _, appErr := a.GetUser(userId); appErr != nil { + if _, appErr := a.GetUser(userID); appErr != nil { return nil, appErr } diff --git a/app/upload.go b/app/upload.go index ea8e02e06f..d5ac169494 100644 --- a/app/upload.go +++ b/app/upload.go @@ -153,8 +153,8 @@ func (a *App) GetUploadSession(uploadId string) (*model.UploadSession, *model.Ap return us, nil } -func (a *App) GetUploadSessionsForUser(userId string) ([]*model.UploadSession, *model.AppError) { - uss, err := a.Srv().Store.UploadSession().GetForUser(userId) +func (a *App) GetUploadSessionsForUser(userID string) ([]*model.UploadSession, *model.AppError) { + uss, err := a.Srv().Store.UploadSession().GetForUser(userID) if err != nil { return nil, model.NewAppError("GetUploadsForUser", "app.upload.get_for_user.app_error", nil, err.Error(), http.StatusInternalServerError) diff --git a/app/user.go b/app/user.go index 245109db93..fdd66355f7 100644 --- a/app/user.go +++ b/app/user.go @@ -273,7 +273,7 @@ func (a *App) createUserOrGuest(user *model.User, guest bool) (*model.User, *mod if appErr != nil { return nil, appErr } - // This message goes to everyone, so the teamId, channelId and userId are irrelevant + // This message goes to everyone, so the teamID, channelId and userID are irrelevant message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_NEW_USER, "", "", "", nil) message.Add("user_id", ruser.Id) a.Publish(message) @@ -335,7 +335,7 @@ func (a *App) createUser(user *model.User) (*model.User, *model.AppError) { return ruser, nil } -func (a *App) CreateOAuthUser(service string, userData io.Reader, teamId string, tokenUser *model.User) (*model.User, *model.AppError) { +func (a *App) CreateOAuthUser(service string, userData io.Reader, teamID string, tokenUser *model.User) (*model.User, *model.AppError) { if !*a.Config().TeamSettings.EnableUserCreation { return nil, model.NewAppError("CreateOAuthUser", "api.user.create_user.disabled.app_error", nil, "", http.StatusNotImplemented) } @@ -393,13 +393,13 @@ func (a *App) CreateOAuthUser(service string, userData io.Reader, teamId string, return nil, err } - if teamId != "" { - err = a.AddUserToTeamByTeamId(teamId, user) + if teamID != "" { + err = a.AddUserToTeamByTeamId(teamID, user) if err != nil { return nil, err } - err = a.AddDirectChannels(teamId, user) + err = a.AddDirectChannels(teamID, user) if err != nil { mlog.Warn("Failed to add direct channels", mlog.Err(err)) } @@ -443,8 +443,8 @@ func (a *App) IsUsernameTaken(name string) bool { return true } -func (a *App) GetUser(userId string) (*model.User, *model.AppError) { - user, err := a.Srv().Store.User().Get(userId) +func (a *App) GetUser(userID string) (*model.User, *model.AppError) { + user, err := a.Srv().Store.User().Get(userID) if err != nil { var nfErr *store.ErrNotFound switch { @@ -535,8 +535,8 @@ func (a *App) GetUsersInTeam(options *model.UserGetOptions) ([]*model.User, *mod return users, nil } -func (a *App) GetUsersNotInTeam(teamId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { - users, err := a.Srv().Store.User().GetProfilesNotInTeam(teamId, groupConstrained, offset, limit, viewRestrictions) +func (a *App) GetUsersNotInTeam(teamID string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { + users, err := a.Srv().Store.User().GetProfilesNotInTeam(teamID, groupConstrained, offset, limit, viewRestrictions) if err != nil { return nil, model.NewAppError("GetUsersNotInTeam", "app.user.get_profiles.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -553,8 +553,8 @@ func (a *App) GetUsersInTeamPage(options *model.UserGetOptions, asAdmin bool) ([ return a.sanitizeProfiles(users, asAdmin), nil } -func (a *App) GetUsersNotInTeamPage(teamId string, groupConstrained bool, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { - users, err := a.GetUsersNotInTeam(teamId, groupConstrained, page*perPage, perPage, viewRestrictions) +func (a *App) GetUsersNotInTeamPage(teamID string, groupConstrained bool, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { + users, err := a.GetUsersNotInTeam(teamID, groupConstrained, page*perPage, perPage, viewRestrictions) if err != nil { return nil, err } @@ -562,12 +562,12 @@ func (a *App) GetUsersNotInTeamPage(teamId string, groupConstrained bool, page i return a.sanitizeProfiles(users, asAdmin), nil } -func (a *App) GetUsersInTeamEtag(teamId string, restrictionsHash string) string { - return fmt.Sprintf("%v.%v.%v.%v", a.Srv().Store.User().GetEtagForProfiles(teamId), a.Config().PrivacySettings.ShowFullName, a.Config().PrivacySettings.ShowEmailAddress, restrictionsHash) +func (a *App) GetUsersInTeamEtag(teamID string, restrictionsHash string) string { + return fmt.Sprintf("%v.%v.%v.%v", a.Srv().Store.User().GetEtagForProfiles(teamID), a.Config().PrivacySettings.ShowFullName, a.Config().PrivacySettings.ShowEmailAddress, restrictionsHash) } -func (a *App) GetUsersNotInTeamEtag(teamId string, restrictionsHash string) string { - return fmt.Sprintf("%v.%v.%v.%v", a.Srv().Store.User().GetEtagForProfilesNotInTeam(teamId), a.Config().PrivacySettings.ShowFullName, a.Config().PrivacySettings.ShowEmailAddress, restrictionsHash) +func (a *App) GetUsersNotInTeamEtag(teamID string, restrictionsHash string) string { + return fmt.Sprintf("%v.%v.%v.%v", a.Srv().Store.User().GetEtagForProfilesNotInTeam(teamID), a.Config().PrivacySettings.ShowFullName, a.Config().PrivacySettings.ShowEmailAddress, restrictionsHash) } func (a *App) GetUsersInChannel(options *model.UserGetOptions) ([]*model.User, *model.AppError) { @@ -620,8 +620,8 @@ func (a *App) GetUsersInChannelPageByStatus(options *model.UserGetOptions, asAdm return a.sanitizeProfiles(users, asAdmin), nil } -func (a *App) GetUsersNotInChannel(teamId string, channelId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { - users, err := a.Srv().Store.User().GetProfilesNotInChannel(teamId, channelId, groupConstrained, offset, limit, viewRestrictions) +func (a *App) GetUsersNotInChannel(teamID string, channelId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { + users, err := a.Srv().Store.User().GetProfilesNotInChannel(teamID, channelId, groupConstrained, offset, limit, viewRestrictions) if err != nil { return nil, model.NewAppError("GetUsersNotInChannel", "app.user.get_profiles.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -629,8 +629,8 @@ func (a *App) GetUsersNotInChannel(teamId string, channelId string, groupConstra return users, nil } -func (a *App) GetUsersNotInChannelMap(teamId string, channelId string, groupConstrained bool, offset int, limit int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) (map[string]*model.User, *model.AppError) { - users, err := a.GetUsersNotInChannel(teamId, channelId, groupConstrained, offset, limit, viewRestrictions) +func (a *App) GetUsersNotInChannelMap(teamID string, channelId string, groupConstrained bool, offset int, limit int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) (map[string]*model.User, *model.AppError) { + users, err := a.GetUsersNotInChannel(teamID, channelId, groupConstrained, offset, limit, viewRestrictions) if err != nil { return nil, err } @@ -645,8 +645,8 @@ func (a *App) GetUsersNotInChannelMap(teamId string, channelId string, groupCons return userMap, nil } -func (a *App) GetUsersNotInChannelPage(teamId string, channelId string, groupConstrained bool, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { - users, err := a.GetUsersNotInChannel(teamId, channelId, groupConstrained, page*perPage, perPage, viewRestrictions) +func (a *App) GetUsersNotInChannelPage(teamID string, channelId string, groupConstrained bool, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { + users, err := a.GetUsersNotInChannel(teamID, channelId, groupConstrained, page*perPage, perPage, viewRestrictions) if err != nil { return nil, err } @@ -692,10 +692,10 @@ func (a *App) GetChannelGroupUsers(channelID string) ([]*model.User, *model.AppE return users, nil } -func (a *App) GetUsersByIds(userIds []string, options *store.UserGetByIdsOpts) ([]*model.User, *model.AppError) { +func (a *App) GetUsersByIds(userIDs []string, options *store.UserGetByIdsOpts) ([]*model.User, *model.AppError) { allowFromCache := options.ViewRestrictions == nil - users, err := a.Srv().Store.User().GetProfileByIds(userIds, options, allowFromCache) + users, err := a.Srv().Store.User().GetProfileByIds(userIDs, options, allowFromCache) if err != nil { return nil, model.NewAppError("GetUsersByIds", "app.user.get_profiles.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -731,8 +731,8 @@ func (a *App) sanitizeProfiles(users []*model.User, asAdmin bool) []*model.User return users } -func (a *App) GenerateMfaSecret(userId string) (*model.MfaSecret, *model.AppError) { - user, err := a.GetUser(userId) +func (a *App) GenerateMfaSecret(userID string) (*model.MfaSecret, *model.AppError) { + user, err := a.GetUser(userID) if err != nil { return nil, err } @@ -750,8 +750,8 @@ func (a *App) GenerateMfaSecret(userId string) (*model.MfaSecret, *model.AppErro return mfaSecret, nil } -func (a *App) ActivateMfa(userId, token string) *model.AppError { - user, err := a.Srv().Store.User().Get(userId) +func (a *App) ActivateMfa(userID, token string) *model.AppError { + user, err := a.Srv().Store.User().Get(userID) if err != nil { var nfErr *store.ErrNotFound switch { @@ -772,24 +772,24 @@ func (a *App) ActivateMfa(userId, token string) *model.AppError { } // Make sure old MFA status is not cached locally or in cluster nodes. - a.InvalidateCacheForUser(userId) + a.InvalidateCacheForUser(userID) return nil } -func (a *App) DeactivateMfa(userId string) *model.AppError { +func (a *App) DeactivateMfa(userID string) *model.AppError { mfaService := mfa.New(a, a.Srv().Store) - if err := mfaService.Deactivate(userId); err != nil { + if err := mfaService.Deactivate(userID); err != nil { return err } // Make sure old MFA status is not cached locally or in cluster nodes. - a.InvalidateCacheForUser(userId) + a.InvalidateCacheForUser(userID) return nil } -func CreateProfileImage(username string, userId string, initialFont string) ([]byte, *model.AppError) { +func CreateProfileImage(username string, userID string, initialFont string) ([]byte, *model.AppError) { colors := []color.NRGBA{ {197, 8, 126, 255}, {227, 207, 18, 255}, @@ -820,7 +820,7 @@ func CreateProfileImage(username string, userId string, initialFont string) ([]b } h := fnv.New32a() - h.Write([]byte(userId)) + h.Write([]byte(userID)) seed := h.Sum32() initial := string(strings.ToUpper(username)[0]) @@ -951,16 +951,16 @@ func (a *App) SetDefaultProfileImage(user *model.User) *model.AppError { return nil } -func (a *App) SetProfileImage(userId string, imageData *multipart.FileHeader) *model.AppError { +func (a *App) SetProfileImage(userID string, imageData *multipart.FileHeader) *model.AppError { file, err := imageData.Open() if err != nil { return model.NewAppError("SetProfileImage", "api.user.upload_profile_user.open.app_error", nil, err.Error(), http.StatusBadRequest) } defer file.Close() - return a.SetProfileImageFromMultiPartFile(userId, file) + return a.SetProfileImageFromMultiPartFile(userID, file) } -func (a *App) SetProfileImageFromMultiPartFile(userId string, file multipart.File) *model.AppError { +func (a *App) SetProfileImageFromMultiPartFile(userID string, file multipart.File) *model.AppError { // Decode image config first to check dimensions before loading the whole thing into memory later on config, _, err := image.DecodeConfig(file) if err != nil { @@ -975,7 +975,7 @@ func (a *App) SetProfileImageFromMultiPartFile(userId string, file multipart.Fil file.Seek(0, 0) - return a.SetProfileImageFromFile(userId, file) + return a.SetProfileImageFromFile(userID, file) } func (a *App) AdjustImage(file io.Reader) (*bytes.Buffer, *model.AppError) { @@ -1000,28 +1000,28 @@ func (a *App) AdjustImage(file io.Reader) (*bytes.Buffer, *model.AppError) { return buf, nil } -func (a *App) SetProfileImageFromFile(userId string, file io.Reader) *model.AppError { +func (a *App) SetProfileImageFromFile(userID string, file io.Reader) *model.AppError { buf, err := a.AdjustImage(file) if err != nil { return err } - path := "users/" + userId + "/profile.png" + path := "users/" + userID + "/profile.png" if _, err := a.WriteFile(buf, path); err != nil { return model.NewAppError("SetProfileImage", "api.user.upload_profile_user.upload_profile.app_error", nil, "", http.StatusInternalServerError) } - if err := a.Srv().Store.User().UpdateLastPictureUpdate(userId); err != nil { + if err := a.Srv().Store.User().UpdateLastPictureUpdate(userID); err != nil { mlog.Warn("Error with updating last picture update", mlog.Err(err)) } - a.invalidateUserCacheAndPublish(userId) + a.invalidateUserCacheAndPublish(userID) return nil } -func (a *App) UpdatePasswordAsUser(userId, currentPassword, newPassword string) *model.AppError { - user, err := a.GetUser(userId) +func (a *App) UpdatePasswordAsUser(userID, currentPassword, newPassword string) *model.AppError { + user, err := a.GetUser(userID) if err != nil { return err } @@ -1048,14 +1048,14 @@ func (a *App) UpdatePasswordAsUser(userId, currentPassword, newPassword string) return a.UpdatePasswordSendEmail(user, newPassword, T("api.user.update_password.menu")) } -func (a *App) userDeactivated(userId string) *model.AppError { - if err := a.RevokeAllSessions(userId); err != nil { +func (a *App) userDeactivated(userID string) *model.AppError { + if err := a.RevokeAllSessions(userID); err != nil { return err } - a.SetStatusOffline(userId, false) + a.SetStatusOffline(userID, false) - user, err := a.GetUser(userId) + user, err := a.GetUser(userID) if err != nil { return err } @@ -1064,24 +1064,24 @@ func (a *App) userDeactivated(userId string) *model.AppError { // bots the user owns. Only notify once, when the user is the owner, not the // owners bots if !user.IsBot { - a.notifySysadminsBotOwnerDeactivated(userId) + a.notifySysadminsBotOwnerDeactivated(userID) } if *a.Config().ServiceSettings.DisableBotsWhenOwnerIsDeactivated { - a.disableUserBots(userId) + a.disableUserBots(userID) } return nil } -func (a *App) invalidateUserChannelMembersCaches(userId string) *model.AppError { - teamsForUser, err := a.GetTeamsForUser(userId) +func (a *App) invalidateUserChannelMembersCaches(userID string) *model.AppError { + teamsForUser, err := a.GetTeamsForUser(userID) if err != nil { return err } for _, team := range teamsForUser { - channelsForUser, err := a.GetChannelsForUser(team.Id, userId, false, 0) + channelsForUser, err := a.GetChannelsForUser(team.Id, userID, false, 0) if err != nil { return err } @@ -1132,13 +1132,13 @@ func (a *App) UpdateActive(user *model.User, active bool) (*model.User, *model.A } func (a *App) DeactivateGuests() *model.AppError { - userIds, err := a.Srv().Store.User().DeactivateGuests() + userIDs, err := a.Srv().Store.User().DeactivateGuests() if err != nil { return model.NewAppError("DeactivateGuests", "app.user.update_active_for_multiple_users.updating.app_error", nil, err.Error(), http.StatusInternalServerError) } - for _, userId := range userIds { - if err := a.userDeactivated(userId); err != nil { + for _, userID := range userIDs { + if err := a.userDeactivated(userID); err != nil { return err } } @@ -1177,8 +1177,8 @@ func (a *App) UpdateUserAsUser(user *model.User, asAdmin bool) (*model.User, *mo return updatedUser, nil } -func (a *App) PatchUser(userId string, patch *model.UserPatch, asAdmin bool) (*model.User, *model.AppError) { - user, err := a.GetUser(userId) +func (a *App) PatchUser(userID string, patch *model.UserPatch, asAdmin bool) (*model.User, *model.AppError) { + user, err := a.GetUser(userID) if err != nil { return nil, err } @@ -1193,9 +1193,9 @@ func (a *App) PatchUser(userId string, patch *model.UserPatch, asAdmin bool) (*m return updatedUser, nil } -func (a *App) UpdateUserAuth(userId string, userAuth *model.UserAuth) (*model.UserAuth, *model.AppError) { +func (a *App) UpdateUserAuth(userID string, userAuth *model.UserAuth) (*model.UserAuth, *model.AppError) { userAuth.Password = "" - if _, err := a.Srv().Store.User().UpdateAuthData(userId, userAuth.AuthService, userAuth.AuthData, "", false); err != nil { + if _, err := a.Srv().Store.User().UpdateAuthData(userID, userAuth.AuthService, userAuth.AuthData, "", false); err != nil { var invErr *store.ErrInvalidInput switch { case errors.As(err, &invErr): @@ -1315,8 +1315,8 @@ func (a *App) UpdateUser(user *model.User, sendNotifications bool) (*model.User, return userUpdate.New, nil } -func (a *App) UpdateUserActive(userId string, active bool) *model.AppError { - user, err := a.GetUser(userId) +func (a *App) UpdateUserActive(userID string, active bool) *model.AppError { + user, err := a.GetUser(userID) if err != nil { return err @@ -1328,8 +1328,8 @@ func (a *App) UpdateUserActive(userId string, active bool) *model.AppError { return nil } -func (a *App) UpdateUserNotifyProps(userId string, props map[string]string, sendNotifications bool) (*model.User, *model.AppError) { - user, err := a.GetUser(userId) +func (a *App) UpdateUserNotifyProps(userID string, props map[string]string, sendNotifications bool) (*model.User, *model.AppError) { + user, err := a.GetUser(userID) if err != nil { return nil, err } @@ -1344,19 +1344,19 @@ func (a *App) UpdateUserNotifyProps(userId string, props map[string]string, send return ruser, nil } -func (a *App) UpdateMfa(activate bool, userId, token string) *model.AppError { +func (a *App) UpdateMfa(activate bool, userID, token string) *model.AppError { if activate { - if err := a.ActivateMfa(userId, token); err != nil { + if err := a.ActivateMfa(userID, token); err != nil { return err } } else { - if err := a.DeactivateMfa(userId); err != nil { + if err := a.DeactivateMfa(userID); err != nil { return err } } a.Srv().Go(func() { - user, err := a.GetUser(userId) + user, err := a.GetUser(userID) if err != nil { mlog.Error("Failed to get user", mlog.Err(err)) return @@ -1370,8 +1370,8 @@ func (a *App) UpdateMfa(activate bool, userId, token string) *model.AppError { return nil } -func (a *App) UpdatePasswordByUserIdSendEmail(userId, newPassword, method string) *model.AppError { - user, err := a.GetUser(userId) +func (a *App) UpdatePasswordByUserIdSendEmail(userID, newPassword, method string) *model.AppError { + user, err := a.GetUser(userID) if err != nil { return err } @@ -1409,8 +1409,8 @@ func (a *App) UpdatePasswordSendEmail(user *model.User, newPassword, method stri return nil } -func (a *App) UpdateHashedPasswordByUserId(userId, newHashedPassword string) *model.AppError { - user, err := a.GetUser(userId) +func (a *App) UpdateHashedPasswordByUserId(userID, newHashedPassword string) *model.AppError { + user, err := a.GetUser(userID) if err != nil { return err } @@ -1491,13 +1491,13 @@ func (a *App) SendPasswordReset(email string, siteURL string) (bool, *model.AppE return a.Srv().EmailService.SendPasswordResetEmail(user.Email, token, user.Locale, siteURL) } -func (a *App) CreatePasswordRecoveryToken(userId, email string) (*model.Token, *model.AppError) { +func (a *App) CreatePasswordRecoveryToken(userID, email string) (*model.Token, *model.AppError) { tokenExtra := struct { UserId string Email string }{ - userId, + userID, email, } jsonData, err := json.Marshal(tokenExtra) @@ -1540,8 +1540,8 @@ func (a *App) DeleteToken(token *model.Token) *model.AppError { return nil } -func (a *App) UpdateUserRoles(userId string, newRoles string, sendWebSocketEvent bool) (*model.User, *model.AppError) { - user, err := a.GetUser(userId) +func (a *App) UpdateUserRoles(userID string, newRoles string, sendWebSocketEvent bool) (*model.User, *model.AppError) { + user, err := a.GetUser(userID) if err != nil { err.StatusCode = http.StatusBadRequest return nil, err @@ -1586,7 +1586,7 @@ func (a *App) UpdateUserRoles(userId string, newRoles string, sendWebSocketEvent mlog.Warn("Failed during updating user roles", mlog.Err(result.NErr)) } - a.InvalidateCacheForUser(userId) + a.InvalidateCacheForUser(userID) a.ClearSessionCacheForUser(user.Id) if sendWebSocketEvent { @@ -1818,14 +1818,14 @@ func (a *App) GetFilteredUsersStats(options *model.UserCountOptions) (*model.Use return stats, nil } -func (a *App) VerifyUserEmail(userId, email string) *model.AppError { - if _, err := a.Srv().Store.User().VerifyEmail(userId, email); err != nil { +func (a *App) VerifyUserEmail(userID, email string) *model.AppError { + if _, err := a.Srv().Store.User().VerifyEmail(userID, email); err != nil { return model.NewAppError("VerifyUserEmail", "app.user.verify_email.app_error", nil, err.Error(), http.StatusInternalServerError) } - a.InvalidateCacheForUser(userId) + a.InvalidateCacheForUser(userID) - user, err := a.GetUser(userId) + user, err := a.GetUser(userID) if err != nil { return err @@ -1868,9 +1868,9 @@ func (a *App) SearchUsersInChannel(channelId string, term string, options *model return users, nil } -func (a *App) SearchUsersNotInChannel(teamId string, channelId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { +func (a *App) SearchUsersNotInChannel(teamID string, channelId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { term = strings.TrimSpace(term) - users, err := a.Srv().Store.User().SearchNotInChannel(teamId, channelId, term, options) + users, err := a.Srv().Store.User().SearchNotInChannel(teamID, channelId, term, options) if err != nil { return nil, model.NewAppError("SearchUsersNotInChannel", "app.user.search.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -1882,10 +1882,10 @@ func (a *App) SearchUsersNotInChannel(teamId string, channelId string, term stri return users, nil } -func (a *App) SearchUsersInTeam(teamId, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { +func (a *App) SearchUsersInTeam(teamID, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { term = strings.TrimSpace(term) - users, err := a.Srv().Store.User().Search(teamId, term, options) + users, err := a.Srv().Store.User().Search(teamID, term, options) if err != nil { return nil, model.NewAppError("SearchUsersInTeam", "app.user.search.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -1939,10 +1939,10 @@ func (a *App) SearchUsersInGroup(groupID string, term string, options *model.Use return users, nil } -func (a *App) AutocompleteUsersInChannel(teamId string, channelId string, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInChannel, *model.AppError) { +func (a *App) AutocompleteUsersInChannel(teamID string, channelId string, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInChannel, *model.AppError) { term = strings.TrimSpace(term) - autocomplete, err := a.Srv().Store.User().AutocompleteUsersInChannel(teamId, channelId, term, options) + autocomplete, err := a.Srv().Store.User().AutocompleteUsersInChannel(teamID, channelId, term, options) if err != nil { return nil, model.NewAppError("AutocompleteUsersInChannel", "app.user.search.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -1958,10 +1958,10 @@ func (a *App) AutocompleteUsersInChannel(teamId string, channelId string, term s return autocomplete, nil } -func (a *App) AutocompleteUsersInTeam(teamId string, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInTeam, *model.AppError) { +func (a *App) AutocompleteUsersInTeam(teamID string, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInTeam, *model.AppError) { term = strings.TrimSpace(term) - users, err := a.Srv().Store.User().Search(teamId, term, options) + users, err := a.Srv().Store.User().Search(teamID, term, options) if err != nil { return nil, model.NewAppError("AutocompleteUsersInTeam", "app.user.search.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -2031,8 +2031,8 @@ func (a *App) UpdateOAuthUserAttrs(userData io.Reader, user *model.User, provide return nil } -func (a *App) RestrictUsersGetByPermissions(userId string, options *model.UserGetOptions) (*model.UserGetOptions, *model.AppError) { - restrictions, err := a.GetViewUsersRestrictions(userId) +func (a *App) RestrictUsersGetByPermissions(userID string, options *model.UserGetOptions) (*model.UserGetOptions, *model.AppError) { + restrictions, err := a.GetViewUsersRestrictions(userID) if err != nil { return nil, err } @@ -2043,29 +2043,29 @@ func (a *App) RestrictUsersGetByPermissions(userId string, options *model.UserGe // FilterNonGroupTeamMembers returns the subset of the given user IDs of the users who are not members of groups // associated to the team excluding bots. -func (a *App) FilterNonGroupTeamMembers(userIds []string, team *model.Team) ([]string, error) { +func (a *App) FilterNonGroupTeamMembers(userIDs []string, team *model.Team) ([]string, error) { teamGroupUsers, err := a.GetTeamGroupUsers(team.Id) if err != nil { return nil, err } - return a.filterNonGroupUsers(userIds, teamGroupUsers) + return a.filterNonGroupUsers(userIDs, teamGroupUsers) } // FilterNonGroupChannelMembers returns the subset of the given user IDs of the users who are not members of groups // associated to the channel excluding bots -func (a *App) FilterNonGroupChannelMembers(userIds []string, channel *model.Channel) ([]string, error) { +func (a *App) FilterNonGroupChannelMembers(userIDs []string, channel *model.Channel) ([]string, error) { channelGroupUsers, err := a.GetChannelGroupUsers(channel.Id) if err != nil { return nil, err } - return a.filterNonGroupUsers(userIds, channelGroupUsers) + return a.filterNonGroupUsers(userIDs, channelGroupUsers) } // filterNonGroupUsers is a helper function that takes a list of user ids and a list of users -// and returns the list of normal users present in userIds but not in groupUsers. -func (a *App) filterNonGroupUsers(userIds []string, groupUsers []*model.User) ([]string, error) { +// and returns the list of normal users present in userIDs but not in groupUsers. +func (a *App) filterNonGroupUsers(userIDs []string, groupUsers []*model.User) ([]string, error) { nonMemberIds := []string{} - users, err := a.Srv().Store.User().GetProfileByIds(userIds, nil, false) + users, err := a.Srv().Store.User().GetProfileByIds(userIDs, nil, false) if err != nil { return nil, err } @@ -2087,8 +2087,8 @@ func (a *App) filterNonGroupUsers(userIds []string, groupUsers []*model.User) ([ return nonMemberIds, nil } -func (a *App) RestrictUsersSearchByPermissions(userId string, options *model.UserSearchOptions) (*model.UserSearchOptions, *model.AppError) { - restrictions, err := a.GetViewUsersRestrictions(userId) +func (a *App) RestrictUsersSearchByPermissions(userID string, options *model.UserSearchOptions) (*model.UserSearchOptions, *model.AppError) { + restrictions, err := a.GetViewUsersRestrictions(userID) if err != nil { return nil, err } @@ -2097,12 +2097,12 @@ func (a *App) RestrictUsersSearchByPermissions(userId string, options *model.Use return options, nil } -func (a *App) UserCanSeeOtherUser(userId string, otherUserId string) (bool, *model.AppError) { - if userId == otherUserId { +func (a *App) UserCanSeeOtherUser(userID string, otherUserId string) (bool, *model.AppError) { + if userID == otherUserId { return true, nil } - restrictions, err := a.GetViewUsersRestrictions(userId) + restrictions, err := a.GetViewUsersRestrictions(userID) if err != nil { return false, err } @@ -2134,8 +2134,8 @@ func (a *App) UserCanSeeOtherUser(userId string, otherUserId string) (bool, *mod return false, nil } -func (a *App) userBelongsToChannels(userId string, channelIds []string) (bool, *model.AppError) { - belongs, err := a.Srv().Store.Channel().UserBelongsToChannels(userId, channelIds) +func (a *App) userBelongsToChannels(userID string, channelIds []string) (bool, *model.AppError) { + belongs, err := a.Srv().Store.Channel().UserBelongsToChannels(userID, channelIds) if err != nil { return false, model.NewAppError("userBelongsToChannels", "app.channel.user_belongs_to_channels.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -2143,24 +2143,24 @@ func (a *App) userBelongsToChannels(userId string, channelIds []string) (bool, * return belongs, nil } -func (a *App) GetViewUsersRestrictions(userId string) (*model.ViewUsersRestrictions, *model.AppError) { - if a.HasPermissionTo(userId, model.PERMISSION_VIEW_MEMBERS) { +func (a *App) GetViewUsersRestrictions(userID string) (*model.ViewUsersRestrictions, *model.AppError) { + if a.HasPermissionTo(userID, model.PERMISSION_VIEW_MEMBERS) { return nil, nil } - teamIds, nErr := a.Srv().Store.Team().GetUserTeamIds(userId, true) + teamIDs, nErr := a.Srv().Store.Team().GetUserTeamIds(userID, true) if nErr != nil { return nil, model.NewAppError("GetViewUsersRestrictions", "app.team.get_user_team_ids.app_error", nil, nErr.Error(), http.StatusInternalServerError) } - teamIdsWithPermission := []string{} - for _, teamId := range teamIds { - if a.HasPermissionToTeam(userId, teamId, model.PERMISSION_VIEW_MEMBERS) { - teamIdsWithPermission = append(teamIdsWithPermission, teamId) + teamIDsWithPermission := []string{} + for _, teamID := range teamIDs { + if a.HasPermissionToTeam(userID, teamID, model.PERMISSION_VIEW_MEMBERS) { + teamIDsWithPermission = append(teamIDsWithPermission, teamID) } } - userChannelMembers, err := a.Srv().Store.Channel().GetAllChannelMembersForUser(userId, true, true) + userChannelMembers, err := a.Srv().Store.Channel().GetAllChannelMembersForUser(userID, true, true) if err != nil { return nil, model.NewAppError("GetViewUsersRestrictions", "app.channel.get_channels.get.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -2170,7 +2170,7 @@ func (a *App) GetViewUsersRestrictions(userId string) (*model.ViewUsersRestricti channelIds = append(channelIds, channelId) } - 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 @@ -2271,25 +2271,25 @@ func (a *App) DemoteUserToGuest(user *model.User) *model.AppError { return nil } -func (a *App) PublishUserTyping(userId, channelId, parentId string) *model.AppError { +func (a *App) PublishUserTyping(userID, channelId, parentId string) *model.AppError { omitUsers := make(map[string]bool, 1) - omitUsers[userId] = true + omitUsers[userID] = true event := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_TYPING, "", channelId, "", omitUsers) event.Add("parent_id", parentId) - event.Add("user_id", userId) + event.Add("user_id", userID) a.Publish(event) return nil } // invalidateUserCacheAndPublish Invalidates cache for a user and publishes user updated event -func (a *App) invalidateUserCacheAndPublish(userId string) { - a.InvalidateCacheForUser(userId) +func (a *App) invalidateUserCacheAndPublish(userID string) { + a.InvalidateCacheForUser(userID) - user, userErr := a.GetUser(userId) + user, userErr := a.GetUser(userID) if userErr != nil { - mlog.Error("Error in getting users profile", mlog.String("user_id", userId), mlog.Err(userErr)) + mlog.Error("Error in getting users profile", mlog.String("user_id", userID), mlog.Err(userErr)) return } @@ -2356,8 +2356,8 @@ func (a *App) ConvertBotToUser(bot *model.Bot, userPatch *model.UserPatch, sysad return user, nil } -func (a *App) GetThreadsForUser(userId, teamId string, options model.GetUserThreadsOpts) (*model.Threads, *model.AppError) { - threads, err := a.Srv().Store.Thread().GetThreadsForUser(userId, teamId, options) +func (a *App) GetThreadsForUser(userID, teamID string, options model.GetUserThreadsOpts) (*model.Threads, *model.AppError) { + threads, err := a.Srv().Store.Thread().GetThreadsForUser(userID, teamID, options) if err != nil { return nil, model.NewAppError("GetThreadsForUser", "app.user.get_threads_for_user.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -2368,8 +2368,8 @@ func (a *App) GetThreadsForUser(userId, teamId string, options model.GetUserThre return threads, nil } -func (a *App) GetThreadForUser(userId, teamId, threadId string, extended bool) (*model.ThreadResponse, *model.AppError) { - thread, err := a.Srv().Store.Thread().GetThreadForUser(userId, teamId, threadId, extended) +func (a *App) GetThreadForUser(userID, teamID, threadId string, extended bool) (*model.ThreadResponse, *model.AppError) { + thread, err := a.Srv().Store.Thread().GetThreadForUser(userID, teamID, threadId, extended) if err != nil { return nil, model.NewAppError("GetThreadForUser", "app.user.get_threads_for_user.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -2381,34 +2381,34 @@ func (a *App) GetThreadForUser(userId, teamId, threadId string, extended bool) ( return thread, nil } -func (a *App) UpdateThreadsReadForUser(userId, teamId string) *model.AppError { - nErr := a.Srv().Store.Thread().MarkAllAsRead(userId, teamId) +func (a *App) UpdateThreadsReadForUser(userID, teamID string) *model.AppError { + nErr := a.Srv().Store.Thread().MarkAllAsRead(userID, teamID) if nErr != nil { return model.NewAppError("UpdateThreadsReadForUser", "app.user.update_threads_read_for_user.app_error", nil, nErr.Error(), http.StatusInternalServerError) } - message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_THREAD_READ_CHANGED, "", "", userId, nil) + message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_THREAD_READ_CHANGED, "", "", userID, nil) a.Publish(message) return nil } -func (a *App) UpdateThreadFollowForUser(userId, threadId string, state bool) *model.AppError { - err := a.Srv().Store.Thread().CreateMembershipIfNeeded(userId, threadId, state, false, true) +func (a *App) UpdateThreadFollowForUser(userID, threadId string, state bool) *model.AppError { + err := a.Srv().Store.Thread().CreateMembershipIfNeeded(userID, threadId, state, false, true) if err != nil { return model.NewAppError("UpdateThreadFollowForUser", "app.user.update_thread_follow_for_user.app_error", nil, err.Error(), http.StatusInternalServerError) } - message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_THREAD_FOLLOW_CHANGED, "", "", userId, nil) + message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_THREAD_FOLLOW_CHANGED, "", "", userID, nil) message.Add("thread_id", threadId) message.Add("state", state) a.Publish(message) return nil } -func (a *App) UpdateThreadReadForUser(userId, teamId, threadId string, timestamp int64) *model.AppError { - user, err := a.GetUser(userId) +func (a *App) UpdateThreadReadForUser(userID, teamID, threadId string, timestamp int64) *model.AppError { + user, err := a.GetUser(userID) if err != nil { return err } - membership, nErr := a.Srv().Store.Thread().GetMembershipForUser(userId, threadId) + membership, nErr := a.Srv().Store.Thread().GetMembershipForUser(userID, threadId) if nErr != nil { return model.NewAppError("UpdateThreadsReadForUser", "app.user.update_threads_read_for_user.app_error", nil, nErr.Error(), http.StatusInternalServerError) } @@ -2417,7 +2417,7 @@ func (a *App) UpdateThreadReadForUser(userId, teamId, threadId string, timestamp return err } - membership.UnreadMentions, err = a.countThreadMentions(user, post, teamId, timestamp) + membership.UnreadMentions, err = a.countThreadMentions(user, post, teamID, timestamp) if err != nil { return err } @@ -2427,11 +2427,11 @@ func (a *App) UpdateThreadReadForUser(userId, teamId, threadId string, timestamp return model.NewAppError("UpdateThreadsReadForUser", "app.user.update_threads_read_for_user.app_error", nil, nErr.Error(), http.StatusInternalServerError) } - nErr = a.Srv().Store.Thread().MarkAsRead(userId, threadId, timestamp) + nErr = a.Srv().Store.Thread().MarkAsRead(userID, threadId, timestamp) if nErr != nil { return model.NewAppError("UpdateThreadReadForUser", "app.user.update_thread_read_for_user.app_error", nil, nErr.Error(), http.StatusInternalServerError) } - message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_THREAD_READ_CHANGED, "", "", userId, nil) + message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_THREAD_READ_CHANGED, "", "", userID, nil) message.Add("thread_id", threadId) message.Add("timestamp", timestamp) a.Publish(message) diff --git a/app/user_terms_of_service.go b/app/user_terms_of_service.go index 80c1bbe413..2a7af92053 100644 --- a/app/user_terms_of_service.go +++ b/app/user_terms_of_service.go @@ -11,8 +11,8 @@ import ( "github.com/mattermost/mattermost-server/v5/store" ) -func (a *App) GetUserTermsOfService(userId string) (*model.UserTermsOfService, *model.AppError) { - u, err := a.Srv().Store.UserTermsOfService().GetByUser(userId) +func (a *App) GetUserTermsOfService(userID string) (*model.UserTermsOfService, *model.AppError) { + u, err := a.Srv().Store.UserTermsOfService().GetByUser(userID) if err != nil { var nfErr *store.ErrNotFound switch { @@ -26,10 +26,10 @@ func (a *App) GetUserTermsOfService(userId string) (*model.UserTermsOfService, * return u, nil } -func (a *App) SaveUserTermsOfService(userId, termsOfServiceId string, accepted bool) *model.AppError { +func (a *App) SaveUserTermsOfService(userID, termsOfServiceId string, accepted bool) *model.AppError { if accepted { userTermsOfService := &model.UserTermsOfService{ - UserId: userId, + UserId: userID, TermsOfServiceId: termsOfServiceId, } @@ -43,7 +43,7 @@ func (a *App) SaveUserTermsOfService(userId, termsOfServiceId string, accepted b } } } else { - if err := a.Srv().Store.UserTermsOfService().Delete(userId, termsOfServiceId); err != nil { + if err := a.Srv().Store.UserTermsOfService().Delete(userID, termsOfServiceId); err != nil { return model.NewAppError("SaveUserTermsOfService", "app.user_terms_of_service.delete.app_error", nil, err.Error(), http.StatusInternalServerError) } } diff --git a/app/user_test.go b/app/user_test.go index 9ffdaf2678..dfcd5c3ac8 100644 --- a/app/user_test.go +++ b/app/user_test.go @@ -717,7 +717,7 @@ func TestCreateUserWithToken(t *testing.T) { t.Run("invalid token type", func(t *testing.T) { token := model.NewToken( TokenTypeVerifyEmail, - model.MapToJson(map[string]string{"teamId": th.BasicTeam.Id, "email": user.Email}), + model.MapToJson(map[string]string{"teamID": th.BasicTeam.Id, "email": user.Email}), ) require.Nil(t, th.App.Srv().Store.Token().Save(token)) defer th.App.DeleteToken(token) diff --git a/app/web_conn.go b/app/web_conn.go index 930847b876..b4799a45a4 100644 --- a/app/web_conn.go +++ b/app/web_conn.go @@ -311,7 +311,7 @@ func (wc *WebConn) createHelloMessage() *model.WebSocketEvent { } func (wc *WebConn) shouldSendEventToGuest(msg *model.WebSocketEvent) bool { - var userId string + var userID string var canSee bool switch msg.EventType() { @@ -321,14 +321,14 @@ func (wc *WebConn) shouldSendEventToGuest(msg *model.WebSocketEvent) bool { mlog.Debug("webhub.shouldSendEvent: user not found in message", mlog.Any("user", msg.GetData()["user"])) return false } - userId = user.Id + userID = user.Id case model.WEBSOCKET_EVENT_NEW_USER: - userId = msg.GetData()["user_id"].(string) + userID = msg.GetData()["user_id"].(string) default: return true } - canSee, err := wc.App.UserCanSeeOtherUser(wc.UserId, userId) + canSee, err := wc.App.UserCanSeeOtherUser(wc.UserId, userID) if err != nil { mlog.Error("webhub.shouldSendEvent.", mlog.Err(err)) return false @@ -414,8 +414,8 @@ func (wc *WebConn) shouldSendEvent(msg *model.WebSocketEvent) bool { } // IsMemberOfTeam returns whether the user of the WebConn -// is a member of the given teamId or not. -func (wc *WebConn) isMemberOfTeam(teamId string) bool { +// is a member of the given teamID or not. +func (wc *WebConn) isMemberOfTeam(teamID string) bool { currentSession := wc.GetSession() if currentSession == nil || currentSession.Token == "" { @@ -432,7 +432,7 @@ func (wc *WebConn) isMemberOfTeam(teamId string) bool { currentSession = session } - return currentSession.GetTeamByTeamId(teamId) != nil + return currentSession.GetTeamByTeamId(teamID) != nil } func (wc *WebConn) logSocketErr(source string, err error) { diff --git a/app/web_hub.go b/app/web_hub.go index c359bccc4c..0af20602ac 100644 --- a/app/web_hub.go +++ b/app/web_hub.go @@ -19,7 +19,7 @@ const ( ) type webConnActivityMessage struct { - userId string + userID string sessionToken string activityAt int64 } @@ -30,7 +30,7 @@ type webConnDirectMessage struct { } type webConnSessionMessage struct { - userId string + userID string sessionToken string isRegistered chan bool } @@ -94,19 +94,19 @@ func (a *App) HubStart() { a.srv.hubs = hubs } -func (a *App) invalidateCacheForUserSkipClusterSend(userId string) { - a.Srv().Store.Channel().InvalidateAllChannelMembersForUser(userId) - a.InvalidateWebConnSessionCacheForUser(userId) +func (a *App) invalidateCacheForUserSkipClusterSend(userID string) { + a.Srv().Store.Channel().InvalidateAllChannelMembersForUser(userID) + a.InvalidateWebConnSessionCacheForUser(userID) } -func (a *App) invalidateCacheForWebhook(webhookId string) { - a.Srv().Store.Webhook().InvalidateWebhookCache(webhookId) +func (a *App) invalidateCacheForWebhook(webhookID string) { + a.Srv().Store.Webhook().InvalidateWebhookCache(webhookID) } -func (a *App) InvalidateWebConnSessionCacheForUser(userId string) { - hub := a.GetHubForUserId(userId) +func (a *App) InvalidateWebConnSessionCacheForUser(userID string) { + hub := a.GetHubForUserId(userID) if hub != nil { - hub.InvalidateUser(userId) + hub.InvalidateUser(userID) } } @@ -124,20 +124,20 @@ func (a *App) HubStop() { } // GetHubForUserId returns the hub for a given user id. -func (s *Server) GetHubForUserId(userId string) *Hub { - // TODO: check if caching the userId -> hub mapping +func (s *Server) GetHubForUserId(userID string) *Hub { + // TODO: check if caching the userID -> hub mapping // is worth the memory tradeoff. // https://mattermost.atlassian.net/browse/MM-26629. var hash maphash.Hash hash.SetSeed(s.hashSeed) - hash.Write([]byte(userId)) + hash.Write([]byte(userID)) index := hash.Sum64() % uint64(len(s.hubs)) return s.hubs[int(index)] } -func (a *App) GetHubForUserId(userId string) *Hub { - return a.Srv().GetHubForUserId(userId) +func (a *App) GetHubForUserId(userID string) *Hub { + return a.Srv().GetHubForUserId(userID) } // HubRegister registers a connection to a hub. @@ -254,12 +254,12 @@ func (a *App) invalidateCacheForChannelMembersNotifyPropsSkipClusterSend(channel a.Srv().Store.Channel().InvalidateCacheForChannelMembersNotifyProps(channelId) } -func (a *App) invalidateCacheForChannelByNameSkipClusterSend(teamId, name string) { - if teamId == "" { - teamId = "dm" +func (a *App) invalidateCacheForChannelByNameSkipClusterSend(teamID, name string) { + if teamID == "" { + teamID = "dm" } - a.Srv().Store.Channel().InvalidateChannelByName(teamId, name) + a.Srv().Store.Channel().InvalidateChannelByName(teamID, name) } func (a *App) invalidateCacheForChannelPosts(channelId string) { @@ -267,31 +267,31 @@ func (a *App) invalidateCacheForChannelPosts(channelId string) { a.Srv().Store.Post().InvalidateLastPostTimeCache(channelId) } -func (a *App) InvalidateCacheForUser(userId string) { - a.invalidateCacheForUserSkipClusterSend(userId) +func (a *App) InvalidateCacheForUser(userID string) { + a.invalidateCacheForUserSkipClusterSend(userID) - a.Srv().Store.User().InvalidateProfilesInChannelCacheByUser(userId) - a.Srv().Store.User().InvalidateProfileCacheForUser(userId) + a.Srv().Store.User().InvalidateProfilesInChannelCacheByUser(userID) + a.Srv().Store.User().InvalidateProfileCacheForUser(userID) if a.Cluster() != nil { msg := &model.ClusterMessage{ Event: model.CLUSTER_EVENT_INVALIDATE_CACHE_FOR_USER, SendType: model.CLUSTER_SEND_BEST_EFFORT, - Data: userId, + Data: userID, } a.Cluster().SendClusterMessage(msg) } } -func (a *App) invalidateCacheForUserTeams(userId string) { - a.InvalidateWebConnSessionCacheForUser(userId) - a.Srv().Store.Team().InvalidateAllTeamIdsForUser(userId) +func (a *App) invalidateCacheForUserTeams(userID string) { + a.InvalidateWebConnSessionCacheForUser(userID) + a.Srv().Store.Team().InvalidateAllTeamIdsForUser(userID) if a.Cluster() != nil { msg := &model.ClusterMessage{ Event: model.CLUSTER_EVENT_INVALIDATE_CACHE_FOR_USER_TEAMS, SendType: model.CLUSTER_SEND_BEST_EFFORT, - Data: userId, + Data: userID, } a.Cluster().SendClusterMessage(msg) } @@ -331,9 +331,9 @@ func (h *Hub) Unregister(webConn *WebConn) { } // Determines if a user's session is registered a connection from the hub. -func (h *Hub) IsRegistered(userId, sessionToken string) bool { +func (h *Hub) IsRegistered(userID, sessionToken string) bool { ws := &webConnSessionMessage{ - userId: userId, + userID: userID, sessionToken: sessionToken, isRegistered: make(chan bool), } @@ -366,19 +366,19 @@ func (h *Hub) Broadcast(message *model.WebSocketEvent) { } // InvalidateUser invalidates the cache for the given user. -func (h *Hub) InvalidateUser(userId string) { +func (h *Hub) InvalidateUser(userID string) { select { - case h.invalidateUser <- userId: + case h.invalidateUser <- userID: case <-h.stop: } } // UpdateActivity sets the LastUserActivityAt field for the connection // of the user. -func (h *Hub) UpdateActivity(userId, sessionToken string, activityAt int64) { +func (h *Hub) UpdateActivity(userID, sessionToken string, activityAt int64) { select { case h.activity <- &webConnActivityMessage{ - userId: userId, + userID: userID, sessionToken: sessionToken, activityAt: activityAt, }: @@ -417,7 +417,7 @@ func (h *Hub) Start() { for { select { case webSessionMessage := <-h.checkRegistered: - conns := connIndex.ForUser(webSessionMessage.userId) + conns := connIndex.ForUser(webSessionMessage.userID) var isRegistered bool for _, conn := range conns { if conn.GetSessionToken() == webSessionMessage.sessionToken { @@ -458,12 +458,12 @@ func (h *Hub) Start() { h.app.SetStatusLastActivityAt(webConn.UserId, latestActivity) }) } - case userId := <-h.invalidateUser: - for _, webConn := range connIndex.ForUser(userId) { + case userID := <-h.invalidateUser: + for _, webConn := range connIndex.ForUser(userID) { webConn.InvalidateCache() } case activity := <-h.activity: - for _, webConn := range connIndex.ForUser(activity.userId) { + for _, webConn := range connIndex.ForUser(activity.userID) { if webConn.GetSessionToken() == activity.sessionToken { webConn.lastUserActivityAt = activity.activityAt } diff --git a/app/web_hub_test.go b/app/web_hub_test.go index c28e441e72..be1291e274 100644 --- a/app/web_hub_test.go +++ b/app/web_hub_test.go @@ -36,9 +36,9 @@ func dummyWebsocketHandler(t *testing.T) http.HandlerFunc { } } -func registerDummyWebConn(t *testing.T, a *App, addr net.Addr, userId string) *WebConn { +func registerDummyWebConn(t *testing.T, a *App, addr net.Addr, userID string) *WebConn { session, appErr := a.CreateSession(&model.Session{ - UserId: userId, + UserId: userID, }) require.Nil(t, appErr) @@ -173,7 +173,7 @@ func TestHubSessionRevokeRace(t *testing.T) { go func() { for i := 0; i <= broadcastQueueSize; i++ { - hub.Broadcast(model.NewWebSocketEvent("", "teamId", "", "", nil)) + hub.Broadcast(model.NewWebSocketEvent("", "teamID", "", "", nil)) } close(done) }() diff --git a/app/webhook.go b/app/webhook.go index a6973529c4..47b5ac9901 100644 --- a/app/webhook.go +++ b/app/webhook.go @@ -246,12 +246,12 @@ func SplitWebhookPost(post *model.Post, maxPostSize int) ([]*model.Post, *model. return splits, nil } -func (a *App) CreateWebhookPost(userId string, channel *model.Channel, text, overrideUsername, overrideIconUrl, overrideIconEmoji string, props model.StringInterface, postType string, postRootId string) (*model.Post, *model.AppError) { +func (a *App) CreateWebhookPost(userID string, channel *model.Channel, text, overrideUsername, overrideIconURL, overrideIconEmoji string, props model.StringInterface, postType string, postRootId string) (*model.Post, *model.AppError) { // parse links into Markdown format linkWithTextRegex := regexp.MustCompile(`<([^\n<\|>]+)\|([^\n>]+)>`) text = linkWithTextRegex.ReplaceAllString(text, "[${2}](${1})") - post := &model.Post{UserId: userId, ChannelId: channel.Id, Message: text, Type: postType, RootId: postRootId} + post := &model.Post{UserId: userID, ChannelId: channel.Id, Message: text, Type: postType, RootId: postRootId} post.AddProp("from_webhook", "true") if strings.HasPrefix(post.Type, model.POST_SYSTEM_MESSAGE_PREFIX) { @@ -272,8 +272,8 @@ func (a *App) CreateWebhookPost(userId string, channel *model.Channel, text, ove } if *a.Config().ServiceSettings.EnablePostIconOverride { - if overrideIconUrl != "" { - post.AddProp("override_icon_url", overrideIconUrl) + if overrideIconURL != "" { + post.AddProp("override_icon_url", overrideIconURL) } if overrideIconEmoji != "" { post.AddProp("override_icon_emoji", overrideIconEmoji) @@ -373,26 +373,26 @@ func (a *App) UpdateIncomingWebhook(oldHook, updatedHook *model.IncomingWebhook) return newWebhook, nil } -func (a *App) DeleteIncomingWebhook(hookId string) *model.AppError { +func (a *App) DeleteIncomingWebhook(hookID string) *model.AppError { if !*a.Config().ServiceSettings.EnableIncomingWebhooks { return model.NewAppError("DeleteIncomingWebhook", "api.incoming_webhook.disabled.app_error", nil, "", http.StatusNotImplemented) } - if err := a.Srv().Store.Webhook().DeleteIncoming(hookId, model.GetMillis()); err != nil { + if err := a.Srv().Store.Webhook().DeleteIncoming(hookID, model.GetMillis()); err != nil { return model.NewAppError("DeleteIncomingWebhook", "app.webhooks.delete_incoming.app_error", nil, err.Error(), http.StatusInternalServerError) } - a.invalidateCacheForWebhook(hookId) + a.invalidateCacheForWebhook(hookID) return nil } -func (a *App) GetIncomingWebhook(hookId string) (*model.IncomingWebhook, *model.AppError) { +func (a *App) GetIncomingWebhook(hookID string) (*model.IncomingWebhook, *model.AppError) { if !*a.Config().ServiceSettings.EnableIncomingWebhooks { return nil, model.NewAppError("GetIncomingWebhook", "api.incoming_webhook.disabled.app_error", nil, "", http.StatusNotImplemented) } - webhook, err := a.Srv().Store.Webhook().GetIncoming(hookId, true) + webhook, err := a.Srv().Store.Webhook().GetIncoming(hookID, true) if err != nil { var nfErr *store.ErrNotFound switch { @@ -406,16 +406,16 @@ func (a *App) GetIncomingWebhook(hookId string) (*model.IncomingWebhook, *model. return webhook, nil } -func (a *App) GetIncomingWebhooksForTeamPage(teamId string, page, perPage int) ([]*model.IncomingWebhook, *model.AppError) { - return a.GetIncomingWebhooksForTeamPageByUser(teamId, "", page, perPage) +func (a *App) GetIncomingWebhooksForTeamPage(teamID string, page, perPage int) ([]*model.IncomingWebhook, *model.AppError) { + return a.GetIncomingWebhooksForTeamPageByUser(teamID, "", page, perPage) } -func (a *App) GetIncomingWebhooksForTeamPageByUser(teamId string, userId string, page, perPage int) ([]*model.IncomingWebhook, *model.AppError) { +func (a *App) GetIncomingWebhooksForTeamPageByUser(teamID string, userID string, page, perPage int) ([]*model.IncomingWebhook, *model.AppError) { if !*a.Config().ServiceSettings.EnableIncomingWebhooks { return nil, model.NewAppError("GetIncomingWebhooksForTeamPage", "api.incoming_webhook.disabled.app_error", nil, "", http.StatusNotImplemented) } - webhooks, err := a.Srv().Store.Webhook().GetIncomingByTeamByUser(teamId, userId, page*perPage, perPage) + webhooks, err := a.Srv().Store.Webhook().GetIncomingByTeamByUser(teamID, userID, page*perPage, perPage) if err != nil { return nil, model.NewAppError("GetIncomingWebhooksForTeamPage", "app.webhooks.get_incoming_by_user.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -423,12 +423,12 @@ func (a *App) GetIncomingWebhooksForTeamPageByUser(teamId string, userId string, return webhooks, nil } -func (a *App) GetIncomingWebhooksPageByUser(userId string, page, perPage int) ([]*model.IncomingWebhook, *model.AppError) { +func (a *App) GetIncomingWebhooksPageByUser(userID string, page, perPage int) ([]*model.IncomingWebhook, *model.AppError) { if !*a.Config().ServiceSettings.EnableIncomingWebhooks { return nil, model.NewAppError("GetIncomingWebhooksPageByUser", "api.incoming_webhook.disabled.app_error", nil, "", http.StatusNotImplemented) } - webhooks, err := a.Srv().Store.Webhook().GetIncomingListByUser(userId, page*perPage, perPage) + webhooks, err := a.Srv().Store.Webhook().GetIncomingListByUser(userID, page*perPage, perPage) if err != nil { return nil, model.NewAppError("GetIncomingWebhooksPageByUser", "app.webhooks.get_incoming_by_user.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -548,12 +548,12 @@ func (a *App) UpdateOutgoingWebhook(oldHook, updatedHook *model.OutgoingWebhook) return webhook, nil } -func (a *App) GetOutgoingWebhook(hookId string) (*model.OutgoingWebhook, *model.AppError) { +func (a *App) GetOutgoingWebhook(hookID string) (*model.OutgoingWebhook, *model.AppError) { if !*a.Config().ServiceSettings.EnableOutgoingWebhooks { return nil, model.NewAppError("GetOutgoingWebhook", "api.outgoing_webhook.disabled.app_error", nil, "", http.StatusNotImplemented) } - webhook, err := a.Srv().Store.Webhook().GetOutgoing(hookId) + webhook, err := a.Srv().Store.Webhook().GetOutgoing(hookID) if err != nil { var nfErr *store.ErrNotFound switch { @@ -571,12 +571,12 @@ func (a *App) GetOutgoingWebhooksPage(page, perPage int) ([]*model.OutgoingWebho return a.GetOutgoingWebhooksPageByUser("", page, perPage) } -func (a *App) GetOutgoingWebhooksPageByUser(userId string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { +func (a *App) GetOutgoingWebhooksPageByUser(userID string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { if !*a.Config().ServiceSettings.EnableOutgoingWebhooks { return nil, model.NewAppError("GetOutgoingWebhooksPageByUser", "api.outgoing_webhook.disabled.app_error", nil, "", http.StatusNotImplemented) } - webhooks, err := a.Srv().Store.Webhook().GetOutgoingListByUser(userId, page*perPage, perPage) + webhooks, err := a.Srv().Store.Webhook().GetOutgoingListByUser(userID, page*perPage, perPage) if err != nil { return nil, model.NewAppError("GetOutgoingWebhooksPageByUser", "app.webhooks.get_outgoing_by_channel.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -584,12 +584,12 @@ func (a *App) GetOutgoingWebhooksPageByUser(userId string, page, perPage int) ([ return webhooks, nil } -func (a *App) GetOutgoingWebhooksForChannelPageByUser(channelId string, userId string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { +func (a *App) GetOutgoingWebhooksForChannelPageByUser(channelId string, userID string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { if !*a.Config().ServiceSettings.EnableOutgoingWebhooks { return nil, model.NewAppError("GetOutgoingWebhooksForChannelPage", "api.outgoing_webhook.disabled.app_error", nil, "", http.StatusNotImplemented) } - webhooks, err := a.Srv().Store.Webhook().GetOutgoingByChannelByUser(channelId, userId, page*perPage, perPage) + webhooks, err := a.Srv().Store.Webhook().GetOutgoingByChannelByUser(channelId, userID, page*perPage, perPage) if err != nil { return nil, model.NewAppError("GetOutgoingWebhooksForChannelPage", "app.webhooks.get_outgoing_by_channel.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -597,16 +597,16 @@ func (a *App) GetOutgoingWebhooksForChannelPageByUser(channelId string, userId s return webhooks, nil } -func (a *App) GetOutgoingWebhooksForTeamPage(teamId string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { - return a.GetOutgoingWebhooksForTeamPageByUser(teamId, "", page, perPage) +func (a *App) GetOutgoingWebhooksForTeamPage(teamID string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { + return a.GetOutgoingWebhooksForTeamPageByUser(teamID, "", page, perPage) } -func (a *App) GetOutgoingWebhooksForTeamPageByUser(teamId string, userId string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { +func (a *App) GetOutgoingWebhooksForTeamPageByUser(teamID string, userID string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { if !*a.Config().ServiceSettings.EnableOutgoingWebhooks { return nil, model.NewAppError("GetOutgoingWebhooksForTeamPageByUser", "api.outgoing_webhook.disabled.app_error", nil, "", http.StatusNotImplemented) } - webhooks, err := a.Srv().Store.Webhook().GetOutgoingByTeamByUser(teamId, userId, page*perPage, perPage) + webhooks, err := a.Srv().Store.Webhook().GetOutgoingByTeamByUser(teamID, userID, page*perPage, perPage) if err != nil { return nil, model.NewAppError("GetOutgoingWebhooksForTeamPageByUser", "app.webhooks.get_outgoing_by_team.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -614,12 +614,12 @@ func (a *App) GetOutgoingWebhooksForTeamPageByUser(teamId string, userId string, return webhooks, nil } -func (a *App) DeleteOutgoingWebhook(hookId string) *model.AppError { +func (a *App) DeleteOutgoingWebhook(hookID string) *model.AppError { if !*a.Config().ServiceSettings.EnableOutgoingWebhooks { return model.NewAppError("DeleteOutgoingWebhook", "api.outgoing_webhook.disabled.app_error", nil, "", http.StatusNotImplemented) } - if err := a.Srv().Store.Webhook().DeleteOutgoing(hookId, model.GetMillis()); err != nil { + if err := a.Srv().Store.Webhook().DeleteOutgoing(hookID, model.GetMillis()); err != nil { return model.NewAppError("DeleteOutgoingWebhook", "app.webhooks.delete_outgoing.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -641,14 +641,14 @@ func (a *App) RegenOutgoingWebhookToken(hook *model.OutgoingWebhook) (*model.Out return webhook, nil } -func (a *App) HandleIncomingWebhook(hookId string, req *model.IncomingWebhookRequest) *model.AppError { +func (a *App) HandleIncomingWebhook(hookID string, req *model.IncomingWebhookRequest) *model.AppError { if !*a.Config().ServiceSettings.EnableIncomingWebhooks { return model.NewAppError("HandleIncomingWebhook", "web.incoming_webhook.disabled.app_error", nil, "", http.StatusNotImplemented) } hchan := make(chan store.StoreResult, 1) go func() { - webhook, err := a.Srv().Store.Webhook().GetIncoming(hookId, true) + webhook, err := a.Srv().Store.Webhook().GetIncoming(hookID, true) hchan <- store.StoreResult{Data: webhook, NErr: err} close(hchan) }() @@ -775,18 +775,18 @@ func (a *App) HandleIncomingWebhook(hookId string, req *model.IncomingWebhookReq overrideUsername = req.Username } - overrideIconUrl := hook.IconURL + overrideIconURL := hook.IconURL if req.IconURL != "" { - overrideIconUrl = req.IconURL + overrideIconURL = req.IconURL } - _, err := a.CreateWebhookPost(hook.UserId, channel, text, overrideUsername, overrideIconUrl, req.IconEmoji, req.Props, webhookType, "") + _, err := a.CreateWebhookPost(hook.UserId, channel, text, overrideUsername, overrideIconURL, req.IconEmoji, req.Props, webhookType, "") return err } -func (a *App) CreateCommandWebhook(commandId string, args *model.CommandArgs) (*model.CommandWebhook, *model.AppError) { +func (a *App) CreateCommandWebhook(commandID string, args *model.CommandArgs) (*model.CommandWebhook, *model.AppError) { hook := &model.CommandWebhook{ - CommandId: commandId, + CommandId: commandID, UserId: args.UserId, ChannelId: args.ChannelId, RootId: args.RootId, @@ -810,17 +810,17 @@ func (a *App) CreateCommandWebhook(commandId string, args *model.CommandArgs) (* return savedHook, nil } -func (a *App) HandleCommandWebhook(hookId string, response *model.CommandResponse) *model.AppError { +func (a *App) HandleCommandWebhook(hookID string, response *model.CommandResponse) *model.AppError { if response == nil { return model.NewAppError("HandleCommandWebhook", "app.command_webhook.handle_command_webhook.parse", nil, "", http.StatusBadRequest) } - hook, nErr := a.Srv().Store.CommandWebhook().Get(hookId) + hook, nErr := a.Srv().Store.CommandWebhook().Get(hookID) if nErr != nil { var nfErr *store.ErrNotFound switch { case errors.As(nErr, &nfErr): - return model.NewAppError("HandleCommandWebhook", "app.command_webhook.get.missing", map[string]interface{}{"hook_id": hookId}, nfErr.Error(), http.StatusNotFound) + return model.NewAppError("HandleCommandWebhook", "app.command_webhook.get.missing", map[string]interface{}{"hook_id": hookID}, nfErr.Error(), http.StatusNotFound) default: return model.NewAppError("HandleCommandWebhook", "app.command_webhook.get.internal_error", nil, nErr.Error(), http.StatusInternalServerError) } diff --git a/app/webhook_test.go b/app/webhook_test.go index 0cb18c3c8c..773f1c1ae8 100644 --- a/app/webhook_test.go +++ b/app/webhook_test.go @@ -607,7 +607,7 @@ func TestTriggerOutGoingWebhookWithUsernameAndIconURL(t *testing.T) { EnablePostUsernameOverride bool EnablePostIconOverride bool ExpectedUsername string - ExpectedIconUrl string + ExpectedIconURL string WebhookResponse *model.OutgoingWebhookResponse } @@ -637,7 +637,7 @@ func TestTriggerOutGoingWebhookWithUsernameAndIconURL(t *testing.T) { EnablePostUsernameOverride: true, EnablePostIconOverride: true, ExpectedUsername: "some-user-name", - ExpectedIconUrl: "http://some-icon/", + ExpectedIconURL: "http://some-icon/", }, "Should not override username and Icon": { EnablePostUsernameOverride: false, @@ -647,7 +647,7 @@ func TestTriggerOutGoingWebhookWithUsernameAndIconURL(t *testing.T) { EnablePostUsernameOverride: true, EnablePostIconOverride: true, ExpectedUsername: "webhookuser", - ExpectedIconUrl: "http://webhok/icon", + ExpectedIconURL: "http://webhok/icon", WebhookResponse: &model.OutgoingWebhookResponse{Text: &webHookResponse, Username: "webhookuser", IconURL: "http://webhok/icon"}, }, } @@ -692,8 +692,8 @@ func TestTriggerOutGoingWebhookWithUsernameAndIconURL(t *testing.T) { case webhookPost := <-createdPost: assert.Equal(t, webhookPost.Message, "sample response text from test server") assert.Equal(t, webhookPost.GetProp("from_webhook"), "true") - if testCase.ExpectedIconUrl != "" { - assert.Equal(t, webhookPost.GetProp("override_icon_url"), testCase.ExpectedIconUrl) + if testCase.ExpectedIconURL != "" { + assert.Equal(t, webhookPost.GetProp("override_icon_url"), testCase.ExpectedIconURL) } else { assert.Nil(t, webhookPost.GetProp("override_icon_url")) } diff --git a/app/webhub_fuzz.go b/app/webhub_fuzz.go index 545b6346aa..74e59f152d 100644 --- a/app/webhub_fuzz.go +++ b/app/webhub_fuzz.go @@ -73,9 +73,9 @@ func dummyWebsocketHandler() http.HandlerFunc { } } -func registerDummyWebConn(a *App, addr net.Addr, userId string) *WebConn { +func registerDummyWebConn(a *App, addr net.Addr, userID string) *WebConn { session, appErr := a.CreateSession(&model.Session{ - UserId: userId, + UserId: userID, }) if appErr != nil { panic(appErr)