use of com.fanap.podchat.model.ResultSignalMessage in project pod-chat-android-sdk by FanapSoft.
the class ChatCore method handleSystemMessage.
private void handleSystemMessage(Callback callback, ChatMessage chatMessage, String messageUniqueId) {
if (callback != null && callback.isResult()) {
messageCallbacks.remove(messageUniqueId);
}
ChatResponse<ResultSignalMessage> result = reformatSignalMessage(chatMessage);
listenerManager.callOnGetSignalMessage(result);
if (result == null) {
return;
}
OutputSignalMessage output = new OutputSignalMessage();
output.setResultSignalMessage(result.getResult());
output.setSubjectId(result.getSubjectId());
output.setUniqueId(result.getUniqueId());
ResultSignalMessage sm = result.getResult();
output.setSignalMessageType(getSignalMessageType(sm.getSmt()));
output.setSignalSenderName(sm.getUser());
if (sentryResponseLog) {
showLog("RECEIVE_SIGNAL_MESSAGE", gson.toJson(output));
} else {
showLog("RECEIVE_SIGNAL_MESSAGE");
}
listenerManager.callOnGetSignalMessage(output);
}
use of com.fanap.podchat.model.ResultSignalMessage in project pod-chat-android-sdk by FanapSoft.
the class ChatCore method reformatSignalMessage.
private ChatResponse<ResultSignalMessage> reformatSignalMessage(ChatMessage chatMessage) {
ChatResponse<ResultSignalMessage> result = new ChatResponse<>();
ResultSignalMessage signalMessage;
try {
signalMessage = gson.fromJson(chatMessage.getContent(), ResultSignalMessage.class);
} catch (JsonSyntaxException e) {
showErrorLog(e.getMessage());
onUnknownException(chatMessage.getUniqueId(), e);
return null;
}
result.setSubjectId(chatMessage.getSubjectId());
result.setUniqueId(chatMessage.getUniqueId());
result.setResult(signalMessage);
return result;
}
Aggregations