diff --git a/README.md b/README.md index f3717a1c24..b237459fe8 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,8 @@ This is the complete source code and the build instructions for the official alt * [Homebrew](https://brew.sh) * git with LFS, wget and sed: `$ brew install git git-lfs wget gsed && git lfs install` +* Java runtime: `brew install java` + * Run `java --help` to verify your system can find Java. If not, run `sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk` #### Ubuntu @@ -130,4 +132,4 @@ List of third-party components used in **Telegram X** can be found [here](/docs/ **Telegram X** welcomes contributions. Check out [pull request template](/docs/PULL_REQUEST_TEMPLATE.md) and [guide for contributors](/docs/GUIDE.md) to learn more about Telegram X internals before creating the first pull request. -If you are a regular user and experience a problem with Telegram X, the best place to look for solution is [Telegram X chat](https://t.me/tgandroidtests) — a community with over 4 thousand members. Please do not use this repository to ask questions: if you have general issue with Telegram, refer to [FAQ](http://telegram.org/faq) or contact [Telegram Support](https://telegram.org/faq#telegram-support). \ No newline at end of file +If you are a regular user and experience a problem with Telegram X, the best place to look for solution is [Telegram X chat](https://t.me/tgandroidtests) — a community with over 4 thousand members. Please do not use this repository to ask questions: if you have general issue with Telegram, refer to [FAQ](http://telegram.org/faq) or contact [Telegram Support](https://telegram.org/faq#telegram-support). diff --git a/app/src/main/java/org/thunderdog/challegram/data/TGMessage.java b/app/src/main/java/org/thunderdog/challegram/data/TGMessage.java index 85375a4a0c..63d807b646 100644 --- a/app/src/main/java/org/thunderdog/challegram/data/TGMessage.java +++ b/app/src/main/java/org/thunderdog/challegram/data/TGMessage.java @@ -7641,7 +7641,20 @@ public TdApi.WebPage findWebPage (String link) { @Override public boolean forceInstantView (String link) { - return hasInstantView(link); + int instantViewOption = Settings.instance().getInstantViewMode(); + switch (instantViewOption) { + case Settings.INSTANT_VIEW_MODE_ALL: + return hasInstantView(link); + case Settings.INSTANT_VIEW_MODE_INTERNAL: + return hasInstantView(link) && isInternalLink(link); + case Settings.INSTANT_VIEW_MODE_NONE: + return false; + } + return true; + } + + private boolean isInternalLink(String link) { + return link.contains("telegram.org") || link.contains("telegra.ph"); } @Override @@ -7679,6 +7692,7 @@ public boolean onPhoneNumberClick (String phoneNumber) { return false; } + // Austin right here @Override public boolean onUrlClick (View view, String link, boolean promptUser, @NonNull TdlibUi.UrlOpenParameters openParameters) { trackSponsoredMessageClicked();