docs: private void checkAffiliationModifications(
          MUCAffiliation oldAffiliation,
          MUCAffiliation newAffiliation,
          boolean isUserModification,
          EntityFullJid from) {
          // First check for revoked affiliation and then for granted affiliations. The idea is to
          // first fire the "revoke" events and then fire the "grant" events.
  
          // The user's ownership to the room was revoked
          if (MUCAffiliation.owner.equals(oldAffiliation) && !MUCAffiliation.owner.equals(newAffiliation)) {
              if (isUserModification) {
                  for (UserStatusListener listener : userStatusListeners) {
                      listener.ownershipRevoked();
                  }
              }
              else {
                  for (ParticipantStatusListener listener : participantStatusListeners) {
                      listener.ownershipRevoked(from);
                  }
              }
          }
          // The user's administrative privileges to the room were revoked
          else if (MUCAffiliation.admin.equals(oldAffiliation) && !MUCAffiliation.admin.equals(newAffiliation)) {
              if (isUserModification) {
                  for (UserStatusListener listener : userStatusListeners) {
                      listener.adminRevoked();
                  }
              }
              else {
                  for (ParticipantStatusListener listener : participantStatusListeners) {
                      listener.adminRevoked(from);
                  }
              }
          }
          // The user's membership to the room was revoked
          else if (MUCAffiliation.member.equals(oldAffiliation) && !MUCAffiliation.member.equals(newAffiliation)) {
              if (isUserModification) {
                  for (UserStatusListener listener : userStatusListeners) {
                      listener.membershipRevoked();
                  }
              }
              else {
                  for (ParticipantStatusListener listener : participantStatusListeners) {
                      listener.membershipRevoked(from);
                  }
              }
          }
  
          // The user was granted ownership to the room
          if (!MUCAffiliation.owner.equals(oldAffiliation) && MUCAffiliation.owner.equals(newAffiliation)) {
              if (isUserModification) {
                  for (UserStatusListener listener : userStatusListeners) {
                      listener.ownershipGranted();
                  }
              }
              else {
                  for (ParticipantStatusListener listener : participantStatusListeners) {
                      listener.ownershipGranted(from);
                  }
              }
          }
          // The user was granted administrative privileges to the room
          else if (!MUCAffiliation.admin.equals(oldAffiliation) && MUCAffiliation.admin.equals(newAffiliation)) {
              if (isUserModification) {
                  for (UserStatusListener listener : userStatusListeners) {
                      listener.adminGranted();
                  }
              }
              else {
                  for (ParticipantStatusListener listener : participantStatusListeners) {
                      listener.adminGranted(from);
                  }
              }
          }
          // The user was granted membership to the room
          else if (!MUCAffiliation.member.equals(oldAffiliation) && MUCAffiliation.member.equals(newAffiliation)) {
              if (isUserModification) {
                  for (UserStatusListener listener : userStatusListeners) {
                      listener.membershipGranted();
                  }
              }
              else {
                  for (ParticipantStatusListener listener : participantStatusListeners) {
                      listener.membershipGranted(from);
                  }
              }
          }
      }