mirror of
https://github.com/mattermost/mattermost.git
synced 2026-05-28 04:35:04 -04:00
PLT-5017 Fix import of Slack webhook/bot messages. (#4964)
This commit is contained in:
parent
4b1ffcb0bd
commit
95172f1b4b
1 changed files with 4 additions and 1 deletions
|
|
@ -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:])
|
||||
|
|
|
|||
Loading…
Reference in a new issue