clean up link preview

This commit is contained in:
Ryan ZHAO 2021-02-23 11:31:17 +11:00
parent 12a2061251
commit bb8e8a4e16
2 changed files with 0 additions and 18 deletions

View File

@ -52,7 +52,6 @@ public class LinkPreviewRepository implements InjectableType {
public LinkPreviewRepository(@NonNull Context context) {
this.client = new OkHttpClient.Builder()
// .proxySelector(new ContentProxySelector()) // Loki: Signal's proxy appears to have been banned by YouTube
.addNetworkInterceptor(new ContentProxySafetyInterceptor())
.cache(null)
.build();

View File

@ -17,7 +17,6 @@ import org.session.libsignal.libsignal.util.guava.Optional;
import org.session.libsession.utilities.Util;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@ -168,17 +167,6 @@ public final class LinkPreviewUtil {
return new OpenGraph(openGraphTags, htmlTitle, faviconUrl);
}
private static @Nullable String parseTopLevelDomain(@NonNull String domain) {
int periodIndex = domain.lastIndexOf(".");
if (periodIndex >= 0 && periodIndex < domain.length() - 1) {
return domain.substring(periodIndex + 1);
} else {
return null;
}
}
public static final class OpenGraph {
private final Map<String, String> values;
@ -219,11 +207,6 @@ public final class LinkPreviewUtil {
.findFirst()
.orElse(0L);
}
public @NonNull
Optional<String> getDescription() {
return Optional.of(values.get(KEY_DESCRIPTION_URL));
}
}
public interface HtmlDecoder {