Skip to content

Commit

Permalink
fix(#307): use longs instead of ints in Pleroma/Akkoma instance poll …
Browse files Browse the repository at this point in the history
…configs

Who the hell had the idea to use longs for this >:C
  • Loading branch information
LucasGGamerM committed Dec 26, 2023
1 parent d8cc578 commit e0ff1f6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public void onCreate(Bundle savedInstanceState){
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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,19 +245,19 @@ public static class Metadata {

@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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ public void setView(View view, Bundle savedInstanceState){
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);
Expand Down

0 comments on commit e0ff1f6

Please sign in to comment.