mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Convert SignalService, Database, Group, Payment, and other remaining protos to wire.
This commit is contained in:
committed by
Alex Hart
parent
a6b7d0bcc5
commit
efbd5cab85
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user