v1.7.3: マストドン開発版の互換性のない変更への対応 https://github.com/tootsuite/mastodon/issues/5856

This commit is contained in:
tateisu 2017-11-30 23:44:22 +09:00
parent 4db77eaf14
commit 20fd477952
2 changed files with 18 additions and 2 deletions

View File

@ -24,7 +24,7 @@
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

View File

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