Journal members: update according to the new members API.

pull/14/head
Tom Hacohen 7 years ago
parent 53e7ba98ab
commit 148260110a

@ -90,14 +90,21 @@ public class JournalManager extends BaseManager {
newCall(request); newCall(request);
} }
private HttpUrl getMemberRemote(Journal journal) { private HttpUrl getMemberRemote(Journal journal, String user) {
return this.remote.resolve(journal.getUid() + "/members/"); HttpUrl.Builder bulider = this.remote.newBuilder();
bulider.addPathSegment(journal.getUid())
.addPathSegment("members");
if (user != null) {
bulider.addPathSegment(user);
}
bulider.addPathSegment("");
return bulider.build();
} }
public List<Member> listMembers(Journal journal) throws Exceptions.HttpException, Exceptions.IntegrityException, Exceptions.GenericCryptoException { public List<Member> listMembers(Journal journal) throws Exceptions.HttpException, Exceptions.IntegrityException, Exceptions.GenericCryptoException {
Request request = new Request.Builder() Request request = new Request.Builder()
.get() .get()
.url(getMemberRemote(journal)) .url(getMemberRemote(journal, null))
.build(); .build();
Response response = newCall(request); Response response = newCall(request);
@ -110,7 +117,7 @@ public class JournalManager extends BaseManager {
Request request = new Request.Builder() Request request = new Request.Builder()
.delete(body) .delete(body)
.url(getMemberRemote(journal)) .url(getMemberRemote(journal, member.getUser()))
.build(); .build();
newCall(request); newCall(request);
@ -121,7 +128,7 @@ public class JournalManager extends BaseManager {
Request request = new Request.Builder() Request request = new Request.Builder()
.post(body) .post(body)
.url(getMemberRemote(journal)) .url(getMemberRemote(journal, null))
.build(); .build();
newCall(request); newCall(request);

Loading…
Cancel
Save