Search in sources :

Example 1 with RequestSetAdmin

use of com.fanap.podchat.requestobject.RequestSetAdmin in project pod-chat-android-sdk by FanapSoft.

the class ChatActivity method setAdminRules.

private void setAdminRules() {
    // core 1507
    // thread id 1961
    ArrayList<String> typeRoles = new ArrayList<>();
    // typeRoles.add(RoleType.Constants.THREAD_ADMIN);
    // typeRoles.add(RoleType.Constants.ADD_NEW_USER);
    // typeRoles.add(RoleType.Constants.REMOVE_USER);
    // roles to set auditor
    typeRoles.add(RoleType.Constants.READ_THREAD);
    typeRoles.add(RoleType.Constants.EDIT_THREAD);
    // typeRoles.add(RoleType.Constants.ADD_RULE_TO_USER);
    // typeRoles.add(RoleType.Constants.CHANGE_THREAD_INFO);
    // typeRoles.add(RoleType.Constants.DELETE_MESSAGE_OF_OTHERS);
    // typeRoles.add(RoleType.Constants.EDIT_MESSAGE_OF_OTHERS);
    // typeRoles.add(RoleType.Constants.POST_CHANNEL_MESSAGE);
    // typeRoles.add(RoleType.Constants.REMOVE_ROLE_FROM_USER);
    // 
    // ArrayList<String> typeRoles2 = new ArrayList<>();
    // typeRoles2.add(RoleType.Constants.REMOVE_USER);
    // typeRoles2.add(RoleType.Constants.ADD_RULE_TO_USER);
    RequestRole requestRole = new RequestRole();
    requestRole.setId(2);
    requestRole.setRoleTypes(typeRoles);
    // 
    // RequestRole requestRole2 = new RequestRole();
    // //        requestRole2.setId(41);
    // //        requestRole2.setId(123);
    // requestRole2.setRoleOperation("remove");
    // requestRole2.setRoleTypes(typeRoles2);
    ArrayList<RequestRole> requestRoles = new ArrayList<>();
    requestRoles.add(requestRole);
    // requestRoles.add(requestRole2);
    RequestSetAdmin requestAddAdmin = new RequestSetAdmin.Builder(TEST_THREAD_ID, requestRoles).build();
    presenter.setAdmin(requestAddAdmin);
}
Also used : RequestRole(com.fanap.podchat.requestobject.RequestRole) ArrayList(java.util.ArrayList) RequestSetAdmin(com.fanap.podchat.requestobject.RequestSetAdmin)

Example 2 with RequestSetAdmin

use of com.fanap.podchat.requestobject.RequestSetAdmin in project pod-chat-android-sdk by FanapSoft.

the class ChatActivity method removeAdminRules.

private void removeAdminRules() {
    ArrayList<String> typeRoles = new ArrayList<>();
    typeRoles.add(RoleType.Constants.THREAD_ADMIN);
    // typeRoles.add(RoleType.Constants.READ_THREAD);
    // typeRoles.add(RoleType.Constants.ADD_NEW_USER);
    typeRoles.add(RoleType.Constants.REMOVE_USER);
    RequestRole requestRole = new RequestRole();
    requestRole.setId(2);
    requestRole.setRoleTypes(typeRoles);
    // RequestRole requestRole2 = new RequestRole();
    // requestRole2.setId(41);
    // requestRole2.setRoleOperation("remove");
    // requestRole2.setRoleTypes(typeRoles);
    ArrayList<RequestRole> requestRoles = new ArrayList<>();
    requestRoles.add(requestRole);
    // requestRoles.add(requestRole2);
    RequestSetAdmin requestAddAdmin = new RequestSetAdmin.Builder(TEST_THREAD_ID, requestRoles).build();
    presenter.removeAdminRules(requestAddAdmin);
}
Also used : RequestRole(com.fanap.podchat.requestobject.RequestRole) ArrayList(java.util.ArrayList) RequestSetAdmin(com.fanap.podchat.requestobject.RequestSetAdmin)

Aggregations

RequestRole (com.fanap.podchat.requestobject.RequestRole)2 RequestSetAdmin (com.fanap.podchat.requestobject.RequestSetAdmin)2 ArrayList (java.util.ArrayList)2