use of com.fanap.podchat.mainmodel.AsyncMessage in project pod-chat-android-sdk by FanapSoft.
the class PinThread method unPinThread.
public static String unPinThread(RequestPinThread request, String uniqueId) {
long threadId = request.getThreadId();
AsyncMessage message = new ChatMessage();
message.setType(ChatMessageType.Constants.UNPIN_THREAD);
message.setToken(CoreConfig.token);
message.setTokenIssuer(CoreConfig.tokenIssuer);
message.setTypeCode(request.getTypeCode() != null ? request.getTypeCode() : CoreConfig.typeCode);
message.setSubjectId(threadId);
message.setUniqueId(uniqueId);
return App.getGson().toJson(message);
}
use of com.fanap.podchat.mainmodel.AsyncMessage in project pod-chat-android-sdk by FanapSoft.
the class ContactManager method createAddContactRequest.
public static String createAddContactRequest(String uniqueId, String typeCode, List<String> firstNames, List<String> lastNames, List<String> userNames, List<String> cellNumbers, List<String> emails, List<String> uniqIds) {
AddContactVO addContactVO = new AddContactVO().setEmailList(emails).setFirstNameList(firstNames).setLastNameList(lastNames).setUserNameList(userNames).setCellphoneNumberList(cellNumbers).setUniqueIdList(uniqIds);
String content = App.getGson().toJson(addContactVO);
AsyncMessage message = new ChatMessage();
message.setType(ChatMessageType.Constants.ADD_CONTACT);
message.setToken(CoreConfig.token);
message.setTokenIssuer(CoreConfig.tokenIssuer);
message.setTypeCode(typeCode != null ? typeCode : CoreConfig.typeCode);
message.setContent(content);
message.setUniqueId(uniqueId);
return App.getGson().toJson(message);
}
use of com.fanap.podchat.mainmodel.AsyncMessage in project pod-chat-android-sdk by FanapSoft.
the class ContactManager method createRemoveContactRequest.
public static String createRemoveContactRequest(String uniqueId, String typeCode, List<String> userIds) {
String content = App.getGson().toJson(userIds);
AsyncMessage message = new ChatMessage();
message.setType(ChatMessageType.Constants.REMOVE_CONTACT);
message.setToken(CoreConfig.token);
message.setTokenIssuer(CoreConfig.tokenIssuer);
message.setTypeCode(typeCode != null ? typeCode : CoreConfig.typeCode);
message.setContent(content);
message.setUniqueId(uniqueId);
return App.getGson().toJson(message);
}
use of com.fanap.podchat.mainmodel.AsyncMessage in project pod-chat-android-sdk by FanapSoft.
the class CallAsyncRequestsManager method createGetActiveCallsRequest.
public static String createGetActiveCallsRequest(GetActiveCallsRequest request, String uniqueId) {
request.setCount(request.getCount() > 0 ? request.getCount() : 50);
JsonObject content = (JsonObject) App.getGson().toJsonTree(request);
content.remove("useCache");
AsyncMessage message = new AsyncMessage();
message.setContent(content.toString());
message.setType(ChatMessageType.Constants.GET_CALLS_TO_JOIN);
message.setToken(CoreConfig.token);
message.setTokenIssuer(CoreConfig.tokenIssuer);
message.setUniqueId(uniqueId);
message.setTypeCode(Util.isNullOrEmpty(request.getTypeCode()) ? CoreConfig.typeCode : request.getTypeCode());
JsonObject jsonObject = (JsonObject) App.getGson().toJsonTree(message);
jsonObject.remove("subjectId");
return jsonObject.toString();
}
use of com.fanap.podchat.mainmodel.AsyncMessage in project pod-chat-android-sdk by FanapSoft.
the class CallAsyncRequestsManager method createCallClientErrorsRequestMessage.
public static String createCallClientErrorsRequestMessage(CallClientErrorsRequest request, String uniqueId) throws PodChatException {
if (request.getCallId() <= 0)
throw new PodChatException("Invalid call id", ChatConstant.ERROR_CODE_INVALID_THREAD_ID, uniqueId);
AsyncMessage message = new AsyncMessage();
JsonObject contentObj = new JsonObject();
contentObj.addProperty("code", request.getErrorCode());
message.setType(ChatMessageType.Constants.CALL_CLIENT_ERRORS);
message.setContent(contentObj.toString());
message.setToken(CoreConfig.token);
message.setTokenIssuer(CoreConfig.tokenIssuer);
message.setUniqueId(uniqueId);
message.setSubjectId(request.getCallId());
message.setTypeCode(Util.isNotNullOrEmpty(request.getTypeCode()) ? request.getTypeCode() : CoreConfig.typeCode);
JsonObject messageObj = (JsonObject) App.getGson().toJsonTree(message);
return messageObj.toString();
}
Aggregations