Skip to content

Commit

Permalink
RemoveZoomLimit: fix embedded attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
Juby210 committed Feb 11, 2024
1 parent 717f657 commit b4aaa78
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion RemoveZoomLimit/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
version = "1.0.9"
version = "1.0.10"
description = "Removes maximum zoom limit."

aliucord.changelog.set("""
Fixed {updated marginTop}
======================
## 1.0.10
* fixed not loading embedded attachments
## 1.0.9
* fixed not loading attachments in media viewer
""".trimIndent())
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
@Override
public void start(Context context) throws Throwable {
// remove limited width and height from the url
var pattern = Pattern.compile("\\?width=\\d+&height=\\d+");
var pattern = Pattern.compile("width=\\d+&height=\\d+");
patcher.patch(WidgetMedia.class, "getFormattedUrl", new Class<?>[]{ Context.class, Uri.class }, new Hook(param -> {
var res = (String) param.getResult();
if (res.contains(".discordapp.net/")) param.setResult(pattern.matcher(res).replaceFirst(""));
Expand Down

0 comments on commit b4aaa78

Please sign in to comment.