summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2016-09-06 17:56:29 +0100
committerJoram Wilander <jwawilander@gmail.com>2016-09-06 12:56:29 -0400
commitaf0df81a9736dcae6d009e7d2ff38907e909d510 (patch)
tree1db15dac61651874980bbf223481ebddf7257ef8 /api
parent856ae2901b689e1b022994c4c8db2445fe5e60bf (diff)
downloadchat-af0df81a9736dcae6d009e7d2ff38907e909d510.tar.gz
chat-af0df81a9736dcae6d009e7d2ff38907e909d510.tar.bz2
chat-af0df81a9736dcae6d009e7d2ff38907e909d510.zip
Fix @channel, @here and @everyone Slack import. (#3946)
Does this by adding special case regexes to the @mention importing code in the Slack importer for these three special mention types. Fixes PLT-4053
Diffstat (limited to 'api')
-rw-r--r--api/slackimport.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/api/slackimport.go b/api/slackimport.go
index 4382e7f6d..f96a15be2 100644
--- a/api/slackimport.go
+++ b/api/slackimport.go
@@ -242,6 +242,11 @@ func SlackConvertUserMentions(users []SlackUser, posts map[string][]SlackPost) m
regexes["@"+user.Username] = r
}
+ // Special cases.
+ regexes["@here"], _ = regexp.Compile(`<!here\|@here>`)
+ regexes["@channel"], _ = regexp.Compile("<!channel>")
+ regexes["@all"], _ = regexp.Compile("<!everyone>")
+
for channelName, channelPosts := range posts {
for postIdx, post := range channelPosts {
for mention, r := range regexes {