use of com.fanap.podchat.model.ChatResponse in project pod-chat-android-sdk by FanapSoft.
the class ContactManager method prepareUpdateLastSeenResponse.
public static ChatResponse<ResultNotSeenDuration> prepareUpdateLastSeenResponse(ChatMessage message, JsonParser parser) {
ChatResponse<ResultNotSeenDuration> response = new ChatResponse<>();
JsonObject jsonObject = Util.objectToJson(message.getContent(), parser);
Map<String, Long> idLastSeen = new HashMap<>();
for (String key : jsonObject.keySet()) {
idLastSeen.put(key, jsonObject.get(key).getAsLong());
}
ResultNotSeenDuration resultNotSeenDuration = new ResultNotSeenDuration();
resultNotSeenDuration.setIdNotSeenPair(idLastSeen);
response.setResult(resultNotSeenDuration);
return response;
}
use of com.fanap.podchat.model.ChatResponse in project pod-chat-android-sdk by FanapSoft.
the class PodDownloader method generatePodSpaceDownloadResult.
public static ChatResponse<ResultDownloadFile> generatePodSpaceDownloadResult(String hashCode, File cacheFile) {
ResultDownloadFile result = new ResultDownloadFile();
result.setFile(cacheFile);
result.setUri(Uri.fromFile(cacheFile));
result.setHashCode(hashCode);
ChatResponse<ResultDownloadFile> response = new ChatResponse<>();
response.setResult(result);
return response;
}
use of com.fanap.podchat.model.ChatResponse in project pod-chat-android-sdk by FanapSoft.
the class PodDownloader method generateDownloadResult.
public static ChatResponse<ResultDownloadFile> generateDownloadResult(String hashCode, long id, File cacheFile) {
ResultDownloadFile result = new ResultDownloadFile();
result.setFile(cacheFile);
result.setUri(Uri.fromFile(cacheFile));
result.setHashCode(hashCode);
result.setId(id);
ChatResponse<ResultDownloadFile> response = new ChatResponse<>();
response.setResult(result);
return response;
}
use of com.fanap.podchat.model.ChatResponse in project pod-chat-android-sdk by FanapSoft.
the class AssistantManager method handleAssistantHistoryResponse.
public static ChatResponse<List<AssistantHistoryVo>> handleAssistantHistoryResponse(ChatMessage chatMessage) {
ChatResponse<List<AssistantHistoryVo>> response = new ChatResponse<>();
List<AssistantHistoryVo> result = App.getGson().fromJson(chatMessage.getContent(), new TypeToken<ArrayList<AssistantHistoryVo>>() {
}.getType());
for (AssistantHistoryVo history : result) {
switch(history.getActionType()) {
case AssistantActionType.REGISTER_ASSISTANT:
history.setActionName("REGISTER_ASSISTANT");
break;
case AssistantActionType.ACTIVATE_ASSISTANT:
history.setActionName("ACTIVATE_ASSISTANT");
break;
case AssistantActionType.DEACTIVE_ASSISTANT:
history.setActionName("DEACTIVE_ASSISTANT");
break;
case AssistantActionType.BLOCK_ASSISTANT:
history.setActionName("BLOCK_ASSISTANT");
break;
case AssistantActionType.UNBLOCK_ASSISTANT:
history.setActionName("UNBLOCK_ASSISTANT");
break;
}
}
response.setResult(result);
response.setUniqueId(chatMessage.getUniqueId());
response.setCache(false);
return response;
}
use of com.fanap.podchat.model.ChatResponse in project pod-chat-android-sdk by FanapSoft.
the class BotManager method handleOnBotStartedOrStopped.
public static ChatResponse<StartStopBotResult> handleOnBotStartedOrStopped(ChatMessage chatMessage) {
ChatResponse<StartStopBotResult> response = new ChatResponse<>();
StartStopBotResult result = new StartStopBotResult(chatMessage.getContent());
response.setResult(result);
response.setUniqueId(chatMessage.getUniqueId());
response.setSubjectId(chatMessage.getSubjectId());
return response;
}
Aggregations