diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-05-17 10:43:48 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2016-05-17 10:43:48 +0200 |
commit | 14952ba5e5ffbbbda2d0453157f03779ffbdaffb (patch) | |
tree | 2212262513d822aaeb49f91de8b21530d1159b63 /src/main/java/eu/siacs/conversations/entities | |
parent | fc5304c6feb302334d15be183d55663965a29de1 (diff) |
offer offline members to be invited again
Diffstat (limited to 'src/main/java/eu/siacs/conversations/entities')
-rw-r--r-- | src/main/java/eu/siacs/conversations/entities/MucOptions.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/MucOptions.java b/src/main/java/eu/siacs/conversations/entities/MucOptions.java index 50641f5a4..e931f5fd2 100644 --- a/src/main/java/eu/siacs/conversations/entities/MucOptions.java +++ b/src/main/java/eu/siacs/conversations/entities/MucOptions.java @@ -349,7 +349,7 @@ public class MucOptions { User user = findUserByFullJid(jid); if (user != null) { users.remove(user); - if (user.affiliation.ranks(Affiliation.MEMBER)) { + if (user.affiliation.ranks(Affiliation.MEMBER) && user.realJid != null) { user.role = Role.NONE; user.avatar = null; user.fullJid = null; @@ -417,7 +417,21 @@ public class MucOptions { } public ArrayList<User> getUsers() { - return new ArrayList<>(users); + return getUsers(true); + } + + public ArrayList<User> getUsers(boolean includeOffline) { + if (includeOffline) { + return new ArrayList<>(users); + } else { + ArrayList<User> onlineUsers = new ArrayList<>(); + for(User user : users) { + if(user.getRole().ranks(Role.PARTICIPANT)) { + onlineUsers.add(user); + } + } + return onlineUsers; + } } public List<User> getUsers(int max) { |