fix(lists): send requests for list membership
Fixes a regression in 0af8dbf09b
, where
lists memberships where not saved, as the requests where not send to the
server.
This commit is contained in:
parent
d5cd016776
commit
f7d0bda90f
|
@ -18,6 +18,7 @@ import com.squareup.otto.Subscribe;
|
|||
import org.joinmastodon.android.E;
|
||||
import org.joinmastodon.android.R;
|
||||
import org.joinmastodon.android.api.MastodonAPIRequest;
|
||||
import org.joinmastodon.android.api.ResultlessMastodonAPIRequest;
|
||||
import org.joinmastodon.android.api.requests.lists.AddAccountsToList;
|
||||
import org.joinmastodon.android.api.requests.lists.CreateList;
|
||||
import org.joinmastodon.android.api.requests.lists.GetLists;
|
||||
|
@ -120,16 +121,16 @@ public class ListsFragment extends MastodonRecyclerFragment<FollowList> implemen
|
|||
private void saveListMembership(String listId, boolean isMember) {
|
||||
userInList.put(listId, isMember);
|
||||
List<String> accountIdList = Collections.singletonList(profileAccountId);
|
||||
// MastodonAPIRequest<Object> req = (MastodonAPIRequest<Object>) (isMember ? new AddAccountsToList(listId, accountIdList) : new RemoveAccountsFromList(listId, accountIdList));
|
||||
// req.setCallback(new Callback<>() {
|
||||
// @Override
|
||||
// public void onSuccess(Object o) {}
|
||||
//
|
||||
// @Override
|
||||
// public void onError(ErrorResponse error) {
|
||||
// error.showToast(getContext());
|
||||
// }
|
||||
// }).exec(accountID);
|
||||
ResultlessMastodonAPIRequest req = isMember ? new AddAccountsToList(listId, accountIdList) : new RemoveAccountsFromList(listId, accountIdList);
|
||||
req.setCallback(new Callback<>() {
|
||||
@Override
|
||||
public void onSuccess(Void o) {}
|
||||
|
||||
@Override
|
||||
public void onError(ErrorResponse error) {
|
||||
error.showToast(getContext());
|
||||
}
|
||||
}).exec(accountID);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue