Bugfix: Text after the last pill was not send

This commit is contained in:
Benoit Marty 2019-12-03 14:48:41 +01:00
parent 4f3da353e4
commit 998d9f2c59
1 changed files with 4 additions and 0 deletions

View File

@ -62,10 +62,14 @@ internal class TextPillsUtils @Inject constructor(
var currIndex = 0
pills.forEachIndexed { _, (urlSpan, start, end) ->
// We want to replace with the pill with a html link
// append text before pill
append(text, currIndex, start)
// append the pill
append(String.format(template, urlSpan.userId, urlSpan.displayName))
currIndex = end
}
// append text after the last pill
append(text, currIndex, text.length)
}
}