Convert SignalService, Database, Group, Payment, and other remaining protos to wire.

This commit is contained in:
Cody Henthorne
2023-09-18 15:32:43 -04:00
committed by Alex Hart
parent a6b7d0bcc5
commit efbd5cab85
267 changed files with 7100 additions and 7214 deletions

View File

@@ -315,14 +315,17 @@ public class SearchRepository {
int startIndex = TextUtils.indexOf(body, cleanSnippet);
if (startIndex != -1) {
BodyRangeList.Builder builder = BodyRangeList.newBuilder();
for (BodyRangeList.BodyRange range : bodyRanges.getRangesList()) {
int adjustedStart = range.getStart() - startIndex + startOffset;
if (adjustedStart >= 0 && adjustedStart + range.getLength() <= bodySnippet.length()) {
builder.addRanges(range.toBuilder().setStart(adjustedStart).build());
List<BodyRangeList.BodyRange> newRanges = new ArrayList<>(bodyRanges.ranges.size());
for (BodyRangeList.BodyRange range : bodyRanges.ranges) {
int adjustedStart = range.start - startIndex + startOffset;
if (adjustedStart >= 0 && adjustedStart + range.length <= bodySnippet.length()) {
newRanges.add(range.newBuilder().start(adjustedStart).build());
}
}
BodyRangeList.Builder builder = new BodyRangeList.Builder();
builder.ranges(newRanges);
MessageStyler.style(id, builder.build(), bodySnippet);
}
}