Search in sources :

Example 1 with ResultLeaveThread

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

the class ThreadManager method prepareLeaveThreadResponse.

// public static List<Thread> sortThreads(List<Thread> unsorted) {
// List<Thread> sorted = new ArrayList<>(unsorted);
// Collections.sort(sorted, ThreadManager::compareThreads);
// return sorted;
// }
public static ChatResponse<ResultLeaveThread> prepareLeaveThreadResponse(ChatMessage chatMessage) {
    ChatResponse<ResultLeaveThread> chatResponse = new ChatResponse<>();
    ResultLeaveThread leaveThread = App.getGson().fromJson(chatMessage.getContent(), ResultLeaveThread.class);
    leaveThread.setThreadId(chatMessage.getSubjectId());
    chatResponse.setErrorCode(0);
    chatResponse.setHasError(false);
    chatResponse.setErrorMessage("");
    chatResponse.setUniqueId(chatMessage.getUniqueId());
    chatResponse.setResult(leaveThread);
    return chatResponse;
}
Also used : ChatResponse(com.fanap.podchat.model.ChatResponse) ResultLeaveThread(com.fanap.podchat.model.ResultLeaveThread)

Aggregations

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