mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
PLT-5017 Fix import of Slack webhook/bot messages. (#4964)
This commit is contained in:
committed by
Corey Hulen
parent
4b1ffcb0bd
commit
95172f1b4b
@@ -20,7 +20,10 @@ import (
|
||||
//
|
||||
|
||||
func ImportPost(post *model.Post) {
|
||||
for messageRuneCount := utf8.RuneCountInString(post.Message); messageRuneCount > 0; messageRuneCount = utf8.RuneCountInString(post.Message) {
|
||||
// Workaround for empty messages, which may be the case if they are webhook posts.
|
||||
firstIteration := true
|
||||
for messageRuneCount := utf8.RuneCountInString(post.Message); messageRuneCount > 0 || firstIteration; messageRuneCount = utf8.RuneCountInString(post.Message) {
|
||||
firstIteration = false
|
||||
var remainder string
|
||||
if messageRuneCount > model.POST_MESSAGE_MAX_RUNES {
|
||||
remainder = string(([]rune(post.Message))[model.POST_MESSAGE_MAX_RUNES:])
|
||||
|
||||
Reference in New Issue
Block a user