Skip to content

Commit

Permalink
feat(implement-mls-support)
Browse files Browse the repository at this point in the history
* Add deprecated annotation on _Service class
* Remove _Conv class in API.java as Conversation (from Xenon) can be used
* Adjusted last Xenon changes on receiving members (from Member to Payload.Member)
  • Loading branch information
alexandreferris committed Nov 11, 2024
1 parent beb0b81 commit d137072
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 39 deletions.
45 changes: 7 additions & 38 deletions src/main/java/com/wire/helium/API.java
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,7 @@ public Conversation getConversation() {
throw new RuntimeException(msgError);
}

_Conv conv = response.readEntity(_Conv.class);
Conversation ret = new Conversation();
ret.name = conv.name;
ret.id = conv.id;
ret.members = conv.members.others;
return ret;
return response.readEntity(Conversation.class);
}

@Override
Expand Down Expand Up @@ -446,13 +441,7 @@ public Conversation createConversation(String name, UUID teamId, List<QualifiedI
throw new HttpException(msgError, response.getStatus());
}

_Conv conv = response.readEntity(_Conv.class);

Conversation ret = new Conversation();
ret.name = conv.name;
ret.id = conv.id;
ret.members = conv.members.others;
return ret;
return response.readEntity(Conversation.class);
}

@Override
Expand All @@ -477,13 +466,7 @@ public Conversation createOne2One(UUID teamId, QualifiedId userId) throws HttpEx
throw new HttpException(msgError, response.getStatus());
}

_Conv conv = response.readEntity(_Conv.class);

Conversation ret = new Conversation();
ret.name = conv.name;
ret.id = conv.id;
ret.members = conv.members.others;
return ret;
return response.readEntity(Conversation.class);
}

@Override
Expand Down Expand Up @@ -908,24 +891,10 @@ private boolean isSuccessResponse(int statusCode) {
return Response.Status.Family.familyOf(statusCode).equals(Response.Status.Family.SUCCESSFUL);
}

@JsonIgnoreProperties(ignoreUnknown = true)
public static class _Conv {
@JsonProperty("qualified_conversation")
public QualifiedId id;

@JsonProperty
public String name;

@JsonProperty
public _Members members;
}

@JsonIgnoreProperties(ignoreUnknown = true)
public static class _Members {
@JsonProperty
public List<Member> others;
}

/**
* @deprecated This class is deprecated and in case there is any work related to _Service,
* {@link Service} can be used instead.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
static class _Service {
public UUID service;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public class ConversationListResponse {
@JsonProperty("failed")
public List<QualifiedId> failed;

// TODO(WPB-12040): possible issue with members returning as object(others[], self{}) and we expect a list?
@JsonProperty("found")
public List<Conversation> found;

Expand Down

0 comments on commit d137072

Please sign in to comment.