Search in sources :

Example 1 with LeaveCallResult

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

the class CallAsyncRequestsManager method handleOnParticipantLeft.

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

Aggregations

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