Search in sources :

Example 1 with ResultClearHistory

use of com.fanap.podchat.model.ResultClearHistory in project pod-chat-android-sdk by FanapSoft.

the class ChatCore method handleClearHistory.

private void handleClearHistory(ChatMessage chatMessage) {
    ChatResponse<ResultClearHistory> chatResponseClrHistory = new ChatResponse<>();
    ResultClearHistory resultClearHistory = new ResultClearHistory();
    long clrHistoryThreadId = gson.fromJson(chatMessage.getContent(), Long.class);
    resultClearHistory.setThreadId(clrHistoryThreadId);
    chatResponseClrHistory.setResult(resultClearHistory);
    chatResponseClrHistory.setUniqueId(chatMessage.getUniqueId());
    chatResponseClrHistory.setSubjectId(chatMessage.getSubjectId());
    String jsonClrHistory = gson.toJson(chatResponseClrHistory);
    if (sentryResponseLog) {
        showLog("RECEIVE_CLEAR_HISTORY", jsonClrHistory);
    } else {
        showLog("RECEIVE_CLEAR_HISTORY");
    }
    if (cache) {
        messageDatabaseHelper.deleteMessagesOfThread(chatMessage.getSubjectId());
    }
    listenerManager.callOnClearHistory(jsonClrHistory, chatResponseClrHistory);
}
Also used : ChatResponse(com.fanap.podchat.model.ChatResponse) ResultClearHistory(com.fanap.podchat.model.ResultClearHistory)

Aggregations

ChatResponse (com.fanap.podchat.model.ChatResponse)1 ResultClearHistory (com.fanap.podchat.model.ResultClearHistory)1