mirror of
https://github.com/etesync/android
synced 2025-01-23 14:10:54 +00:00
Journal members: update according to the new members API.
This commit is contained in:
parent
53e7ba98ab
commit
148260110a
@ -90,14 +90,21 @@ public class JournalManager extends BaseManager {
|
||||
newCall(request);
|
||||
}
|
||||
|
||||
private HttpUrl getMemberRemote(Journal journal) {
|
||||
return this.remote.resolve(journal.getUid() + "/members/");
|
||||
private HttpUrl getMemberRemote(Journal journal, String user) {
|
||||
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 {
|
||||
Request request = new Request.Builder()
|
||||
.get()
|
||||
.url(getMemberRemote(journal))
|
||||
.url(getMemberRemote(journal, null))
|
||||
.build();
|
||||
|
||||
Response response = newCall(request);
|
||||
@ -110,7 +117,7 @@ public class JournalManager extends BaseManager {
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.delete(body)
|
||||
.url(getMemberRemote(journal))
|
||||
.url(getMemberRemote(journal, member.getUser()))
|
||||
.build();
|
||||
|
||||
newCall(request);
|
||||
@ -121,7 +128,7 @@ public class JournalManager extends BaseManager {
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.post(body)
|
||||
.url(getMemberRemote(journal))
|
||||
.url(getMemberRemote(journal, null))
|
||||
.build();
|
||||
|
||||
newCall(request);
|
||||
|
Loading…
Reference in New Issue
Block a user