From 2ab5ab3ce5072c61e8dd6eafa1cf535d4d1edc09 Mon Sep 17 00:00:00 2001 From: Bazsalanszky Date: Sun, 6 Aug 2023 09:37:46 +0200 Subject: [PATCH] Fix posting from community home page This commit resolves the issue that made the app crash after trying to post from a community home page. Closes #70 --- .../infinityforlemmy/activities/PostImageActivity.java | 2 +- .../infinityforlemmy/activities/PostLinkActivity.java | 2 +- .../infinityforlemmy/activities/PostTextActivity.java | 2 +- .../activities/ViewSubredditDetailActivity.java | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/eu/toldi/infinityforlemmy/activities/PostImageActivity.java b/app/src/main/java/eu/toldi/infinityforlemmy/activities/PostImageActivity.java index 1a6e0aad..c1bc06f7 100644 --- a/app/src/main/java/eu/toldi/infinityforlemmy/activities/PostImageActivity.java +++ b/app/src/main/java/eu/toldi/infinityforlemmy/activities/PostImageActivity.java @@ -511,7 +511,7 @@ public class PostImageActivity extends BaseActivity implements FlairBottomSheetF } private void loadSubredditIcon() { - LoadSubredditIcon.loadSubredditIcon(mExecutor, new Handler(), mRedditDataRoomDatabase, subredditName, mAccessToken, mOauthRetrofit, mRetrofit.getRetrofit(), iconImageUrl -> { + LoadSubredditIcon.loadSubredditIcon(mExecutor, new Handler(), mRedditDataRoomDatabase, communityData.getQualified_name(), mAccessToken, mOauthRetrofit, mRetrofit.getRetrofit(), iconImageUrl -> { iconUrl = iconImageUrl; displaySubredditIcon(); loadSubredditIconSuccessful = true; diff --git a/app/src/main/java/eu/toldi/infinityforlemmy/activities/PostLinkActivity.java b/app/src/main/java/eu/toldi/infinityforlemmy/activities/PostLinkActivity.java index 48335d42..0040ba67 100644 --- a/app/src/main/java/eu/toldi/infinityforlemmy/activities/PostLinkActivity.java +++ b/app/src/main/java/eu/toldi/infinityforlemmy/activities/PostLinkActivity.java @@ -488,7 +488,7 @@ public class PostLinkActivity extends BaseActivity implements FlairBottomSheetFr } private void loadSubredditIcon() { - LoadSubredditIcon.loadSubredditIcon(mExecutor, new Handler(), mRedditDataRoomDatabase, subredditName, + LoadSubredditIcon.loadSubredditIcon(mExecutor, new Handler(), mRedditDataRoomDatabase, communityData.getQualified_name(), mAccessToken, mOauthRetrofit, mRetrofit.getRetrofit(), iconImageUrl -> { iconUrl = iconImageUrl; displaySubredditIcon(); diff --git a/app/src/main/java/eu/toldi/infinityforlemmy/activities/PostTextActivity.java b/app/src/main/java/eu/toldi/infinityforlemmy/activities/PostTextActivity.java index c49413eb..8256625d 100644 --- a/app/src/main/java/eu/toldi/infinityforlemmy/activities/PostTextActivity.java +++ b/app/src/main/java/eu/toldi/infinityforlemmy/activities/PostTextActivity.java @@ -450,7 +450,7 @@ public class PostTextActivity extends BaseActivity implements FlairBottomSheetFr } private void loadSubredditIcon() { - LoadSubredditIcon.loadSubredditIcon(mExecutor, new Handler(), mRedditDataRoomDatabase, subredditName, + LoadSubredditIcon.loadSubredditIcon(mExecutor, new Handler(), mRedditDataRoomDatabase, communityData.getQualified_name(), mAccessToken, mOauthRetrofit, mRetrofit.getRetrofit(), iconImageUrl -> { iconUrl = iconImageUrl; displaySubredditIcon(); diff --git a/app/src/main/java/eu/toldi/infinityforlemmy/activities/ViewSubredditDetailActivity.java b/app/src/main/java/eu/toldi/infinityforlemmy/activities/ViewSubredditDetailActivity.java index 6633482d..0ec1bb67 100644 --- a/app/src/main/java/eu/toldi/infinityforlemmy/activities/ViewSubredditDetailActivity.java +++ b/app/src/main/java/eu/toldi/infinityforlemmy/activities/ViewSubredditDetailActivity.java @@ -1286,27 +1286,27 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp break; case PostTypeBottomSheetFragment.TYPE_LINK: intent = new Intent(this, PostLinkActivity.class); - intent.putExtra(PostLinkActivity.EXTRA_SUBREDDIT_NAME, communityName); + intent.putExtra(PostLinkActivity.EXTRA_SUBREDDIT_NAME, qualifiedName); startActivity(intent); break; case PostTypeBottomSheetFragment.TYPE_IMAGE: intent = new Intent(this, PostImageActivity.class); - intent.putExtra(PostImageActivity.EXTRA_SUBREDDIT_NAME, communityName); + intent.putExtra(PostImageActivity.EXTRA_SUBREDDIT_NAME, qualifiedName); startActivity(intent); break; case PostTypeBottomSheetFragment.TYPE_VIDEO: intent = new Intent(this, PostVideoActivity.class); - intent.putExtra(PostVideoActivity.EXTRA_SUBREDDIT_NAME, communityName); + intent.putExtra(PostVideoActivity.EXTRA_SUBREDDIT_NAME, qualifiedName); startActivity(intent); break; case PostTypeBottomSheetFragment.TYPE_GALLERY: intent = new Intent(this, PostGalleryActivity.class); - intent.putExtra(PostGalleryActivity.EXTRA_SUBREDDIT_NAME, communityName); + intent.putExtra(PostGalleryActivity.EXTRA_SUBREDDIT_NAME, qualifiedName); startActivity(intent); break; case PostTypeBottomSheetFragment.TYPE_POLL: intent = new Intent(this, PostPollActivity.class); - intent.putExtra(PostPollActivity.EXTRA_SUBREDDIT_NAME, communityName); + intent.putExtra(PostPollActivity.EXTRA_SUBREDDIT_NAME, qualifiedName); startActivity(intent); } }