use of com.fanap.podchat.chat.user.user_roles.model.ResultCurrentUserRoles in project pod-chat-android-sdk by FanapSoft.
the class UserRoles method handleOnGetUserRolesFromCache.
public static ChatResponse<ResultCurrentUserRoles> handleOnGetUserRolesFromCache(String uniqueId, RequestGetUserRoles request, CacheUserRoles cacheUserRole) {
ArrayList<String> roles = new ArrayList<>(cacheUserRole.getRole());
ResultCurrentUserRoles result = new ResultCurrentUserRoles();
result.setRoles(roles);
ChatResponse<ResultCurrentUserRoles> response = new ChatResponse<>();
response.setResult(result);
response.setUniqueId(uniqueId);
response.setSubjectId(request.getThreadId());
response.setCache(true);
return response;
}
use of com.fanap.podchat.chat.user.user_roles.model.ResultCurrentUserRoles in project pod-chat-android-sdk by FanapSoft.
the class UserRoles method handleOnGetUserRoles.
public static ChatResponse<ResultCurrentUserRoles> handleOnGetUserRoles(ChatMessage chatMessage) {
String jsonContent = chatMessage.getContent();
ArrayList<String> roles = App.getGson().fromJson(jsonContent, new TypeToken<ArrayList<String>>() {
}.getType());
ResultCurrentUserRoles result = new ResultCurrentUserRoles();
result.setRoles(roles);
ChatResponse<ResultCurrentUserRoles> response = new ChatResponse<>();
response.setResult(result);
response.setUniqueId(chatMessage.getUniqueId());
response.setSubjectId(chatMessage.getSubjectId());
return response;
}
Aggregations