remove role=none participant when first online participant joins

Daniel Gultsch created

in anticipations for muc services using registered nicks (and putting nicks
into the member list even if that user is offline) we need to remove that 'fake' user
from the online list when the real user comes online.

Change summary

src/main/java/eu/siacs/conversations/entities/MucOptions.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Detailed changes

src/main/java/eu/siacs/conversations/entities/MucOptions.java 🔗

@@ -250,12 +250,13 @@ public class MucOptions {
             old = findUserByRealJid(user.realJid);
             realJidFound = old != null;
             synchronized (users) {
-                if (old != null && old.fullJid == null) {
+                if (old != null && (old.fullJid == null || old.role == Role.NONE)) {
                     users.remove(old);
                 }
             }
         }
         old = findUserByFullJid(user.getFullJid());
+
         synchronized (this.users) {
             if (old != null) {
                 users.remove(old);