From a26fed31d89f6f03da57f60aa6f2ec2562cf3942 Mon Sep 17 00:00:00 2001 From: Austin O'Neil Date: Mon, 18 Mar 2024 18:23:52 -0700 Subject: [PATCH 1/2] Update README.md to provide instructions for when receiving an error about missing Java runtime on Mac. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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). From f390a7b64ff54b879a0ebb51e5d8bc1c718326d8 Mon Sep 17 00:00:00 2001 From: Austin O'Neil Date: Tue, 19 Mar 2024 16:00:37 -0700 Subject: [PATCH 2/2] Fix issue where app is using instant view when clicking link and ignoring instant view settings. Resolves [this issue](https://github.com/TGX-Android/Telegram-X/issues/573) --- .../thunderdog/challegram/data/TGMessage.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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 a406a80402..4b544c3de8 100644 --- a/app/src/main/java/org/thunderdog/challegram/data/TGMessage.java +++ b/app/src/main/java/org/thunderdog/challegram/data/TGMessage.java @@ -7616,7 +7616,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 @@ -7654,6 +7667,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();