use of com.fanap.podchat.mainmodel.UserRoleVO in project pod-chat-android-sdk by FanapSoft.
the class ThreadManager method prepareSetRoleRequest.
public static String prepareSetRoleRequest(SetRuleVO request, String uniqueId, String mtypecode, String token, String TOKEN_ISSUER) {
ArrayList<UserRoleVO> userRoleVOS = new ArrayList<>();
for (RequestRole requestRole : request.getRoles()) {
UserRoleVO userRoleVO = new UserRoleVO();
userRoleVO.setUserId(requestRole.getId());
userRoleVO.setRoles(requestRole.getRoleTypes());
userRoleVOS.add(userRoleVO);
}
ChatMessage chatMessage = new ChatMessage();
chatMessage.setContent(App.getGson().toJson(userRoleVOS));
chatMessage.setSubjectId(request.getThreadId());
chatMessage.setToken(token);
chatMessage.setType(ChatMessageType.Constants.SET_ROLE_TO_USER);
chatMessage.setTokenIssuer(TOKEN_ISSUER);
chatMessage.setUniqueId(uniqueId);
chatMessage.setTypeCode(mtypecode);
return App.getGson().toJson(chatMessage);
}
use of com.fanap.podchat.mainmodel.UserRoleVO in project pod-chat-android-sdk by FanapSoft.
the class ThreadManager method prepareRemoveRoleRequest.
public static String prepareRemoveRoleRequest(SetRuleVO request, String uniqueId, String mtypecode, String token, String TOKEN_ISSUER) {
ArrayList<UserRoleVO> userRoleVOS = new ArrayList<>();
for (RequestRole requestRole : request.getRoles()) {
UserRoleVO userRoleVO = new UserRoleVO();
userRoleVO.setUserId(requestRole.getId());
userRoleVO.setRoles(requestRole.getRoleTypes());
userRoleVOS.add(userRoleVO);
}
ChatMessage chatMessage = new ChatMessage();
chatMessage.setContent(App.getGson().toJson(userRoleVOS));
chatMessage.setSubjectId(request.getThreadId());
chatMessage.setToken(token);
chatMessage.setType(ChatMessageType.Constants.REMOVE_ROLE_FROM_USER);
chatMessage.setTokenIssuer(TOKEN_ISSUER);
chatMessage.setUniqueId(uniqueId);
chatMessage.setTypeCode(mtypecode);
return App.getGson().toJson(chatMessage);
}
Aggregations