mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 12:05:22 +00:00
clean up link preview
This commit is contained in:
parent
12a2061251
commit
bb8e8a4e16
@ -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();
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user