use of com.fanap.podchat.chat.assistant.model.AssistantVo in project pod-chat-android-sdk by FanapSoft.
the class ChatTestIntegration method deActiveAssistantTest.
@Test
@LargeTest
public void deActiveAssistantTest() {
long startTime = System.currentTimeMillis();
ChatListener historyListeners = new ChatListener() {
@Override
public void onDeActiveAssistant(ChatResponse<List<AssistantVo>> response) {
System.out.println("onDeActiveAssistant: " + response);
Assert.assertTrue(true);
resumeProcess();
}
};
chat.addListener(historyListeners);
deActiveAssistant();
}
use of com.fanap.podchat.chat.assistant.model.AssistantVo in project pod-chat-android-sdk by FanapSoft.
the class ChatTestIntegration method registerAssistant.
private void registerAssistant() {
// 63253 kheirkhah
// 63254 sajadi
// //63255 anvari
// 63256 amjadi
// 63257 zhiani
// invite list
// 52987 khodam
// 103187 nemati
Invitee invite = new Invitee("63253", InviteType.Constants.TO_BE_USER_CONTACT_ID);
// roles
ArrayList<String> typeRoles = new ArrayList<>();
typeRoles.add(RoleType.Constants.READ_THREAD);
typeRoles.add(RoleType.Constants.EDIT_THREAD);
typeRoles.add(RoleType.Constants.ADD_ROLE_TO_USER);
List<AssistantVo> assistantVos = new ArrayList<>();
AssistantVo assistantVo = new AssistantVo();
assistantVo.setInvitees(invite);
assistantVo.setContactType("default");
assistantVo.setRoles(typeRoles);
assistantVos.add(assistantVo);
RegisterAssistantRequest request = new RegisterAssistantRequest.Builder(assistantVos).build();
presenter.registerAssistant(request);
pauseProcess();
}
use of com.fanap.podchat.chat.assistant.model.AssistantVo in project pod-chat-android-sdk by FanapSoft.
the class ChatActivity method registerAssistant.
private void registerAssistant() {
// 63263 kheirkhah
// //63264 anvari
// 63254 sajadi
// 63256 amjadi
// 63257 zhiani
// invite list
// 103187 nemati sandbox
// 52987 sajadi 9063 sandbox
Invitee invite = new Invitee("63256", InviteType.Constants.TO_BE_USER_CONTACT_ID);
// roles
ArrayList<String> typeRoles = new ArrayList<>();
typeRoles.add(RoleType.Constants.REMOVE_ROLE_FROM_USER);
List<AssistantVo> assistantVos = new ArrayList<>();
AssistantVo assistantVo = new AssistantVo();
assistantVo.setInvitees(invite);
assistantVo.setContactType("default");
assistantVo.setRoles(typeRoles);
assistantVos.add(assistantVo);
RegisterAssistantRequest request = new RegisterAssistantRequest.Builder(assistantVos).build();
presenter.registerAssistant(request);
}
use of com.fanap.podchat.chat.assistant.model.AssistantVo in project pod-chat-android-sdk by FanapSoft.
the class MessageDatabaseHelper method getCacheAssistantVos.
public void getCacheAssistantVos(GetAssistantRequest request, FunctionalListener callback) throws RoomIntegrityException {
if (!canUseDatabase())
throw new RoomIntegrityException();
worker(() -> {
List<CacheAssistantVo> list = messageDao.getCacheAssistantVos(request.getCount() > 0 ? request.getCount() : 25, request.getOffset());
List<AssistantVo> cachResponseList = new ArrayList<>();
for (CacheAssistantVo item : list) {
AssistantVo assistantVo = new AssistantVo();
assistantVo.setRoles((ArrayList<String>) item.getRoles());
assistantVo.setBlock(item.isBlock());
assistantVo.setContactType(item.getContactType());
Participant participant = cacheToParticipantMapper(messageDao.getParticipant(item.getParticipantVOId()), false, null);
ChatProfileVO profileVO = messageDao.getChatProfileVOById(participant.getId());
participant.setChatProfileVO(profileVO);
assistantVo.setParticipantVO(participant);
cachResponseList.add(assistantVo);
}
callback.onWorkDone(list.size(), cachResponseList);
});
}
use of com.fanap.podchat.chat.assistant.model.AssistantVo in project pod-chat-android-sdk by FanapSoft.
the class MessageDatabaseHelper method getCacheBlockedAssistantVos.
public void getCacheBlockedAssistantVos(GetBlockedAssistantsRequest request, FunctionalListener callback) throws RoomIntegrityException {
if (!canUseDatabase())
throw new RoomIntegrityException();
worker(() -> {
List<CacheAssistantVo> list = messageDao.getCacheBlockedAssistantVos(request.getCount() > 0 ? request.getCount() : 25, request.getOffset());
List<AssistantVo> cacheResponseList = new ArrayList<>();
for (CacheAssistantVo item : list) {
AssistantVo assistantVo = new AssistantVo();
assistantVo.setRoles((ArrayList<String>) item.getRoles());
assistantVo.setBlock(item.isBlock());
assistantVo.setContactType(item.getContactType());
Participant participant = cacheToParticipantMapper(messageDao.getParticipant(item.getParticipantVOId()), false, null);
ChatProfileVO profileVO = messageDao.getChatProfileVOById(participant.getId());
participant.setChatProfileVO(profileVO);
assistantVo.setParticipantVO(participant);
cacheResponseList.add(assistantVo);
}
callback.onWorkDone(list.size(), cacheResponseList);
});
}
Aggregations