Automatic Merge
Этот коммит содержится в:
@@ -85,8 +85,8 @@ func (api *PluginAPI) ExecuteSlashCommand(commandArgs *model.CommandArgs) (*mode
|
||||
return response, nil
|
||||
}
|
||||
|
||||
func (api *PluginAPI) GetSession(sessionId string) (*model.Session, *model.AppError) {
|
||||
session, err := api.app.GetSessionById(sessionId)
|
||||
func (api *PluginAPI) GetSession(sessionID string) (*model.Session, *model.AppError) {
|
||||
session, err := api.app.GetSessionById(sessionID)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -311,17 +311,17 @@ func (api *PluginAPI) UpdateUserStatus(userID, status string) (*model.Status, *m
|
||||
return api.app.GetStatus(userID)
|
||||
}
|
||||
|
||||
func (api *PluginAPI) GetUsersInChannel(channelId, sortBy string, page, perPage int) ([]*model.User, *model.AppError) {
|
||||
func (api *PluginAPI) GetUsersInChannel(channelID, sortBy string, page, perPage int) ([]*model.User, *model.AppError) {
|
||||
switch sortBy {
|
||||
case model.CHANNEL_SORT_BY_USERNAME:
|
||||
return api.app.GetUsersInChannel(&model.UserGetOptions{
|
||||
InChannelId: channelId,
|
||||
InChannelId: channelID,
|
||||
Page: page,
|
||||
PerPage: perPage,
|
||||
})
|
||||
case model.CHANNEL_SORT_BY_STATUS:
|
||||
return api.app.GetUsersInChannelByStatus(&model.UserGetOptions{
|
||||
InChannelId: channelId,
|
||||
InChannelId: channelID,
|
||||
Page: page,
|
||||
PerPage: perPage,
|
||||
})
|
||||
@@ -357,8 +357,8 @@ func (api *PluginAPI) CreateChannel(channel *model.Channel) (*model.Channel, *mo
|
||||
return api.app.CreateChannel(channel, false)
|
||||
}
|
||||
|
||||
func (api *PluginAPI) DeleteChannel(channelId string) *model.AppError {
|
||||
channel, err := api.app.GetChannel(channelId)
|
||||
func (api *PluginAPI) DeleteChannel(channelID string) *model.AppError {
|
||||
channel, err := api.app.GetChannel(channelID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -373,8 +373,8 @@ func (api *PluginAPI) GetPublicChannelsForTeam(teamID string, page, perPage int)
|
||||
return *channels, err
|
||||
}
|
||||
|
||||
func (api *PluginAPI) GetChannel(channelId string) (*model.Channel, *model.AppError) {
|
||||
return api.app.GetChannel(channelId)
|
||||
func (api *PluginAPI) GetChannel(channelID string) (*model.Channel, *model.AppError) {
|
||||
return api.app.GetChannel(channelID)
|
||||
}
|
||||
|
||||
func (api *PluginAPI) GetChannelByName(teamID, name string, includeDeleted bool) (*model.Channel, *model.AppError) {
|
||||
@@ -393,16 +393,16 @@ func (api *PluginAPI) GetChannelsForTeamForUser(teamID, userID string, includeDe
|
||||
return *channels, err
|
||||
}
|
||||
|
||||
func (api *PluginAPI) GetChannelStats(channelId string) (*model.ChannelStats, *model.AppError) {
|
||||
memberCount, err := api.app.GetChannelMemberCount(channelId)
|
||||
func (api *PluginAPI) GetChannelStats(channelID string) (*model.ChannelStats, *model.AppError) {
|
||||
memberCount, err := api.app.GetChannelMemberCount(channelID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
guestCount, err := api.app.GetChannelMemberCount(channelId)
|
||||
guestCount, err := api.app.GetChannelMemberCount(channelID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &model.ChannelStats{ChannelId: channelId, MemberCount: memberCount, GuestCount: guestCount}, nil
|
||||
return &model.ChannelStats{ChannelId: channelID, MemberCount: memberCount, GuestCount: guestCount}, nil
|
||||
}
|
||||
|
||||
func (api *PluginAPI) GetDirectChannel(userID1, userID2 string) (*model.Channel, *model.AppError) {
|
||||
@@ -476,12 +476,12 @@ func (api *PluginAPI) SearchPostsInTeamForUser(teamID string, userID string, sea
|
||||
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 := ""
|
||||
|
||||
channel, err := api.GetChannel(channelId)
|
||||
channel, err := api.GetChannel(channelID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -489,10 +489,10 @@ func (api *PluginAPI) AddChannelMember(channelId, userID string) (*model.Channel
|
||||
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)
|
||||
channel, err := api.GetChannel(channelID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -500,32 +500,32 @@ func (api *PluginAPI) AddUserToChannel(channelId, userID, asUserId string) (*mod
|
||||
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) 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) 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) {
|
||||
@@ -552,8 +552,8 @@ func (api *PluginAPI) RemoveReaction(reaction *model.Reaction) *model.AppError {
|
||||
return api.app.DeleteReactionForPost(reaction)
|
||||
}
|
||||
|
||||
func (api *PluginAPI) GetReactions(postId string) ([]*model.Reaction, *model.AppError) {
|
||||
return api.app.GetReactionsForPost(postId)
|
||||
func (api *PluginAPI) GetReactions(postID string) ([]*model.Reaction, *model.AppError) {
|
||||
return api.app.GetReactionsForPost(postID)
|
||||
}
|
||||
|
||||
func (api *PluginAPI) SendEphemeralPost(userID string, post *model.Post) *model.Post {
|
||||
@@ -564,37 +564,37 @@ func (api *PluginAPI) UpdateEphemeralPost(userID string, post *model.Post) *mode
|
||||
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 {
|
||||
_, err := api.app.DeletePost(postId, api.id)
|
||||
func (api *PluginAPI) DeletePost(postID string) *model.AppError {
|
||||
_, err := api.app.DeletePost(postID, api.id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (api *PluginAPI) GetPostThread(postId string) (*model.PostList, *model.AppError) {
|
||||
return api.app.GetPostThread(postId, false, false, false)
|
||||
func (api *PluginAPI) GetPostThread(postID string) (*model.PostList, *model.AppError) {
|
||||
return api.app.GetPostThread(postID, false, false, false)
|
||||
}
|
||||
|
||||
func (api *PluginAPI) GetPost(postId string) (*model.Post, *model.AppError) {
|
||||
return api.app.GetSinglePost(postId)
|
||||
func (api *PluginAPI) GetPost(postID string) (*model.Post, *model.AppError) {
|
||||
return api.app.GetSinglePost(postID)
|
||||
}
|
||||
|
||||
func (api *PluginAPI) GetPostsSince(channelId string, time int64) (*model.PostList, *model.AppError) {
|
||||
return api.app.GetPostsSince(model.GetPostsSinceOptions{ChannelId: channelId, Time: time})
|
||||
func (api *PluginAPI) GetPostsSince(channelID string, time int64) (*model.PostList, *model.AppError) {
|
||||
return api.app.GetPostsSince(model.GetPostsSinceOptions{ChannelId: channelID, Time: time})
|
||||
}
|
||||
|
||||
func (api *PluginAPI) GetPostsAfter(channelId, postId string, page, perPage int) (*model.PostList, *model.AppError) {
|
||||
return api.app.GetPostsAfterPost(model.GetPostsOptions{ChannelId: channelId, PostId: postId, Page: page, PerPage: perPage})
|
||||
func (api *PluginAPI) GetPostsAfter(channelID, postID string, page, perPage int) (*model.PostList, *model.AppError) {
|
||||
return api.app.GetPostsAfterPost(model.GetPostsOptions{ChannelId: channelID, PostId: postID, Page: page, PerPage: perPage})
|
||||
}
|
||||
|
||||
func (api *PluginAPI) GetPostsBefore(channelId, postId string, page, perPage int) (*model.PostList, *model.AppError) {
|
||||
return api.app.GetPostsBeforePost(model.GetPostsOptions{ChannelId: channelId, PostId: postId, Page: page, PerPage: perPage})
|
||||
func (api *PluginAPI) GetPostsBefore(channelID, postID string, page, perPage int) (*model.PostList, *model.AppError) {
|
||||
return api.app.GetPostsBeforePost(model.GetPostsOptions{ChannelId: channelID, PostId: postID, Page: page, PerPage: perPage})
|
||||
}
|
||||
|
||||
func (api *PluginAPI) GetPostsForChannel(channelId string, page, perPage int) (*model.PostList, *model.AppError) {
|
||||
return api.app.GetPostsPage(model.GetPostsOptions{ChannelId: channelId, Page: page, PerPage: perPage})
|
||||
func (api *PluginAPI) GetPostsForChannel(channelID string, page, perPage int) (*model.PostList, *model.AppError) {
|
||||
return api.app.GetPostsPage(model.GetPostsOptions{ChannelId: channelID, Page: page, PerPage: perPage})
|
||||
}
|
||||
|
||||
func (api *PluginAPI) UpdatePost(post *model.Post) (*model.Post, *model.AppError) {
|
||||
@@ -632,24 +632,24 @@ 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) {
|
||||
return api.app.GetFileInfo(fileId)
|
||||
func (api *PluginAPI) GetFileInfo(fileID string) (*model.FileInfo, *model.AppError) {
|
||||
return api.app.GetFileInfo(fileID)
|
||||
}
|
||||
|
||||
func (api *PluginAPI) GetFileInfos(page, perPage int, opt *model.GetFileInfosOptions) ([]*model.FileInfo, *model.AppError) {
|
||||
return api.app.GetFileInfos(page, perPage, opt)
|
||||
}
|
||||
|
||||
func (api *PluginAPI) GetFileLink(fileId string) (string, *model.AppError) {
|
||||
func (api *PluginAPI) GetFileLink(fileID string) (string, *model.AppError) {
|
||||
if !*api.app.Config().FileSettings.EnablePublicLink {
|
||||
return "", model.NewAppError("GetFileLink", "plugin_api.get_file_link.disabled.app_error", nil, "", http.StatusNotImplemented)
|
||||
}
|
||||
|
||||
info, err := api.app.GetFileInfo(fileId)
|
||||
info, err := api.app.GetFileInfo(fileID)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@@ -665,12 +665,12 @@ func (api *PluginAPI) ReadFile(path string) ([]byte, *model.AppError) {
|
||||
return api.app.ReadFile(path)
|
||||
}
|
||||
|
||||
func (api *PluginAPI) GetFile(fileId string) ([]byte, *model.AppError) {
|
||||
return api.app.GetFile(fileId)
|
||||
func (api *PluginAPI) GetFile(fileID string) ([]byte, *model.AppError) {
|
||||
return api.app.GetFile(fileID)
|
||||
}
|
||||
|
||||
func (api *PluginAPI) UploadFile(data []byte, channelId string, filename string) (*model.FileInfo, *model.AppError) {
|
||||
return api.app.UploadFile(data, channelId, filename)
|
||||
func (api *PluginAPI) UploadFile(data []byte, channelID string, filename string) (*model.FileInfo, *model.AppError) {
|
||||
return api.app.UploadFile(data, channelID, filename)
|
||||
}
|
||||
|
||||
func (api *PluginAPI) GetEmojiImage(emojiId string) ([]byte, string, *model.AppError) {
|
||||
@@ -836,8 +836,8 @@ func (api *PluginAPI) HasPermissionToTeam(userID, teamID string, permission *mod
|
||||
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{}) {
|
||||
@@ -915,8 +915,8 @@ func (api *PluginAPI) DeleteBotIconImage(userID string) *model.AppError {
|
||||
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 {
|
||||
|
||||
Ссылка в новой задаче
Block a user