use of com.fanap.podchat.chat.pin.pin_message.model.ResultPinMessage in project pod-chat-android-sdk by FanapSoft.
the class PinMessage method handleOnMessagePinned.
public static ChatResponse<ResultPinMessage> handleOnMessagePinned(ChatMessage message) {
ChatResponse<ResultPinMessage> response = new ChatResponse<>();
ResultPinMessage result = App.getGson().fromJson(message.getContent(), ResultPinMessage.class);
response.setResult(result);
response.setSubjectId(message.getSubjectId());
response.setUniqueId(message.getUniqueId());
return response;
}
use of com.fanap.podchat.chat.pin.pin_message.model.ResultPinMessage in project pod-chat-android-sdk by FanapSoft.
the class PinMessage method handleOnMessageUnPinned.
public static ChatResponse<ResultPinMessage> handleOnMessageUnPinned(ChatMessage message) {
ChatResponse<ResultPinMessage> response = new ChatResponse<>();
ResultPinMessage result = App.getGson().fromJson(message.getContent(), ResultPinMessage.class);
response.setResult(result);
response.setSubjectId(message.getSubjectId());
response.setUniqueId(message.getUniqueId());
return response;
}
use of com.fanap.podchat.chat.pin.pin_message.model.ResultPinMessage in project pod-chat-android-sdk by FanapSoft.
the class MessageDatabaseHelper method savePinMessage.
public void savePinMessage(ChatResponse<ResultPinMessage> response, long subjectId) {
worker(() -> {
ResultPinMessage result = response.getResult();
PinMessageVO pinMessageVO = new PinMessageVO();
pinMessageVO.setThreadId(subjectId);
pinMessageVO.setMessageId(result.getMessageId());
pinMessageVO.setNotifyAll(result.isNotifyAll());
pinMessageVO.setText(result.getText());
pinMessageVO.setTime(result.getTime());
if (result.getParticipant() != null) {
Participant participant = result.getParticipant();
String participantJson = App.getGson().toJson(participant);
CacheParticipant cacheParticipant = App.getGson().fromJson(participantJson, CacheParticipant.class);
messageDao.insertParticipant(cacheParticipant);
pinMessageVO.setParticipantId(cacheParticipant.getId());
}
messageDao.insertPinnedMessage(pinMessageVO);
});
}
Aggregations