Merge pull request 'Fix parsing posts and userdata: admin flag removed in recent versions of Lemmy' (#190) from otaconix/Eternity:fix-for-missing-admin-flag into master

Reviewed-on: https://codeberg.org/Bazsalanszky/Eternity/pulls/190
Reviewed-by: Bazsalanszky <bazsalanszky@noreply.codeberg.org>
This commit is contained in:
Bazsalanszky 2023-10-06 06:01:11 +00:00
commit f2b2525823
2 changed files with 2 additions and 2 deletions

View File

@ -188,7 +188,7 @@ public class ParsePost {
boolean nsfw = post.getBoolean("nsfw");
boolean locked = post.getBoolean("locked");
boolean saved = data.getBoolean("saved");
String distinguished = (creator.getBoolean("admin") ? "admin" : "");
String distinguished = creator.optBoolean("admin") ? "admin" : "";
String suggestedSort = "";
ArrayList<Post.Preview> previews = new ArrayList<>();
if (!post.isNull("thumbnail_url")) {

View File

@ -48,7 +48,7 @@ public class ParseUserData {
boolean isBot = personJson.getBoolean("bot_account");
boolean isBanned = personJson.getBoolean("banned");
boolean isLocal = personJson.getBoolean("local");
boolean isAdmin = personJson.getBoolean("admin");
boolean isAdmin = personJson.optBoolean("admin");
boolean isDeleted = personJson.getBoolean("deleted");
String description = "";