use of com.fanap.podchat.model.ResultAddParticipant in project pod-chat-android-sdk by FanapSoft.
the class ChatCore method handleAddParticipant.
private void handleAddParticipant(ChatMessage chatMessage, String messageUniqueId) {
Thread thread = gson.fromJson(chatMessage.getContent(), Thread.class);
if (cache) {
ThreadVo threadVo = gson.fromJson(chatMessage.getContent(), ThreadVo.class);
List<CacheParticipant> cacheParticipants = threadVo.getParticipants();
if (!Util.isNullOrEmpty(cacheParticipants))
messageDatabaseHelper.saveParticipants(cacheParticipants, thread.getId(), getExpireAmount());
}
ChatResponse<ResultAddParticipant> chatResponse = ParticipantsManager.prepareAddParticipantResponse(chatMessage, thread);
String jsonAddParticipant = gson.toJson(chatResponse);
if (sentryResponseLog) {
showLog("RECEIVE_ADD_PARTICIPANT", jsonAddParticipant);
} else {
showLog("RECEIVE_ADD_PARTICIPANT");
}
messageCallbacks.remove(messageUniqueId);
listenerManager.callOnThreadAddParticipant(jsonAddParticipant, chatResponse);
}
use of com.fanap.podchat.model.ResultAddParticipant in project pod-chat-android-sdk by FanapSoft.
the class ParticipantsManager method prepareAddParticipantResponse.
public static ChatResponse<ResultAddParticipant> prepareAddParticipantResponse(ChatMessage chatMessage, Thread thread) {
ChatResponse<ResultAddParticipant> chatResponse = new ChatResponse<>();
ResultAddParticipant resultAddParticipant = new ResultAddParticipant();
resultAddParticipant.setThread(thread);
chatResponse.setErrorCode(0);
chatResponse.setErrorMessage("");
chatResponse.setHasError(false);
chatResponse.setResult(resultAddParticipant);
chatResponse.setUniqueId(chatMessage.getUniqueId());
return chatResponse;
}
Aggregations