use of com.fanap.podchat.mainmodel.AsyncMessage in project pod-chat-android-sdk by FanapSoft.
the class CallAsyncRequestsManager method createUnMuteCallParticipantMessage.
public static String createUnMuteCallParticipantMessage(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.UN_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();
}
use of com.fanap.podchat.mainmodel.AsyncMessage in project pod-chat-android-sdk by FanapSoft.
the class CallAsyncRequestsManager method createTurnOffVideoMessage.
public static String createTurnOffVideoMessage(TurnCallParticipantVideoOffRequest 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.TURN_OFF_VIDEO_CALL);
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 createStartShareScreenMessage.
public static String createStartShareScreenMessage(ScreenShareRequest request, String uniqueId) {
AsyncMessage message = new AsyncMessage();
message.setType(ChatMessageType.Constants.START_SHARE_SCREEN);
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 jsonObject = (JsonObject) App.getGson().toJsonTree(message);
return jsonObject.toString();
}
use of com.fanap.podchat.mainmodel.AsyncMessage in project pod-chat-android-sdk by FanapSoft.
the class CallAsyncRequestsManager method createGetActiveCallParticipantsMessage.
public static String createGetActiveCallParticipantsMessage(GetCallParticipantsRequest 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();
message.setType(ChatMessageType.Constants.GET_ACTIVE_CALL_PARTICIPANTS);
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);
return App.getGson().toJson(message);
}
use of com.fanap.podchat.mainmodel.AsyncMessage in project pod-chat-android-sdk by FanapSoft.
the class CallAsyncRequestsManager method createDeliverCallRequestMessage.
public static String createDeliverCallRequestMessage(ChatMessage chatMessage) {
AsyncMessage message = new AsyncMessage();
message.setType(ChatMessageType.Constants.DELIVER_CALL_REQUEST);
message.setToken(CoreConfig.token);
message.setSubjectId(chatMessage.getSubjectId());
message.setTokenIssuer(CoreConfig.tokenIssuer);
message.setUniqueId(chatMessage.getUniqueId());
message.setTypeCode(CoreConfig.typeCode);
JsonObject messageObj = (JsonObject) App.getGson().toJsonTree(message);
return messageObj.toString();
}
Aggregations