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
This commit is contained in:
LucasGGamerM 2023-12-26 18:04:27 -03:00
parent d8cc578537
commit e0ff1f6725
3 changed files with 11 additions and 11 deletions

View File

@ -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");

View File

@ -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;
}
}

View File

@ -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);