use of com.fanap.podchat.mainmodel.Invitee in project pod-chat-android-sdk by FanapSoft.
the class ChatActivity method deactiveAssistant.
private void deactiveAssistant() {
// invite
// Invitee invite = new Invitee("52987", InviteType.Constants.TO_BE_USER_CONTACT_ID);
Invitee invite = new Invitee("63256", InviteType.Constants.TO_BE_USER_CONTACT_ID);
List<AssistantVo> assistantVos = new ArrayList<>();
AssistantVo assistantVo = new AssistantVo();
assistantVo.setInvitees(invite);
assistantVos.add(assistantVo);
DeActiveAssistantRequest request = new DeActiveAssistantRequest.Builder(assistantVos).build();
presenter.deActiveAssistant(request);
}
use of com.fanap.podchat.mainmodel.Invitee in project pod-chat-android-sdk by FanapSoft.
the class ChatActivity method createThreadWithFile.
private void createThreadWithFile() {
if (getUri() == null) {
Toast.makeText(this, "Pick a file", Toast.LENGTH_SHORT).show();
return;
}
RequestUploadImage requestUploadThreadImageImage = new RequestUploadImage.Builder(this, getUri()).setwC(140).sethC(140).build();
RequestUploadImage requestUploadImage = new RequestUploadImage.Builder(this, getUri()).setwC(120).sethC(120).setxC(1).setyC(1).build();
RequestUploadFile requestUploadFile = new RequestUploadFile.Builder(this, getUri()).build();
List<Invitee> invite = new ArrayList<>();
// f.kh sandbox
// invite.add(new Invitee("4893", InviteType.Constants.TO_BE_USER_CONTACT_ID));
// POURIA main
invite.add(new Invitee(1151568, InviteType.Constants.TO_BE_USER_CONTACT_ID));
// MASOUD
// invite.add(new Invitee(1511971, InviteType.Constants.TO_BE_USER_CONTACT_ID));
// ARVIN
invite.add(new Invitee(1512305, InviteType.Constants.TO_BE_USER_CONTACT_ID));
// MAHYAR
// invite.add(new Invitee(1196793, InviteType.Constants.TO_BE_USER_CONTACT_ID));
// RequestThreadInnerMessage innerMessage = new RequestThreadInnerMessage
// .Builder(TextMessageType.Constants.PICTURE)
// // .message("Create thread for File Message Test " + new Date().toString())
// // .forwardedMessageIds(listForwardIds)
// .build();
RequestCreateThreadWithFile request = new RequestCreateThreadWithFile.Builder(ThreadType.Constants.OWNER_GROUP, invite, requestUploadFile, TextMessageType.Constants.POD_SPACE_FILE).title("Test File PodSpace").setUploadThreadImageRequest(requestUploadThreadImageImage).build();
presenter.createThreadWithFile(request, new ProgressHandler.sendFileMessage() {
@Override
public void onProgressUpdate(String uniqueId, int progress, int totalBytesSent, int totalBytesToSend) {
Log.e("CTF", "Upload Progress: " + progress);
}
@Override
public void onFinishImage(String json, ChatResponse<ResultImageFile> chatResponse) {
Log.e("CTF", "Upload Finish (IMAGE): ");
}
@Override
public void onFinishFile(String json, ChatResponse<ResultFile> chatResponse) {
Log.e("CTF", "Upload Finish (FILE): ");
}
@Override
public void onError(String jsonError, ErrorOutPut error) {
Log.e("CTF", "Upload Error");
}
});
}
use of com.fanap.podchat.mainmodel.Invitee in project pod-chat-android-sdk by FanapSoft.
the class ChatActivity method removeParticipants.
private void removeParticipants() {
List<Invitee> inviteeList = new ArrayList<>();
List<Long> participantIds = new ArrayList<>();
participantIds.add(18476L);
// participantIds.add(5581L);
// participantIds.add(1261L);
// SET INVITEE LIST
Invitee invite = new Invitee("30150", InviteType.Constants.TO_BE_CORE_USER_ID);
Invitee invite2 = new Invitee("43593", InviteType.Constants.TO_BE_CORE_USER_ID);
// Invitee invite2 = new Invitee("5736", InviteType.Constants.TO_BE_CORE_USER_ID);
inviteeList.add(invite);
// inviteeList.add(invite2);
long threadId = TEST_THREAD_ID;
RemoveParticipantRequest request = new RemoveParticipantRequest.Builder(threadId, null).setInvitees(inviteeList).build();
presenter.removeParticipants(request, null);
}
use of com.fanap.podchat.mainmodel.Invitee in project pod-chat-android-sdk by FanapSoft.
the class ChatActivity method unBlockAssistant.
public void unBlockAssistant() {
Invitee invite = new Invitee("63256", InviteType.Constants.TO_BE_USER_CONTACT_ID);
List<AssistantVo> assistantVos = new ArrayList<>();
AssistantVo assistantVo = new AssistantVo();
assistantVo.setInvitees(invite);
assistantVos.add(assistantVo);
BlockUnblockAssistantRequest request = new BlockUnblockAssistantRequest.Builder(assistantVos, true).build();
presenter.unBlockAssistant(request);
}
use of com.fanap.podchat.mainmodel.Invitee in project pod-chat-android-sdk by FanapSoft.
the class CallAsyncRequestsManager method createAddCallParticipantMessage.
public static String createAddCallParticipantMessage(RequestAddParticipants request, String uniqueId) {
JsonArray participantsJsonArray = new JsonArray();
if (request.getContactIds() != null) {
for (Long p : request.getContactIds()) {
participantsJsonArray.add(p);
}
} else if (request.getUserNames() != null) {
for (String username : request.getUserNames()) {
Invitee invitee = new Invitee();
invitee.setId(username);
invitee.setIdType(InviteType.Constants.TO_BE_USER_USERNAME);
JsonElement jsonElement = App.getGson().toJsonTree(invitee);
participantsJsonArray.add(jsonElement);
}
} else {
for (Long coreUserId : request.getCoreUserIds()) {
Invitee invitee = new Invitee();
invitee.setId(coreUserId);
invitee.setIdType(InviteType.Constants.TO_BE_USER_ID);
JsonElement jsonElement = App.getGson().toJsonTree(invitee);
participantsJsonArray.add(jsonElement);
}
}
AsyncMessage chatMessage = new AsyncMessage();
chatMessage.setTokenIssuer("1");
chatMessage.setToken(CoreConfig.token);
chatMessage.setContent(participantsJsonArray.toString());
chatMessage.setSubjectId(request.getThreadId());
chatMessage.setUniqueId(uniqueId);
chatMessage.setType(ChatMessageType.Constants.ADD_CALL_PARTICIPANT);
chatMessage.setTypeCode(Util.isNullOrEmpty(request.getTypeCode()) ? CoreConfig.typeCode : request.getTypeCode());
JsonObject messageObj = (JsonObject) App.getGson().toJsonTree(chatMessage);
return messageObj.toString();
}
Aggregations