diff --git a/mastodon/src/main/java/org/joinmastodon/android/api/requests/lists/UpdateList.java b/mastodon/src/main/java/org/joinmastodon/android/api/requests/lists/UpdateList.java index e37a5a2353..54441d8a06 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/api/requests/lists/UpdateList.java +++ b/mastodon/src/main/java/org/joinmastodon/android/api/requests/lists/UpdateList.java @@ -3,13 +3,21 @@ import org.joinmastodon.android.api.MastodonAPIRequest; import org.joinmastodon.android.model.FollowList; -public class UpdateList extends MastodonAPIRequest { - public UpdateList(String id, String title, boolean exclusive, FollowList.RepliesPolicy repliesPolicy) { - super(HttpMethod.PUT, "/lists/" + id, FollowList.class); - CreateList.Request req = new CreateList.Request(); - req.title = title; - req.exclusive = exclusive; - req.repliesPolicy = repliesPolicy; - setRequestBody(req); +public class UpdateList extends MastodonAPIRequest{ + public UpdateList(String listID, String title, FollowList.RepliesPolicy repliesPolicy, boolean exclusive){ + super(HttpMethod.PUT, "/lists/"+listID, FollowList.class); + setRequestBody(new Request(title, repliesPolicy, exclusive)); } -} + + private static class Request{ + public String title; + public FollowList.RepliesPolicy repliesPolicy; + public boolean exclusive; + + public Request(String title, FollowList.RepliesPolicy repliesPolicy, boolean exclusive){ + this.title=title; + this.repliesPolicy=repliesPolicy; + this.exclusive=exclusive; + } + } +} \ No newline at end of file diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ListTimelineFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ListTimelineFragment.java index b8ec041d3f..a55db5b8f6 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ListTimelineFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ListTimelineFragment.java @@ -97,7 +97,7 @@ public boolean onOptionsItemSelected(MenuItem item) { .setPositiveButton(R.string.save, (d, which) -> { String newTitle = editor.getTitle().trim(); setTitle(newTitle); - new UpdateList(listID, newTitle, editor.isExclusive(), editor.getRepliesPolicy()).setCallback(new Callback<>() { + new UpdateList(listID, newTitle, editor.getRepliesPolicy(), editor.isExclusive()).setCallback(new Callback<>() { @Override public void onSuccess(FollowList list) { if(getActivity()==null) return;