Skip to content

Commit

Permalink
removed unnecessary lines
Browse files Browse the repository at this point in the history
  • Loading branch information
Sathyan-KM committed May 16, 2024
1 parent 590beed commit a69139f
Showing 1 changed file with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,16 +322,6 @@ public void onFailure(Exception e, Context context) {
}
} else if (call.method.equals("buildConversation")) {
try {
// JSONObject conversationObject = new JSONObject(call.arguments.toString());
// KmConversationBuilder conversationBuilder = (KmConversationBuilder) GsonUtils.getObjectFromJson(conversationObject.toString(), KmConversationBuilder.class);
// conversationBuilder.setContext(context);
//
// if (!conversationObject.has("isSingleConversation")) {
// conversationBuilder.setSingleConversation(true);
// }
// if (!conversationObject.has("skipConversationList")) {
// conversationBuilder.setSkipConversationList(true);
// }
JSONObject conversationObject = new JSONObject(call.arguments.toString());
HashMap<String, String> messageMetadata = null;
if (conversationObject.has("messageMetadata")) {
Expand All @@ -340,6 +330,15 @@ public void onFailure(Exception e, Context context) {
}
KmConversationBuilder conversationBuilder = (KmConversationBuilder) GsonUtils.getObjectFromJson(conversationObject.toString(), KmConversationBuilder.class);
conversationBuilder.setContext(context);

if (!conversationObject.has("isSingleConversation")) {
conversationBuilder.setSingleConversation(true);
}

if (!conversationObject.has("skipConversationList")) {
conversationBuilder.setSkipConversationList(true);
}

if (messageMetadata != null && !messageMetadata.isEmpty()) {
conversationBuilder.setMessageMetadata(messageMetadata);
}
Expand Down

0 comments on commit a69139f

Please sign in to comment.