From 20fd477952c856ec9b7d65e2cbff4bab1bbb774d Mon Sep 17 00:00:00 2001 From: tateisu Date: Thu, 30 Nov 2017 23:44:22 +0900 Subject: [PATCH] =?UTF-8?q?v1.7.3:=20=E3=83=9E=E3=82=B9=E3=83=88=E3=83=89?= =?UTF-8?q?=E3=83=B3=E9=96=8B=E7=99=BA=E7=89=88=E3=81=AE=E4=BA=92=E6=8F=9B?= =?UTF-8?q?=E6=80=A7=E3=81=AE=E3=81=AA=E3=81=84=E5=A4=89=E6=9B=B4=E3=81=B8?= =?UTF-8?q?=E3=81=AE=E5=AF=BE=E5=BF=9C=20https://github.com/tootsuite/mast?= =?UTF-8?q?odon/issues/5856?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/misc.xml | 2 +- .../api/entity/TootRelationShip.java | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 635999df..ba7052b8 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -24,7 +24,7 @@ - + diff --git a/app/src/main/java/jp/juggler/subwaytooter/api/entity/TootRelationShip.java b/app/src/main/java/jp/juggler/subwaytooter/api/entity/TootRelationShip.java index a6fafa9e..496d7b81 100644 --- a/app/src/main/java/jp/juggler/subwaytooter/api/entity/TootRelationShip.java +++ b/app/src/main/java/jp/juggler/subwaytooter/api/entity/TootRelationShip.java @@ -65,7 +65,22 @@ public class TootRelationShip { try{ TootRelationShip dst = new TootRelationShip(); dst.id = Utils.optLongX(src, "id" ); - dst.following = src.optBoolean( "following" ); + + Object ov = src.opt("following"); + if( ov instanceof Boolean ){ + // 2.0 まで : following はboolean + dst.following = (Boolean) ov; + }else if( ov instanceof JSONObject ){ + // https://github.com/tootsuite/mastodon/issues/5856 + // issueに上げられたコミット: object ? + dst.following = true; + + // TODO: 2.1リリース後に reblogs: true , false に対応する + }else{ + dst.following = false; + log.d("'following' is not boolean ,not object."); + } + dst.followed_by = src.optBoolean( "followed_by" ); dst.blocking = src.optBoolean( "blocking" ); dst.muting = src.optBoolean( "muting" ); @@ -79,6 +94,7 @@ public class TootRelationShip { } + public static class List extends ArrayList< TootRelationShip > { public List(){ super();