|
|
|
@ -171,7 +171,7 @@ public class AdminReportActivity extends BaseActivity {
|
|
|
|
|
|
|
|
|
|
binding.disableAction.setOnClickListener(v -> {
|
|
|
|
|
if (adminAccount.disabled) {
|
|
|
|
|
adminVM.enable(MainActivity.currentInstance, MainActivity.currentToken, account.id)
|
|
|
|
|
adminVM.enable(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id)
|
|
|
|
|
.observe(AdminReportActivity.this, adminAccountResult -> {
|
|
|
|
|
if (adminAccountResult != null) {
|
|
|
|
|
adminAccount.disabled = false;
|
|
|
|
@ -183,7 +183,7 @@ public class AdminReportActivity extends BaseActivity {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
adminVM.performAction(MainActivity.currentInstance, MainActivity.currentToken, account.id, "disable ", null, null, null, null);
|
|
|
|
|
adminVM.performAction(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id, "disable ", null, null, null, null);
|
|
|
|
|
adminAccount.disabled = true;
|
|
|
|
|
binding.disableAction.setText(R.string.undisable);
|
|
|
|
|
binding.disabled.setText(R.string.yes);
|
|
|
|
@ -192,7 +192,7 @@ public class AdminReportActivity extends BaseActivity {
|
|
|
|
|
|
|
|
|
|
binding.approveAction.setOnClickListener(v -> {
|
|
|
|
|
if (adminAccount.approved) {
|
|
|
|
|
adminVM.reject(MainActivity.currentInstance, MainActivity.currentToken, account.id)
|
|
|
|
|
adminVM.reject(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id)
|
|
|
|
|
.observe(AdminReportActivity.this, adminAccountResult -> {
|
|
|
|
|
if (adminAccountResult != null) {
|
|
|
|
|
adminAccount.approved = false;
|
|
|
|
@ -204,7 +204,7 @@ public class AdminReportActivity extends BaseActivity {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
adminVM.approve(MainActivity.currentInstance, MainActivity.currentToken, account.id);
|
|
|
|
|
adminVM.approve(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id);
|
|
|
|
|
adminAccount.approved = true;
|
|
|
|
|
binding.approveAction.setText(R.string.reject);
|
|
|
|
|
binding.approved.setText(R.string.yes);
|
|
|
|
@ -213,7 +213,7 @@ public class AdminReportActivity extends BaseActivity {
|
|
|
|
|
|
|
|
|
|
binding.silenceAction.setOnClickListener(v -> {
|
|
|
|
|
if (adminAccount.disabled) {
|
|
|
|
|
adminVM.unsilence(MainActivity.currentInstance, MainActivity.currentToken, account.id)
|
|
|
|
|
adminVM.unsilence(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id)
|
|
|
|
|
.observe(AdminReportActivity.this, adminAccountResult -> {
|
|
|
|
|
if (adminAccountResult != null) {
|
|
|
|
|
adminAccount.silenced = false;
|
|
|
|
@ -224,7 +224,7 @@ public class AdminReportActivity extends BaseActivity {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
adminVM.performAction(MainActivity.currentInstance, MainActivity.currentToken, account.id, "silence", null, null, null, null);
|
|
|
|
|
adminVM.performAction(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id, "silence", null, null, null, null);
|
|
|
|
|
adminAccount.silenced = true;
|
|
|
|
|
binding.disableAction.setText(R.string.unsilence);
|
|
|
|
|
binding.disabled.setText(R.string.yes);
|
|
|
|
@ -233,7 +233,7 @@ public class AdminReportActivity extends BaseActivity {
|
|
|
|
|
|
|
|
|
|
binding.suspendAction.setOnClickListener(v -> {
|
|
|
|
|
if (adminAccount.disabled) {
|
|
|
|
|
adminVM.unsuspend(MainActivity.currentInstance, MainActivity.currentToken, account.id)
|
|
|
|
|
adminVM.unsuspend(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id)
|
|
|
|
|
.observe(AdminReportActivity.this, adminAccountResult -> {
|
|
|
|
|
if (adminAccountResult != null) {
|
|
|
|
|
adminAccount.suspended = false;
|
|
|
|
@ -244,7 +244,7 @@ public class AdminReportActivity extends BaseActivity {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
adminVM.performAction(MainActivity.currentInstance, MainActivity.currentToken, account.id, "suspend", null, null, null, null);
|
|
|
|
|
adminVM.performAction(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id, "suspend", null, null, null, null);
|
|
|
|
|
adminAccount.suspended = true;
|
|
|
|
|
binding.disableAction.setText(R.string.unsuspend);
|
|
|
|
|
binding.suspended.setText(R.string.yes);
|
|
|
|
|