Using nodeinfo feature list for API detection
This commit is contained in:
parent
cf05b8af87
commit
673234beee
|
@ -228,6 +228,17 @@ public class API {
|
|||
JSONObject resobj = new JSONObject(response);
|
||||
JSONObject jsonObject = resobj.getJSONObject("software");
|
||||
String name = jsonObject.getString("name").toUpperCase();
|
||||
|
||||
if( resobj.has("features") ) {
|
||||
JSONArray features = resobj.getJSONArray("features");
|
||||
for( int counter = 0; counter < features.length(); counter++ ) {
|
||||
if( features.getString(counter).toUpperCase().equals("MASTODON_API") ) {
|
||||
name = "MASTODON";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( jsonObject.getString("name") != null ){
|
||||
switch (jsonObject.getString("name").toUpperCase()){
|
||||
case "PLEROMA":
|
||||
|
|
Loading…
Reference in New Issue