Improve activity for bookmarks

This commit is contained in:
tom79 2019-11-15 16:42:10 +01:00
parent d70e9b07b7
commit b6e22b013a
2 changed files with 1 additions and 44 deletions

View File

@ -270,51 +270,7 @@ public class PixelfedAPI {
return pixelFedStoryItem;
}
/**
* Retrieves Pixelfed Own Stories *synchronously*
*
* @return APIResponse
*/
public APIResponse getMyStories() {
try {
HttpsConnection httpsConnection = new HttpsConnection(context, this.instance);
String response = httpsConnection.get(getAbsoluteUrl("/me"), 10, null, prefKeyOauthTokenT);
apiResponse.setSince_id(httpsConnection.getSince_id());
apiResponse.setMax_id(httpsConnection.getMax_id());
pixelFedStory = parseStory(new JSONObject(response));
} catch (HttpsConnection.HttpsConnectionException e) {
setError(e.getStatusCode(), e);
} catch (NoSuchAlgorithmException | IOException | KeyManagementException | JSONException e) {
e.printStackTrace();
}
if (apiResponse == null)
apiResponse = new APIResponse();
apiResponse.setPixelFedStory(pixelFedStory);
return apiResponse;
}
/**
* Delete a Pixelfed Story *synchronously*
*
* @return APIResponse
*/
public int deleteStory(String id) {
HashMap<String, String> params = new HashMap<>();
params.put("id", id);
HttpsConnection httpsConnection;
try {
httpsConnection = new HttpsConnection(context, this.instance);
httpsConnection.delete(getAbsoluteUrl("/delete"), 10, params, prefKeyOauthTokenT);
actionCode = httpsConnection.getActionCode();
} catch (HttpsConnection.HttpsConnectionException e) {
setError(e.getStatusCode(), e);
} catch (NoSuchAlgorithmException | IOException | KeyManagementException e) {
e.printStackTrace();
}
return actionCode;
}
/**
* Set the error message

View File

@ -86,6 +86,7 @@
<string name="live_notif">Live notifications</string>
<!-- Status -->
<string name="no_status">No toot to display</string>
<string name="no_stories">No stories to display</string>
<string name="reblog_by">Boosted by %1$s</string>