/** * Tells if an user is in the ignored user ids list * * @param userId the user id to test * @return true if the user is ignored */ public boolean isUserIgnored(String userId) { if (null != userId) { return getDataHandler().getIgnoredUserIds().indexOf(userId) >= 0; } return false; }
/** * Ignore a list of users. * * @param userIds the user ids list to ignore * @param callback the result callback */ public void ignoreUsers(List<String> userIds, ApiCallback<Void> callback) { List<String> curUserIdsToIgnore = getDataHandler().getIgnoredUserIds(); List<String> userIdsToIgnore = new ArrayList<>(getDataHandler().getIgnoredUserIds()); // something to add if ((null != userIds) && (userIds.size() > 0)) { // add the new one for (String userId : userIds) { if (userIdsToIgnore.indexOf(userId) < 0) { userIdsToIgnore.add(userId); } } // some items have been added if (curUserIdsToIgnore.size() != userIdsToIgnore.size()) { updateUsers(userIdsToIgnore, callback); } } }
/** * Unignore a list of users. * * @param userIds the user ids list to unignore * @param callback the result callback */ public void unIgnoreUsers(List<String> userIds, ApiCallback<Void> callback) { List<String> curUserIdsToIgnore = getDataHandler().getIgnoredUserIds(); List<String> userIdsToIgnore = new ArrayList<>(getDataHandler().getIgnoredUserIds()); // something to add if ((null != userIds) && (userIds.size() > 0)) { // add the new one for (String userId : userIds) { userIdsToIgnore.remove(userId); } // some items have been added if (curUserIdsToIgnore.size() != userIdsToIgnore.size()) { updateUsers(userIdsToIgnore, callback); } } }
List<String> curIgnoredUsers = getIgnoredUserIds();