use of com.fanap.podchat.model.ResultBlock in project pod-chat-android-sdk by FanapSoft.
the class ChatCore method handleUnBlock.
private void handleUnBlock(ChatMessage chatMessage, String messageUniqueId) {
BlockedContact contact = gson.fromJson(chatMessage.getContent(), BlockedContact.class);
ChatResponse<ResultBlock> chatResponse = new ChatResponse<>();
ResultBlock resultBlock = new ResultBlock();
resultBlock.setContact(contact);
chatResponse.setResult(resultBlock);
chatResponse.setErrorCode(0);
chatResponse.setHasError(false);
chatResponse.setUniqueId(chatMessage.getUniqueId());
String jsonUnBlock = gson.toJson(chatResponse);
if (sentryResponseLog) {
showLog("RECEIVE_UN_BLOCK", jsonUnBlock);
} else {
showLog("RECEIVE_UN_BLOCK");
}
messageCallbacks.remove(messageUniqueId);
if (cache) {
dataSource.deleteBlockedContactById(contact.getBlockId());
}
listenerManager.callOnUnBlock(jsonUnBlock, chatResponse);
}
use of com.fanap.podchat.model.ResultBlock in project pod-chat-android-sdk by FanapSoft.
the class ChatCore method handleOutPutBlock.
private void handleOutPutBlock(ChatMessage chatMessage, String messageUniqueId) {
BlockedContact contact = gson.fromJson(chatMessage.getContent(), BlockedContact.class);
ChatResponse<ResultBlock> chatResponse = new ChatResponse<>();
ResultBlock resultBlock = new ResultBlock();
resultBlock.setContact(contact);
chatResponse.setResult(resultBlock);
chatResponse.setErrorCode(0);
chatResponse.setHasError(false);
chatResponse.setUniqueId(chatMessage.getUniqueId());
String jsonBlock = gson.toJson(chatResponse);
if (cache) {
dataSource.saveBlockedContactResultFromServer(contact);
}
if (sentryResponseLog) {
showLog("RECEIVE_BLOCK", jsonBlock);
} else {
showLog("RECEIVE_BLOCK");
}
messageCallbacks.remove(messageUniqueId);
listenerManager.callOnBlock(jsonBlock, chatResponse);
}
Aggregations