summaryrefslogtreecommitdiffstats
path: root/app/slackimport.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-10-30 11:57:24 -0500
committerGitHub <noreply@github.com>2017-10-30 11:57:24 -0500
commitc5e8cb25caa39ed018ede5270e1566e8f7448396 (patch)
tree80f9f8957d4ff8458ecf9631135c916df25544bd /app/slackimport.go
parent63df41b91110bac06baffef87fe0c1952b47ac93 (diff)
downloadchat-c5e8cb25caa39ed018ede5270e1566e8f7448396.tar.gz
chat-c5e8cb25caa39ed018ede5270e1566e8f7448396.tar.bz2
chat-c5e8cb25caa39ed018ede5270e1566e8f7448396.zip
simplify things (#7735)
Diffstat (limited to 'app/slackimport.go')
-rw-r--r--app/slackimport.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/slackimport.go b/app/slackimport.go
index 918f885a6..9d1b4cf9c 100644
--- a/app/slackimport.go
+++ b/app/slackimport.go
@@ -243,7 +243,7 @@ func (a *App) SlackAddPosts(teamId string, channel *model.Channel, posts []Slack
CreateAt: SlackConvertTimeStamp(sPost.TimeStamp),
}
if sPost.Upload {
- if fileInfo, ok := a.SlackUploadFile(sPost, uploads, teamId, newPost.ChannelId, newPost.UserId); ok == true {
+ if fileInfo, ok := a.SlackUploadFile(sPost, uploads, teamId, newPost.ChannelId, newPost.UserId); ok {
newPost.FileIds = append(newPost.FileIds, fileInfo.Id)
newPost.Message = sPost.File.Title
}
@@ -395,7 +395,7 @@ func (a *App) SlackAddPosts(teamId string, channel *model.Channel, posts []Slack
func (a *App) SlackUploadFile(sPost SlackPost, uploads map[string]*zip.File, teamId string, channelId string, userId string) (*model.FileInfo, bool) {
if sPost.File != nil {
- if file, ok := uploads[sPost.File.Id]; ok == true {
+ if file, ok := uploads[sPost.File.Id]; ok {
openFile, err := file.Open()
if err != nil {
l4g.Warn(utils.T("api.slackimport.slack_add_posts.upload_file_open_failed.warn", map[string]interface{}{"FileId": sPost.File.Id, "Error": err.Error()}))
@@ -655,7 +655,7 @@ func (a *App) SlackImport(fileData multipart.File, fileSize int64, teamID string
if len(spl) == 2 && strings.HasSuffix(spl[1], ".json") {
newposts, _ := SlackParsePosts(reader)
channel := spl[0]
- if _, ok := posts[channel]; ok == false {
+ if _, ok := posts[channel]; !ok {
posts[channel] = newposts
} else {
posts[channel] = append(posts[channel], newposts...)