PLT-5017 Fix import of Slack webhook/bot messages. (#4964)
Этот коммит содержится в:
коммит произвёл
Corey Hulen
родитель
4b1ffcb0bd
Коммит
95172f1b4b
@@ -20,7 +20,10 @@ import (
|
|||||||
//
|
//
|
||||||
|
|
||||||
func ImportPost(post *model.Post) {
|
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
|
var remainder string
|
||||||
if messageRuneCount > model.POST_MESSAGE_MAX_RUNES {
|
if messageRuneCount > model.POST_MESSAGE_MAX_RUNES {
|
||||||
remainder = string(([]rune(post.Message))[model.POST_MESSAGE_MAX_RUNES:])
|
remainder = string(([]rune(post.Message))[model.POST_MESSAGE_MAX_RUNES:])
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user