1
0
mirror of https://framagit.org/tom79/fedilab-tube synced 2025-06-05 21:09:11 +02:00
This commit is contained in:
Thomas
2020-12-12 14:47:59 +01:00
parent efd6b0088f
commit 88b5a83fb1

View File

@ -157,7 +157,8 @@ public class ShowChannelActivity extends AppCompatActivity {
account_follow.setOnClickListener(v -> { account_follow.setOnClickListener(v -> {
AlertDialog.Builder builderSingle = new AlertDialog.Builder(ShowChannelActivity.this); AlertDialog.Builder builderSingle = new AlertDialog.Builder(ShowChannelActivity.this);
builderSingle.setTitle(getString(R.string.list_of_accounts)); builderSingle.setTitle(getString(R.string.list_of_accounts));
if (accounts != null) { if (accounts != null && accounts.size() > 0) {
if (accounts.size() > 1) {
final OwnAccountsAdapter accountsListAdapter = new OwnAccountsAdapter(ShowChannelActivity.this, accounts); final OwnAccountsAdapter accountsListAdapter = new OwnAccountsAdapter(ShowChannelActivity.this, accounts);
builderSingle.setAdapter(accountsListAdapter, (dialog, which) -> { builderSingle.setAdapter(accountsListAdapter, (dialog, which) -> {
new Thread(() -> { new Thread(() -> {
@ -169,6 +170,10 @@ public class ShowChannelActivity extends AppCompatActivity {
} }
}).start(); }).start();
}); });
} else {
RetrofitPeertubeAPI peertubeAPI = new RetrofitPeertubeAPI(ShowChannelActivity.this, accounts.get(0).getHost(), accounts.get(0).getToken());
peertubeAPI.post(FOLLOW, channel.getAcct(), null);
}
} }
builderSingle.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); builderSingle.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
builderSingle.show(); builderSingle.show();