Search in sources :

Example 1 with RemoveFromCallResult

use of com.fanap.podchat.call.result_model.RemoveFromCallResult in project pod-chat-android-sdk by FanapSoft.

the class CallAsyncRequestsManager method handleOnParticipantRemoved.

public static ChatResponse<RemoveFromCallResult> handleOnParticipantRemoved(ChatMessage chatMessage) {
    ChatResponse<RemoveFromCallResult> response = new ChatResponse<>();
    ArrayList<CallParticipantVO> participantsLeft = App.getGson().fromJson(chatMessage.getContent(), new TypeToken<ArrayList<CallParticipantVO>>() {
    }.getType());
    RemoveFromCallResult result = new RemoveFromCallResult();
    result.setCallId(chatMessage.getSubjectId());
    result.setCallParticipants(participantsLeft);
    if (Util.isNotNullOrEmpty(participantsLeft))
        result.setUserRemoved(isUserContains(participantsLeft));
    response.setResult(result);
    response.setSubjectId(chatMessage.getSubjectId());
    response.setUniqueId(chatMessage.getUniqueId());
    return response;
}
Also used : CallParticipantVO(com.fanap.podchat.call.model.CallParticipantVO) RemoveFromCallResult(com.fanap.podchat.call.result_model.RemoveFromCallResult) TypeToken(com.google.gson.reflect.TypeToken) ChatResponse(com.fanap.podchat.model.ChatResponse)

Aggregations

CallParticipantVO (com.fanap.podchat.call.model.CallParticipantVO)1 RemoveFromCallResult (com.fanap.podchat.call.result_model.RemoveFromCallResult)1 ChatResponse (com.fanap.podchat.model.ChatResponse)1 TypeToken (com.google.gson.reflect.TypeToken)1