2019-06-03 23:25:05 +02:00
|
|
|
package org.mian.gitnex.actions;
|
|
|
|
|
|
|
|
import android.content.Context;
|
2020-04-30 12:42:22 +02:00
|
|
|
import androidx.annotation.NonNull;
|
2019-06-03 23:25:05 +02:00
|
|
|
import com.google.gson.JsonElement;
|
2021-02-11 11:23:35 +01:00
|
|
|
import org.gitnex.tea4j.models.IssueComments;
|
|
|
|
import org.gitnex.tea4j.models.Issues;
|
|
|
|
import org.gitnex.tea4j.models.UpdateIssueState;
|
2019-06-03 23:25:05 +02:00
|
|
|
import org.mian.gitnex.R;
|
Don't use TinyDB as cache (#1034)
Do not use TinyDB as a cache or a way to send data between activities.
### How is this working
Instead of saving everything into the TinyDB, I created three `Context`s (a `RepositoryContext`, an `IssueContext` and an `AccountContext`). All are used to store things like API or database values/models and additional data, e.g. the `RepositoryContext` also contains information about the current filter state of a repository (issues, pull requests, releases/tags and milestones). These are sent using `Intent`s and `Bundle`s between activities and fragments. Changing a field (e.g. filter state) in any fragment changes it also for the whole repository (or at least it should do so).
Due to the size of the changes (after https://codeberg.org/gitnex/GitNex/commit/c9172f85efafd9f25739fdd8385e1904b711ea41, Git says `154 files changed, 3318 insertions(+), 3835 deletions(-)`) **I highly recommend you to create a beta/pre release before releasing a stable version**.
Additional changes:
* after logging out, the account remains in the account list (with a note) and you can log in again (you can't switch to this account)
* repositories and organizations are clickable on user profiles
* deleted two unused classes
Once finished, hopefully
* closes #354
* replaces #897
* fixes #947
* closes #1001
* closes #1015
* marks #876 and #578 as `Wontfix` since they are not necessary at this point
* and all the other TinyDB issues
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1034
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-03-13 03:59:13 +01:00
|
|
|
import org.mian.gitnex.activities.BaseActivity;
|
|
|
|
import org.mian.gitnex.activities.IssueDetailActivity;
|
2019-06-03 23:25:05 +02:00
|
|
|
import org.mian.gitnex.clients.RetrofitClient;
|
Don't use TinyDB as cache (#1034)
Do not use TinyDB as a cache or a way to send data between activities.
### How is this working
Instead of saving everything into the TinyDB, I created three `Context`s (a `RepositoryContext`, an `IssueContext` and an `AccountContext`). All are used to store things like API or database values/models and additional data, e.g. the `RepositoryContext` also contains information about the current filter state of a repository (issues, pull requests, releases/tags and milestones). These are sent using `Intent`s and `Bundle`s between activities and fragments. Changing a field (e.g. filter state) in any fragment changes it also for the whole repository (or at least it should do so).
Due to the size of the changes (after https://codeberg.org/gitnex/GitNex/commit/c9172f85efafd9f25739fdd8385e1904b711ea41, Git says `154 files changed, 3318 insertions(+), 3835 deletions(-)`) **I highly recommend you to create a beta/pre release before releasing a stable version**.
Additional changes:
* after logging out, the account remains in the account list (with a note) and you can log in again (you can't switch to this account)
* repositories and organizations are clickable on user profiles
* deleted two unused classes
Once finished, hopefully
* closes #354
* replaces #897
* fixes #947
* closes #1001
* closes #1015
* marks #876 and #578 as `Wontfix` since they are not necessary at this point
* and all the other TinyDB issues
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1034
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-03-13 03:59:13 +01:00
|
|
|
import org.mian.gitnex.fragments.IssuesFragment;
|
|
|
|
import org.mian.gitnex.fragments.PullRequestsFragment;
|
2019-06-03 23:25:05 +02:00
|
|
|
import org.mian.gitnex.helpers.AlertDialogs;
|
|
|
|
import org.mian.gitnex.helpers.Toasty;
|
Don't use TinyDB as cache (#1034)
Do not use TinyDB as a cache or a way to send data between activities.
### How is this working
Instead of saving everything into the TinyDB, I created three `Context`s (a `RepositoryContext`, an `IssueContext` and an `AccountContext`). All are used to store things like API or database values/models and additional data, e.g. the `RepositoryContext` also contains information about the current filter state of a repository (issues, pull requests, releases/tags and milestones). These are sent using `Intent`s and `Bundle`s between activities and fragments. Changing a field (e.g. filter state) in any fragment changes it also for the whole repository (or at least it should do so).
Due to the size of the changes (after https://codeberg.org/gitnex/GitNex/commit/c9172f85efafd9f25739fdd8385e1904b711ea41, Git says `154 files changed, 3318 insertions(+), 3835 deletions(-)`) **I highly recommend you to create a beta/pre release before releasing a stable version**.
Additional changes:
* after logging out, the account remains in the account list (with a note) and you can log in again (you can't switch to this account)
* repositories and organizations are clickable on user profiles
* deleted two unused classes
Once finished, hopefully
* closes #354
* replaces #897
* fixes #947
* closes #1001
* closes #1015
* marks #876 and #578 as `Wontfix` since they are not necessary at this point
* and all the other TinyDB issues
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1034
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-03-13 03:59:13 +01:00
|
|
|
import org.mian.gitnex.helpers.contexts.IssueContext;
|
2019-06-03 23:25:05 +02:00
|
|
|
import retrofit2.Call;
|
|
|
|
import retrofit2.Callback;
|
2020-11-02 16:17:00 +01:00
|
|
|
import retrofit2.Response;
|
2019-06-03 23:25:05 +02:00
|
|
|
|
|
|
|
/**
|
2022-04-06 17:27:02 +02:00
|
|
|
* @author M M Arif
|
2019-06-03 23:25:05 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
public class IssueActions {
|
|
|
|
|
Don't use TinyDB as cache (#1034)
Do not use TinyDB as a cache or a way to send data between activities.
### How is this working
Instead of saving everything into the TinyDB, I created three `Context`s (a `RepositoryContext`, an `IssueContext` and an `AccountContext`). All are used to store things like API or database values/models and additional data, e.g. the `RepositoryContext` also contains information about the current filter state of a repository (issues, pull requests, releases/tags and milestones). These are sent using `Intent`s and `Bundle`s between activities and fragments. Changing a field (e.g. filter state) in any fragment changes it also for the whole repository (or at least it should do so).
Due to the size of the changes (after https://codeberg.org/gitnex/GitNex/commit/c9172f85efafd9f25739fdd8385e1904b711ea41, Git says `154 files changed, 3318 insertions(+), 3835 deletions(-)`) **I highly recommend you to create a beta/pre release before releasing a stable version**.
Additional changes:
* after logging out, the account remains in the account list (with a note) and you can log in again (you can't switch to this account)
* repositories and organizations are clickable on user profiles
* deleted two unused classes
Once finished, hopefully
* closes #354
* replaces #897
* fixes #947
* closes #1001
* closes #1015
* marks #876 and #578 as `Wontfix` since they are not necessary at this point
* and all the other TinyDB issues
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1034
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-03-13 03:59:13 +01:00
|
|
|
public static ActionResult<Response<?>> edit(Context context, String comment, int commentId, IssueContext issue) {
|
2020-11-02 16:17:00 +01:00
|
|
|
|
|
|
|
ActionResult<Response<?>> actionResult = new ActionResult<>();
|
|
|
|
|
|
|
|
Call<IssueComments> call = RetrofitClient
|
|
|
|
.getApiInterface(context)
|
Don't use TinyDB as cache (#1034)
Do not use TinyDB as a cache or a way to send data between activities.
### How is this working
Instead of saving everything into the TinyDB, I created three `Context`s (a `RepositoryContext`, an `IssueContext` and an `AccountContext`). All are used to store things like API or database values/models and additional data, e.g. the `RepositoryContext` also contains information about the current filter state of a repository (issues, pull requests, releases/tags and milestones). These are sent using `Intent`s and `Bundle`s between activities and fragments. Changing a field (e.g. filter state) in any fragment changes it also for the whole repository (or at least it should do so).
Due to the size of the changes (after https://codeberg.org/gitnex/GitNex/commit/c9172f85efafd9f25739fdd8385e1904b711ea41, Git says `154 files changed, 3318 insertions(+), 3835 deletions(-)`) **I highly recommend you to create a beta/pre release before releasing a stable version**.
Additional changes:
* after logging out, the account remains in the account list (with a note) and you can log in again (you can't switch to this account)
* repositories and organizations are clickable on user profiles
* deleted two unused classes
Once finished, hopefully
* closes #354
* replaces #897
* fixes #947
* closes #1001
* closes #1015
* marks #876 and #578 as `Wontfix` since they are not necessary at this point
* and all the other TinyDB issues
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1034
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-03-13 03:59:13 +01:00
|
|
|
.patchIssueComment(((BaseActivity) context).getAccount().getAuthorization(), issue.getRepository().getOwner(),
|
|
|
|
issue.getRepository().getName(), commentId, new IssueComments(comment));
|
2020-04-30 12:42:22 +02:00
|
|
|
|
2022-04-06 17:27:02 +02:00
|
|
|
call.enqueue(new Callback<>() {
|
2019-06-03 23:25:05 +02:00
|
|
|
|
2020-04-30 12:42:22 +02:00
|
|
|
@Override
|
|
|
|
public void onResponse(@NonNull Call<IssueComments> call, @NonNull retrofit2.Response<IssueComments> response) {
|
2019-06-03 23:25:05 +02:00
|
|
|
|
2020-11-02 16:17:00 +01:00
|
|
|
switch(response.code()) {
|
2019-06-03 23:25:05 +02:00
|
|
|
|
2020-11-02 16:17:00 +01:00
|
|
|
case 200:
|
|
|
|
actionResult.finish(ActionResult.Status.SUCCESS);
|
|
|
|
break;
|
2019-06-03 23:25:05 +02:00
|
|
|
|
2020-11-02 16:17:00 +01:00
|
|
|
case 401:
|
|
|
|
actionResult.finish(ActionResult.Status.FAILED, response);
|
2022-04-06 17:27:02 +02:00
|
|
|
AlertDialogs.authorizationTokenRevokedDialog(context, context.getResources().getString(R.string.alertDialogTokenRevokedTitle),
|
|
|
|
context.getResources().getString(R.string.alertDialogTokenRevokedMessage),
|
Don't use TinyDB as cache (#1034)
Do not use TinyDB as a cache or a way to send data between activities.
### How is this working
Instead of saving everything into the TinyDB, I created three `Context`s (a `RepositoryContext`, an `IssueContext` and an `AccountContext`). All are used to store things like API or database values/models and additional data, e.g. the `RepositoryContext` also contains information about the current filter state of a repository (issues, pull requests, releases/tags and milestones). These are sent using `Intent`s and `Bundle`s between activities and fragments. Changing a field (e.g. filter state) in any fragment changes it also for the whole repository (or at least it should do so).
Due to the size of the changes (after https://codeberg.org/gitnex/GitNex/commit/c9172f85efafd9f25739fdd8385e1904b711ea41, Git says `154 files changed, 3318 insertions(+), 3835 deletions(-)`) **I highly recommend you to create a beta/pre release before releasing a stable version**.
Additional changes:
* after logging out, the account remains in the account list (with a note) and you can log in again (you can't switch to this account)
* repositories and organizations are clickable on user profiles
* deleted two unused classes
Once finished, hopefully
* closes #354
* replaces #897
* fixes #947
* closes #1001
* closes #1015
* marks #876 and #578 as `Wontfix` since they are not necessary at this point
* and all the other TinyDB issues
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1034
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-03-13 03:59:13 +01:00
|
|
|
context.getResources().getString(R.string.cancelButton), context.getResources().getString(R.string.navLogout));
|
2020-11-02 16:17:00 +01:00
|
|
|
break;
|
2019-06-03 23:25:05 +02:00
|
|
|
|
2020-11-02 16:17:00 +01:00
|
|
|
default:
|
|
|
|
actionResult.finish(ActionResult.Status.FAILED, response);
|
|
|
|
break;
|
2019-06-03 23:25:05 +02:00
|
|
|
|
2020-04-30 12:42:22 +02:00
|
|
|
}
|
|
|
|
}
|
2019-06-03 23:25:05 +02:00
|
|
|
|
2020-04-30 12:42:22 +02:00
|
|
|
@Override
|
|
|
|
public void onFailure(@NonNull Call<IssueComments> call, @NonNull Throwable t) {
|
2019-06-03 23:25:05 +02:00
|
|
|
|
2020-11-02 16:17:00 +01:00
|
|
|
actionResult.finish(ActionResult.Status.FAILED);
|
2020-04-30 12:42:22 +02:00
|
|
|
}
|
|
|
|
});
|
2019-06-03 23:25:05 +02:00
|
|
|
|
2020-11-02 16:17:00 +01:00
|
|
|
return actionResult;
|
|
|
|
|
2020-04-30 12:42:22 +02:00
|
|
|
}
|
2019-06-03 23:25:05 +02:00
|
|
|
|
Don't use TinyDB as cache (#1034)
Do not use TinyDB as a cache or a way to send data between activities.
### How is this working
Instead of saving everything into the TinyDB, I created three `Context`s (a `RepositoryContext`, an `IssueContext` and an `AccountContext`). All are used to store things like API or database values/models and additional data, e.g. the `RepositoryContext` also contains information about the current filter state of a repository (issues, pull requests, releases/tags and milestones). These are sent using `Intent`s and `Bundle`s between activities and fragments. Changing a field (e.g. filter state) in any fragment changes it also for the whole repository (or at least it should do so).
Due to the size of the changes (after https://codeberg.org/gitnex/GitNex/commit/c9172f85efafd9f25739fdd8385e1904b711ea41, Git says `154 files changed, 3318 insertions(+), 3835 deletions(-)`) **I highly recommend you to create a beta/pre release before releasing a stable version**.
Additional changes:
* after logging out, the account remains in the account list (with a note) and you can log in again (you can't switch to this account)
* repositories and organizations are clickable on user profiles
* deleted two unused classes
Once finished, hopefully
* closes #354
* replaces #897
* fixes #947
* closes #1001
* closes #1015
* marks #876 and #578 as `Wontfix` since they are not necessary at this point
* and all the other TinyDB issues
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1034
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-03-13 03:59:13 +01:00
|
|
|
public static void closeReopenIssue(final Context ctx, final String issueState, IssueContext issue) {
|
2019-06-03 23:25:05 +02:00
|
|
|
|
2020-04-30 12:42:22 +02:00
|
|
|
UpdateIssueState issueStatJson = new UpdateIssueState(issueState);
|
|
|
|
Call<JsonElement> call;
|
2019-06-03 23:25:05 +02:00
|
|
|
|
2020-11-02 16:17:00 +01:00
|
|
|
call = RetrofitClient
|
|
|
|
.getApiInterface(ctx)
|
Don't use TinyDB as cache (#1034)
Do not use TinyDB as a cache or a way to send data between activities.
### How is this working
Instead of saving everything into the TinyDB, I created three `Context`s (a `RepositoryContext`, an `IssueContext` and an `AccountContext`). All are used to store things like API or database values/models and additional data, e.g. the `RepositoryContext` also contains information about the current filter state of a repository (issues, pull requests, releases/tags and milestones). These are sent using `Intent`s and `Bundle`s between activities and fragments. Changing a field (e.g. filter state) in any fragment changes it also for the whole repository (or at least it should do so).
Due to the size of the changes (after https://codeberg.org/gitnex/GitNex/commit/c9172f85efafd9f25739fdd8385e1904b711ea41, Git says `154 files changed, 3318 insertions(+), 3835 deletions(-)`) **I highly recommend you to create a beta/pre release before releasing a stable version**.
Additional changes:
* after logging out, the account remains in the account list (with a note) and you can log in again (you can't switch to this account)
* repositories and organizations are clickable on user profiles
* deleted two unused classes
Once finished, hopefully
* closes #354
* replaces #897
* fixes #947
* closes #1001
* closes #1015
* marks #876 and #578 as `Wontfix` since they are not necessary at this point
* and all the other TinyDB issues
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1034
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-03-13 03:59:13 +01:00
|
|
|
.closeReopenIssue(((BaseActivity) ctx).getAccount().getAuthorization(), issue.getRepository().getOwner(),
|
|
|
|
issue.getRepository().getName(), issue.getIssueIndex(), issueStatJson);
|
2019-06-03 23:25:05 +02:00
|
|
|
|
2022-04-06 17:27:02 +02:00
|
|
|
call.enqueue(new Callback<>() {
|
2019-06-03 23:25:05 +02:00
|
|
|
|
2020-04-30 12:42:22 +02:00
|
|
|
@Override
|
|
|
|
public void onResponse(@NonNull Call<JsonElement> call, @NonNull retrofit2.Response<JsonElement> response) {
|
2019-06-03 23:25:05 +02:00
|
|
|
|
2020-04-30 12:42:22 +02:00
|
|
|
if(response.isSuccessful()) {
|
|
|
|
if(response.code() == 201) {
|
2019-06-03 23:25:05 +02:00
|
|
|
|
2022-04-06 17:27:02 +02:00
|
|
|
if(issue.hasIssue()) {
|
Don't use TinyDB as cache (#1034)
Do not use TinyDB as a cache or a way to send data between activities.
### How is this working
Instead of saving everything into the TinyDB, I created three `Context`s (a `RepositoryContext`, an `IssueContext` and an `AccountContext`). All are used to store things like API or database values/models and additional data, e.g. the `RepositoryContext` also contains information about the current filter state of a repository (issues, pull requests, releases/tags and milestones). These are sent using `Intent`s and `Bundle`s between activities and fragments. Changing a field (e.g. filter state) in any fragment changes it also for the whole repository (or at least it should do so).
Due to the size of the changes (after https://codeberg.org/gitnex/GitNex/commit/c9172f85efafd9f25739fdd8385e1904b711ea41, Git says `154 files changed, 3318 insertions(+), 3835 deletions(-)`) **I highly recommend you to create a beta/pre release before releasing a stable version**.
Additional changes:
* after logging out, the account remains in the account list (with a note) and you can log in again (you can't switch to this account)
* repositories and organizations are clickable on user profiles
* deleted two unused classes
Once finished, hopefully
* closes #354
* replaces #897
* fixes #947
* closes #1001
* closes #1015
* marks #876 and #578 as `Wontfix` since they are not necessary at this point
* and all the other TinyDB issues
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1034
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-03-13 03:59:13 +01:00
|
|
|
IssuesFragment.resumeIssues = issue.getIssue().getPull_request() == null;
|
|
|
|
PullRequestsFragment.resumePullRequests = issue.getIssue().getPull_request() != null;
|
|
|
|
}
|
2020-04-30 12:42:22 +02:00
|
|
|
if(issueState.equals("closed")) {
|
2020-08-06 17:16:51 +02:00
|
|
|
Toasty.success(ctx, ctx.getString(R.string.issueStateClosed));
|
2020-04-30 12:42:22 +02:00
|
|
|
}
|
|
|
|
else if(issueState.equals("open")) {
|
2020-08-06 17:16:51 +02:00
|
|
|
Toasty.success(ctx, ctx.getString(R.string.issueStateReopened));
|
2020-04-30 12:42:22 +02:00
|
|
|
}
|
2020-04-18 16:29:42 +02:00
|
|
|
|
Don't use TinyDB as cache (#1034)
Do not use TinyDB as a cache or a way to send data between activities.
### How is this working
Instead of saving everything into the TinyDB, I created three `Context`s (a `RepositoryContext`, an `IssueContext` and an `AccountContext`). All are used to store things like API or database values/models and additional data, e.g. the `RepositoryContext` also contains information about the current filter state of a repository (issues, pull requests, releases/tags and milestones). These are sent using `Intent`s and `Bundle`s between activities and fragments. Changing a field (e.g. filter state) in any fragment changes it also for the whole repository (or at least it should do so).
Due to the size of the changes (after https://codeberg.org/gitnex/GitNex/commit/c9172f85efafd9f25739fdd8385e1904b711ea41, Git says `154 files changed, 3318 insertions(+), 3835 deletions(-)`) **I highly recommend you to create a beta/pre release before releasing a stable version**.
Additional changes:
* after logging out, the account remains in the account list (with a note) and you can log in again (you can't switch to this account)
* repositories and organizations are clickable on user profiles
* deleted two unused classes
Once finished, hopefully
* closes #354
* replaces #897
* fixes #947
* closes #1001
* closes #1015
* marks #876 and #578 as `Wontfix` since they are not necessary at this point
* and all the other TinyDB issues
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1034
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-03-13 03:59:13 +01:00
|
|
|
((IssueDetailActivity) ctx).singleIssueUpdate = true;
|
|
|
|
((IssueDetailActivity) ctx).onResume();
|
2020-04-30 12:42:22 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(response.code() == 401) {
|
2020-04-18 16:29:42 +02:00
|
|
|
|
2022-04-06 17:27:02 +02:00
|
|
|
AlertDialogs.authorizationTokenRevokedDialog(ctx, ctx.getResources().getString(R.string.alertDialogTokenRevokedTitle),
|
|
|
|
ctx.getResources().getString(R.string.alertDialogTokenRevokedMessage), ctx.getResources().getString(R.string.cancelButton),
|
|
|
|
ctx.getResources().getString(R.string.navLogout));
|
2020-04-30 12:42:22 +02:00
|
|
|
}
|
|
|
|
else if(response.code() == 403) {
|
2019-06-03 23:25:05 +02:00
|
|
|
|
2020-08-06 17:16:51 +02:00
|
|
|
Toasty.error(ctx, ctx.getString(R.string.authorizeError));
|
2020-04-30 12:42:22 +02:00
|
|
|
}
|
|
|
|
else if(response.code() == 404) {
|
2019-06-03 23:25:05 +02:00
|
|
|
|
2020-08-06 17:16:51 +02:00
|
|
|
Toasty.warning(ctx, ctx.getString(R.string.apiNotFound));
|
2020-04-30 12:42:22 +02:00
|
|
|
}
|
|
|
|
else {
|
2019-06-03 23:25:05 +02:00
|
|
|
|
2020-08-06 17:16:51 +02:00
|
|
|
Toasty.error(ctx, ctx.getString(R.string.genericError));
|
2020-04-30 12:42:22 +02:00
|
|
|
}
|
|
|
|
}
|
2019-06-03 23:25:05 +02:00
|
|
|
|
2020-04-30 12:42:22 +02:00
|
|
|
@Override
|
|
|
|
public void onFailure(@NonNull Call<JsonElement> call, @NonNull Throwable t) {
|
2019-06-03 23:25:05 +02:00
|
|
|
|
2020-10-12 20:11:23 +02:00
|
|
|
Toasty.error(ctx, ctx.getResources().getString(R.string.genericServerResponseError));
|
2020-04-30 12:42:22 +02:00
|
|
|
}
|
|
|
|
});
|
2019-06-03 23:25:05 +02:00
|
|
|
|
2020-04-30 12:42:22 +02:00
|
|
|
}
|
2019-06-03 23:25:05 +02:00
|
|
|
|
Don't use TinyDB as cache (#1034)
Do not use TinyDB as a cache or a way to send data between activities.
### How is this working
Instead of saving everything into the TinyDB, I created three `Context`s (a `RepositoryContext`, an `IssueContext` and an `AccountContext`). All are used to store things like API or database values/models and additional data, e.g. the `RepositoryContext` also contains information about the current filter state of a repository (issues, pull requests, releases/tags and milestones). These are sent using `Intent`s and `Bundle`s between activities and fragments. Changing a field (e.g. filter state) in any fragment changes it also for the whole repository (or at least it should do so).
Due to the size of the changes (after https://codeberg.org/gitnex/GitNex/commit/c9172f85efafd9f25739fdd8385e1904b711ea41, Git says `154 files changed, 3318 insertions(+), 3835 deletions(-)`) **I highly recommend you to create a beta/pre release before releasing a stable version**.
Additional changes:
* after logging out, the account remains in the account list (with a note) and you can log in again (you can't switch to this account)
* repositories and organizations are clickable on user profiles
* deleted two unused classes
Once finished, hopefully
* closes #354
* replaces #897
* fixes #947
* closes #1001
* closes #1015
* marks #876 and #578 as `Wontfix` since they are not necessary at this point
* and all the other TinyDB issues
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1034
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-03-13 03:59:13 +01:00
|
|
|
public static void subscribe(final Context ctx, IssueContext issue) {
|
2020-04-05 11:54:34 +02:00
|
|
|
|
2020-04-30 12:42:22 +02:00
|
|
|
Call<Void> call;
|
2020-04-05 11:54:34 +02:00
|
|
|
|
2020-11-02 16:17:00 +01:00
|
|
|
call = RetrofitClient
|
|
|
|
.getApiInterface(ctx)
|
Don't use TinyDB as cache (#1034)
Do not use TinyDB as a cache or a way to send data between activities.
### How is this working
Instead of saving everything into the TinyDB, I created three `Context`s (a `RepositoryContext`, an `IssueContext` and an `AccountContext`). All are used to store things like API or database values/models and additional data, e.g. the `RepositoryContext` also contains information about the current filter state of a repository (issues, pull requests, releases/tags and milestones). These are sent using `Intent`s and `Bundle`s between activities and fragments. Changing a field (e.g. filter state) in any fragment changes it also for the whole repository (or at least it should do so).
Due to the size of the changes (after https://codeberg.org/gitnex/GitNex/commit/c9172f85efafd9f25739fdd8385e1904b711ea41, Git says `154 files changed, 3318 insertions(+), 3835 deletions(-)`) **I highly recommend you to create a beta/pre release before releasing a stable version**.
Additional changes:
* after logging out, the account remains in the account list (with a note) and you can log in again (you can't switch to this account)
* repositories and organizations are clickable on user profiles
* deleted two unused classes
Once finished, hopefully
* closes #354
* replaces #897
* fixes #947
* closes #1001
* closes #1015
* marks #876 and #578 as `Wontfix` since they are not necessary at this point
* and all the other TinyDB issues
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1034
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-03-13 03:59:13 +01:00
|
|
|
.addIssueSubscriber(((BaseActivity) ctx).getAccount().getAuthorization(), issue.getRepository().getOwner(),
|
|
|
|
issue.getRepository().getName(), issue.getIssueIndex(), ((BaseActivity) ctx).getAccount().getAccount().getUserName());
|
2020-04-05 11:54:34 +02:00
|
|
|
|
2022-04-06 17:27:02 +02:00
|
|
|
call.enqueue(new Callback<>() {
|
2020-04-05 11:54:34 +02:00
|
|
|
|
2020-04-30 12:42:22 +02:00
|
|
|
@Override
|
|
|
|
public void onResponse(@NonNull Call<Void> call, @NonNull retrofit2.Response<Void> response) {
|
2020-04-05 11:54:34 +02:00
|
|
|
|
2020-04-30 12:42:22 +02:00
|
|
|
if(response.isSuccessful()) {
|
2020-04-05 11:54:34 +02:00
|
|
|
|
2020-04-30 12:42:22 +02:00
|
|
|
if(response.code() == 201) {
|
2020-04-05 11:54:34 +02:00
|
|
|
|
2020-08-06 17:16:51 +02:00
|
|
|
Toasty.success(ctx, ctx.getString(R.string.subscribedSuccessfully));
|
2020-05-21 20:58:00 +02:00
|
|
|
}
|
|
|
|
else if(response.code() == 200) {
|
|
|
|
|
2020-08-06 17:16:51 +02:00
|
|
|
Toasty.success(ctx, ctx.getString(R.string.alreadySubscribed));
|
2020-04-30 12:42:22 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(response.code() == 401) {
|
2020-04-18 16:29:42 +02:00
|
|
|
|
2021-12-15 20:37:53 +01:00
|
|
|
AlertDialogs.authorizationTokenRevokedDialog(ctx, ctx.getResources().getString(R.string.alertDialogTokenRevokedTitle), ctx.getResources().getString(R.string.alertDialogTokenRevokedMessage), ctx.getResources().getString(R.string.cancelButton), ctx.getResources().getString(R.string.navLogout));
|
2020-04-30 12:42:22 +02:00
|
|
|
}
|
|
|
|
else {
|
2020-04-05 11:54:34 +02:00
|
|
|
|
2020-08-06 17:16:51 +02:00
|
|
|
Toasty.error(ctx, ctx.getString(R.string.subscriptionError));
|
2020-04-30 12:42:22 +02:00
|
|
|
}
|
|
|
|
}
|
2020-04-05 11:54:34 +02:00
|
|
|
|
2020-04-30 12:42:22 +02:00
|
|
|
@Override
|
|
|
|
public void onFailure(@NonNull Call<Void> call, @NonNull Throwable t) {
|
2020-04-05 11:54:34 +02:00
|
|
|
|
2020-10-12 20:11:23 +02:00
|
|
|
Toasty.error(ctx, ctx.getResources().getString(R.string.genericServerResponseError));
|
2020-04-30 12:42:22 +02:00
|
|
|
}
|
|
|
|
});
|
2020-04-05 11:54:34 +02:00
|
|
|
|
2020-04-30 12:42:22 +02:00
|
|
|
}
|
2020-04-05 11:54:34 +02:00
|
|
|
|
Don't use TinyDB as cache (#1034)
Do not use TinyDB as a cache or a way to send data between activities.
### How is this working
Instead of saving everything into the TinyDB, I created three `Context`s (a `RepositoryContext`, an `IssueContext` and an `AccountContext`). All are used to store things like API or database values/models and additional data, e.g. the `RepositoryContext` also contains information about the current filter state of a repository (issues, pull requests, releases/tags and milestones). These are sent using `Intent`s and `Bundle`s between activities and fragments. Changing a field (e.g. filter state) in any fragment changes it also for the whole repository (or at least it should do so).
Due to the size of the changes (after https://codeberg.org/gitnex/GitNex/commit/c9172f85efafd9f25739fdd8385e1904b711ea41, Git says `154 files changed, 3318 insertions(+), 3835 deletions(-)`) **I highly recommend you to create a beta/pre release before releasing a stable version**.
Additional changes:
* after logging out, the account remains in the account list (with a note) and you can log in again (you can't switch to this account)
* repositories and organizations are clickable on user profiles
* deleted two unused classes
Once finished, hopefully
* closes #354
* replaces #897
* fixes #947
* closes #1001
* closes #1015
* marks #876 and #578 as `Wontfix` since they are not necessary at this point
* and all the other TinyDB issues
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1034
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-03-13 03:59:13 +01:00
|
|
|
public static void unsubscribe(final Context ctx, IssueContext issue) {
|
2020-04-05 11:54:34 +02:00
|
|
|
|
2020-04-30 12:42:22 +02:00
|
|
|
Call<Void> call;
|
2020-04-05 11:54:34 +02:00
|
|
|
|
Don't use TinyDB as cache (#1034)
Do not use TinyDB as a cache or a way to send data between activities.
### How is this working
Instead of saving everything into the TinyDB, I created three `Context`s (a `RepositoryContext`, an `IssueContext` and an `AccountContext`). All are used to store things like API or database values/models and additional data, e.g. the `RepositoryContext` also contains information about the current filter state of a repository (issues, pull requests, releases/tags and milestones). These are sent using `Intent`s and `Bundle`s between activities and fragments. Changing a field (e.g. filter state) in any fragment changes it also for the whole repository (or at least it should do so).
Due to the size of the changes (after https://codeberg.org/gitnex/GitNex/commit/c9172f85efafd9f25739fdd8385e1904b711ea41, Git says `154 files changed, 3318 insertions(+), 3835 deletions(-)`) **I highly recommend you to create a beta/pre release before releasing a stable version**.
Additional changes:
* after logging out, the account remains in the account list (with a note) and you can log in again (you can't switch to this account)
* repositories and organizations are clickable on user profiles
* deleted two unused classes
Once finished, hopefully
* closes #354
* replaces #897
* fixes #947
* closes #1001
* closes #1015
* marks #876 and #578 as `Wontfix` since they are not necessary at this point
* and all the other TinyDB issues
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1034
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-03-13 03:59:13 +01:00
|
|
|
call = RetrofitClient.getApiInterface(ctx).delIssueSubscriber(((BaseActivity) ctx).getAccount().getAuthorization(), issue.getRepository().getOwner(),
|
|
|
|
issue.getRepository().getName(), issue.getIssueIndex(), ((BaseActivity) ctx).getAccount().getAccount().getUserName());
|
2020-04-05 11:54:34 +02:00
|
|
|
|
2022-04-06 17:27:02 +02:00
|
|
|
call.enqueue(new Callback<>() {
|
2020-04-05 11:54:34 +02:00
|
|
|
|
2020-04-30 12:42:22 +02:00
|
|
|
@Override
|
|
|
|
public void onResponse(@NonNull Call<Void> call, @NonNull retrofit2.Response<Void> response) {
|
2020-04-05 11:54:34 +02:00
|
|
|
|
2020-04-30 12:42:22 +02:00
|
|
|
if(response.isSuccessful()) {
|
2020-04-05 11:54:34 +02:00
|
|
|
|
2020-04-30 12:42:22 +02:00
|
|
|
if(response.code() == 201) {
|
2020-04-05 11:54:34 +02:00
|
|
|
|
2020-08-06 17:16:51 +02:00
|
|
|
Toasty.success(ctx, ctx.getString(R.string.unsubscribedSuccessfully));
|
2020-05-21 20:58:00 +02:00
|
|
|
}
|
|
|
|
else if(response.code() == 200) {
|
|
|
|
|
2020-08-06 17:16:51 +02:00
|
|
|
Toasty.success(ctx, ctx.getString(R.string.alreadyUnsubscribed));
|
2020-04-30 12:42:22 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(response.code() == 401) {
|
2020-04-05 11:54:34 +02:00
|
|
|
|
2022-04-06 17:27:02 +02:00
|
|
|
AlertDialogs.authorizationTokenRevokedDialog(ctx, ctx.getResources().getString(R.string.alertDialogTokenRevokedTitle),
|
|
|
|
ctx.getResources().getString(R.string.alertDialogTokenRevokedMessage), ctx.getResources().getString(R.string.cancelButton),
|
|
|
|
ctx.getResources().getString(R.string.navLogout));
|
2020-04-30 12:42:22 +02:00
|
|
|
}
|
|
|
|
else {
|
2020-04-05 11:54:34 +02:00
|
|
|
|
2021-02-13 20:31:38 +01:00
|
|
|
Toasty.error(ctx, ctx.getString(R.string.unSubscriptionError));
|
2020-04-30 12:42:22 +02:00
|
|
|
}
|
|
|
|
}
|
2020-04-05 11:54:34 +02:00
|
|
|
|
2020-04-30 12:42:22 +02:00
|
|
|
@Override
|
|
|
|
public void onFailure(@NonNull Call<Void> call, @NonNull Throwable t) {
|
2020-04-05 11:54:34 +02:00
|
|
|
|
2020-10-12 20:11:23 +02:00
|
|
|
Toasty.error(ctx, ctx.getResources().getString(R.string.genericServerResponseError));
|
2020-04-30 12:42:22 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2020-04-05 11:54:34 +02:00
|
|
|
|
Don't use TinyDB as cache (#1034)
Do not use TinyDB as a cache or a way to send data between activities.
### How is this working
Instead of saving everything into the TinyDB, I created three `Context`s (a `RepositoryContext`, an `IssueContext` and an `AccountContext`). All are used to store things like API or database values/models and additional data, e.g. the `RepositoryContext` also contains information about the current filter state of a repository (issues, pull requests, releases/tags and milestones). These are sent using `Intent`s and `Bundle`s between activities and fragments. Changing a field (e.g. filter state) in any fragment changes it also for the whole repository (or at least it should do so).
Due to the size of the changes (after https://codeberg.org/gitnex/GitNex/commit/c9172f85efafd9f25739fdd8385e1904b711ea41, Git says `154 files changed, 3318 insertions(+), 3835 deletions(-)`) **I highly recommend you to create a beta/pre release before releasing a stable version**.
Additional changes:
* after logging out, the account remains in the account list (with a note) and you can log in again (you can't switch to this account)
* repositories and organizations are clickable on user profiles
* deleted two unused classes
Once finished, hopefully
* closes #354
* replaces #897
* fixes #947
* closes #1001
* closes #1015
* marks #876 and #578 as `Wontfix` since they are not necessary at this point
* and all the other TinyDB issues
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1034
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-03-13 03:59:13 +01:00
|
|
|
public static ActionResult<ActionResult.None> reply(Context context, String comment, IssueContext issue) {
|
2020-10-12 20:11:23 +02:00
|
|
|
|
|
|
|
ActionResult<ActionResult.None> actionResult = new ActionResult<>();
|
|
|
|
|
|
|
|
Issues issueComment = new Issues(comment);
|
|
|
|
|
|
|
|
Call<Issues> call = RetrofitClient
|
2020-11-02 16:17:00 +01:00
|
|
|
.getApiInterface(context)
|
Don't use TinyDB as cache (#1034)
Do not use TinyDB as a cache or a way to send data between activities.
### How is this working
Instead of saving everything into the TinyDB, I created three `Context`s (a `RepositoryContext`, an `IssueContext` and an `AccountContext`). All are used to store things like API or database values/models and additional data, e.g. the `RepositoryContext` also contains information about the current filter state of a repository (issues, pull requests, releases/tags and milestones). These are sent using `Intent`s and `Bundle`s between activities and fragments. Changing a field (e.g. filter state) in any fragment changes it also for the whole repository (or at least it should do so).
Due to the size of the changes (after https://codeberg.org/gitnex/GitNex/commit/c9172f85efafd9f25739fdd8385e1904b711ea41, Git says `154 files changed, 3318 insertions(+), 3835 deletions(-)`) **I highly recommend you to create a beta/pre release before releasing a stable version**.
Additional changes:
* after logging out, the account remains in the account list (with a note) and you can log in again (you can't switch to this account)
* repositories and organizations are clickable on user profiles
* deleted two unused classes
Once finished, hopefully
* closes #354
* replaces #897
* fixes #947
* closes #1001
* closes #1015
* marks #876 and #578 as `Wontfix` since they are not necessary at this point
* and all the other TinyDB issues
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1034
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-03-13 03:59:13 +01:00
|
|
|
.replyCommentToIssue(((BaseActivity) context).getAccount().getAuthorization(), issue.getRepository().getOwner(),
|
|
|
|
issue.getRepository().getName(), issue.getIssueIndex(), issueComment);
|
2020-10-12 20:11:23 +02:00
|
|
|
|
2022-04-06 17:27:02 +02:00
|
|
|
call.enqueue(new Callback<>() {
|
2020-10-12 20:11:23 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onResponse(@NonNull Call<Issues> call, @NonNull retrofit2.Response<Issues> response) {
|
|
|
|
|
|
|
|
if(response.code() == 201) {
|
|
|
|
actionResult.finish(ActionResult.Status.SUCCESS);
|
|
|
|
|
2022-04-06 17:27:02 +02:00
|
|
|
if(issue.hasIssue()) {
|
Don't use TinyDB as cache (#1034)
Do not use TinyDB as a cache or a way to send data between activities.
### How is this working
Instead of saving everything into the TinyDB, I created three `Context`s (a `RepositoryContext`, an `IssueContext` and an `AccountContext`). All are used to store things like API or database values/models and additional data, e.g. the `RepositoryContext` also contains information about the current filter state of a repository (issues, pull requests, releases/tags and milestones). These are sent using `Intent`s and `Bundle`s between activities and fragments. Changing a field (e.g. filter state) in any fragment changes it also for the whole repository (or at least it should do so).
Due to the size of the changes (after https://codeberg.org/gitnex/GitNex/commit/c9172f85efafd9f25739fdd8385e1904b711ea41, Git says `154 files changed, 3318 insertions(+), 3835 deletions(-)`) **I highly recommend you to create a beta/pre release before releasing a stable version**.
Additional changes:
* after logging out, the account remains in the account list (with a note) and you can log in again (you can't switch to this account)
* repositories and organizations are clickable on user profiles
* deleted two unused classes
Once finished, hopefully
* closes #354
* replaces #897
* fixes #947
* closes #1001
* closes #1015
* marks #876 and #578 as `Wontfix` since they are not necessary at this point
* and all the other TinyDB issues
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1034
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-03-13 03:59:13 +01:00
|
|
|
IssuesFragment.resumeIssues = issue.getIssue().getPull_request() == null;
|
|
|
|
PullRequestsFragment.resumePullRequests = issue.getIssue().getPull_request() != null;
|
|
|
|
}
|
2020-10-12 20:11:23 +02:00
|
|
|
}
|
|
|
|
else if(response.code() == 401) {
|
|
|
|
|
|
|
|
AlertDialogs.authorizationTokenRevokedDialog(context, context.getString(R.string.alertDialogTokenRevokedTitle),
|
2022-04-06 17:27:02 +02:00
|
|
|
context.getString(R.string.alertDialogTokenRevokedMessage), context.getString(R.string.cancelButton),
|
2021-12-15 20:37:53 +01:00
|
|
|
context.getString(R.string.navLogout));
|
2020-10-12 20:11:23 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
|
|
|
|
actionResult.finish(ActionResult.Status.FAILED);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onFailure(@NonNull Call<Issues> call, @NonNull Throwable t) {
|
|
|
|
|
|
|
|
Toasty.error(context, context.getResources().getString(R.string.genericServerResponseError));
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return actionResult;
|
|
|
|
}
|
2019-06-03 23:25:05 +02:00
|
|
|
}
|