Search in sources :

Example 1 with CacheUserRoles

use of com.fanap.podchat.chat.user.user_roles.model.CacheUserRoles in project pod-chat-android-sdk by FanapSoft.

the class MessageDatabaseHelper method saveCurrentUserRoles.

public void saveCurrentUserRoles(ChatResponse<ResultCurrentUserRoles> response) {
    worker(() -> {
        long threadId = response.getSubjectId();
        List<String> roles = response.getResult().getRoles();
        CacheUserRoles cacheUserRoles = new CacheUserRoles();
        cacheUserRoles.setThreadId(threadId);
        cacheUserRoles.setRole(roles);
        messageDao.insertCurrentUserRoles(cacheUserRoles);
    });
}
Also used : CacheUserRoles(com.fanap.podchat.chat.user.user_roles.model.CacheUserRoles)

Example 2 with CacheUserRoles

use of com.fanap.podchat.chat.user.user_roles.model.CacheUserRoles in project pod-chat-android-sdk by FanapSoft.

the class MessageDatabaseHelper method getCurrentUserRoles.

public void getCurrentUserRoles(RequestGetUserRoles request, OnWorkDone listener) {
    worker(() -> {
        CacheUserRoles role = messageDao.getUserRoles(request.getThreadId());
        listener.onWorkDone(role);
    });
}
Also used : CacheUserRoles(com.fanap.podchat.chat.user.user_roles.model.CacheUserRoles)

Aggregations

CacheUserRoles (com.fanap.podchat.chat.user.user_roles.model.CacheUserRoles)2