From f0b87c62a593c42f813023375e98fb61ec4e4bdd Mon Sep 17 00:00:00 2001 From: FineFindus Date: Wed, 8 Nov 2023 19:36:24 +0100 Subject: [PATCH 1/2] fix(status/edit-history): check for negative array index --- .../android/ui/utils/InsetStatusItemDecoration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/utils/InsetStatusItemDecoration.java b/mastodon/src/main/java/org/joinmastodon/android/ui/utils/InsetStatusItemDecoration.java index 8d82954f6..afc26c9a7 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/utils/InsetStatusItemDecoration.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/utils/InsetStatusItemDecoration.java @@ -93,7 +93,7 @@ public class InsetStatusItemDecoration extends RecyclerView.ItemDecoration{ outRect.left=outRect.right=V.dp(8); if(!bottomSiblingInset) outRect.bottom=V.dp(16); - if(!topSiblingInset && displayItems.get(pos-1) instanceof NotificationHeaderStatusDisplayItem) + if(!topSiblingInset && pos > 1 && displayItems.get(pos-1) instanceof NotificationHeaderStatusDisplayItem) outRect.top=V.dp(-8); } } From 3c4baf01260f469c9284da84250c663babdbc9fd Mon Sep 17 00:00:00 2001 From: FineFindus Date: Wed, 8 Nov 2023 19:45:49 +0100 Subject: [PATCH 2/2] fix(status/edit-history): set fake poll fields --- .../android/api/requests/statuses/GetStatusEditHistory.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mastodon/src/main/java/org/joinmastodon/android/api/requests/statuses/GetStatusEditHistory.java b/mastodon/src/main/java/org/joinmastodon/android/api/requests/statuses/GetStatusEditHistory.java index e682cd02a..27432bfdc 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/api/requests/statuses/GetStatusEditHistory.java +++ b/mastodon/src/main/java/org/joinmastodon/android/api/requests/statuses/GetStatusEditHistory.java @@ -26,6 +26,11 @@ public class GetStatusEditHistory extends MastodonAPIRequest>{ s.visibility=StatusPrivacy.PUBLIC; s.mentions=Collections.emptyList(); s.tags=Collections.emptyList(); + if(s.poll!=null){ + s.poll.id="fakeID"+i; + s.poll.emojis=Collections.emptyList(); + s.poll.ownVotes=Collections.emptyList(); + } i++; } super.validateAndPostprocessResponse(respObj, httpResponse);