From e0ff1f672500d184c0eedd0f2ab6fc79cc185ca7 Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Tue, 26 Dec 2023 18:04:27 -0300 Subject: [PATCH] fix(#307): use longs instead of ints in Pleroma/Akkoma instance poll configs Who the hell had the idea to use longs for this >:C --- .../android/fragments/ProfileFragment.java | 2 +- .../org/joinmastodon/android/model/Instance.java | 16 ++++++++-------- .../ComposePollViewController.java | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java index 256591611..a392e4c80 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java @@ -219,7 +219,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList if(!isOwnProfile) loadRelationship(); else if (isInstanceAkkoma()) { - maxFields = getInstance().get().pleroma.metadata.fieldsLimits.maxFields; + maxFields = (int) getInstance().get().pleroma.metadata.fieldsLimits.maxFields; } }else{ profileAccountID=getArguments().getString("profileAccountID"); diff --git a/mastodon/src/main/java/org/joinmastodon/android/model/Instance.java b/mastodon/src/main/java/org/joinmastodon/android/model/Instance.java index aacf41b9a..ed91e59cf 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/model/Instance.java +++ b/mastodon/src/main/java/org/joinmastodon/android/model/Instance.java @@ -245,19 +245,19 @@ public class Instance extends BaseModel{ @Parcel public static class FieldsLimits { - public int maxFields; - public int maxRemoteFields; - public int nameLength; - public int valueLength; + public long maxFields; + public long maxRemoteFields; + public long nameLength; + public long valueLength; } } } @Parcel public static class PleromaPollLimits { - public int maxExpiration; - public int maxOptionChars; - public int maxOptions; - public int minExpiration; + public long maxExpiration; + public long maxOptionChars; + public long maxOptions; + public long minExpiration; } } diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/viewcontrollers/ComposePollViewController.java b/mastodon/src/main/java/org/joinmastodon/android/ui/viewcontrollers/ComposePollViewController.java index 9c3b64e7f..d4415b538 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/viewcontrollers/ComposePollViewController.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/viewcontrollers/ComposePollViewController.java @@ -82,9 +82,9 @@ public class ComposePollViewController{ maxPollOptionLength=instance.configuration.polls.maxCharactersPerOption; } else { if(instance!=null && instance.pollLimits!=null && instance.pollLimits.maxOptions>0) - maxPollOptions=instance.pollLimits.maxOptions; + maxPollOptions= (int) instance.pollLimits.maxOptions; if(instance!=null && instance.pollLimits!=null && instance.pollLimits.maxOptionChars>0) - maxPollOptionLength=instance.pollLimits.maxOptionChars; + maxPollOptionLength= (int) instance.pollLimits.maxOptionChars; } pollOptionsView=pollWrap.findViewById(R.id.poll_options);