Merge pull request #33 from tulir/initial-sync

Use initial sync data instead of fetching room list, state, history, etc manually
This commit is contained in:
Tulir Asokan
2018-04-24 22:58:30 +03:00
committed by GitHub
10 changed files with 134 additions and 84 deletions

View File

@ -72,8 +72,18 @@ func (msg *BaseTextMessage) calculateBufferWithText(text tstring.TString, width
}
matches := boundaryPattern.FindAllStringIndex(extract.String(), -1)
if len(matches) > 0 {
extract = extract[:matches[len(matches)-1][1]]
if len(matches) == 0 {
continue
}
match := matches[len(matches)-1]
if len(match) < 2 {
continue
}
until := match[1]
if until < len(extract) {
extract = extract[:until]
}
}
msg.buffer = append(msg.buffer, extract)