use of com.fanap.podchat.mainmodel.AsyncMessage in project pod-chat-android-sdk by FanapSoft.
the class UserProfile method setProfile.
public static String setProfile(RequestUpdateProfile request, String uniqueId) {
String bio = request.getBio();
String metadata = request.getMetadata();
JsonObject content = new JsonObject();
content.addProperty("bio", bio);
content.addProperty("metadata", metadata);
AsyncMessage message = new AsyncMessage();
message.setContent(content.toString());
message.setToken(CoreConfig.token);
message.setType(ChatMessageType.Constants.UPDATE_CHAT_PROFILE);
message.setTokenIssuer(CoreConfig.tokenIssuer);
message.setUniqueId(uniqueId);
message.setTypeCode(request.getTypeCode() != null ? request.getTypeCode() : CoreConfig.typeCode);
return App.getGson().toJson(message);
}
use of com.fanap.podchat.mainmodel.AsyncMessage in project pod-chat-android-sdk by FanapSoft.
the class UserRoles method getUserRoles.
public static String getUserRoles(RequestGetUserRoles request, String uniqueId) {
long threadId = request.getThreadId();
AsyncMessage message = new AsyncMessage();
message.setSubjectId(threadId);
message.setToken(CoreConfig.token);
message.setType(ChatMessageType.Constants.GET_USER_ROLES);
message.setTokenIssuer(CoreConfig.tokenIssuer);
message.setUniqueId(uniqueId);
message.setTypeCode(request.getTypeCode() != null ? request.getTypeCode() : CoreConfig.typeCode);
return App.getGson().toJson(message);
}
use of com.fanap.podchat.mainmodel.AsyncMessage in project pod-chat-android-sdk by FanapSoft.
the class PinMessage method pinMessage.
public static String pinMessage(RequestPinMessage request, String uniqueId) {
long messageId = request.getMessageId();
boolean notifyAll = request.isNotifyAll();
JsonObject content = new JsonObject();
content.addProperty("notifyAll", notifyAll);
AsyncMessage message = new AsyncMessage();
message.setSubjectId(messageId);
message.setContent(content.toString());
message.setToken(CoreConfig.token);
message.setType(ChatMessageType.Constants.PIN_MESSAGE);
message.setTokenIssuer(CoreConfig.tokenIssuer);
message.setUniqueId(uniqueId);
message.setTypeCode(!Util.isNullOrEmpty(request.getTypeCode()) ? request.getTypeCode() : CoreConfig.typeCode);
return App.getGson().toJson(message);
}
use of com.fanap.podchat.mainmodel.AsyncMessage in project pod-chat-android-sdk by FanapSoft.
the class CallAsyncRequestsManager method createEndCallRequestMessage.
public static String createEndCallRequestMessage(EndCallRequest request, String uniqueId) {
AsyncMessage message = new AsyncMessage();
message.setType(ChatMessageType.Constants.END_CALL_REQUEST);
message.setToken(CoreConfig.token);
message.setSubjectId(request.getCallId());
message.setTokenIssuer(CoreConfig.tokenIssuer);
message.setUniqueId(uniqueId);
message.setTypeCode(Util.isNullOrEmpty(request.getTypeCode()) ? request.getTypeCode() : CoreConfig.typeCode);
JsonObject a = (JsonObject) App.getGson().toJsonTree(message);
return a.toString();
}
use of com.fanap.podchat.mainmodel.AsyncMessage in project pod-chat-android-sdk by FanapSoft.
the class CallAsyncRequestsManager method createMuteCallParticipantMessage.
public static String createMuteCallParticipantMessage(MuteUnMuteCallParticipantRequest request, String uniqueId) throws PodChatException {
if (request.getCallId() <= 0)
throw new PodChatException(ChatConstant.ERROR_INVALID_THREAD_ID, ChatConstant.ERROR_CODE_INVALID_THREAD_ID);
if (Util.isNullOrEmpty(request.getParticipantsIds()))
throw new PodChatException(ChatConstant.MUTE_USER_LIST_IS_EMPTY, ChatConstant.ERROR_CODE_INVALID_DATA);
String content = App.getGson().toJson(request.getParticipantsIds());
AsyncMessage message = new AsyncMessage();
message.setContent(content);
message.setType(ChatMessageType.Constants.MUTE_CALL_PARTICIPANT);
message.setToken(CoreConfig.token);
message.setSubjectId(request.getCallId());
message.setTokenIssuer(CoreConfig.tokenIssuer);
message.setUniqueId(uniqueId);
message.setTypeCode(Util.isNullOrEmpty(request.getTypeCode()) ? request.getTypeCode() : CoreConfig.typeCode);
JsonObject a = (JsonObject) App.getGson().toJsonTree(message);
return a.toString();
}
Aggregations