protected synchronized List<User> modsListReceived(String channel,List<String> modsList){
  Map<String,User> usersToDemod=getUsersByChannel(channel);
  for (  User user : usersToDemod.values()) {
    user.setModerator(false);
  }
  LOGGER.info("Setting users as mod for " + channel + ": "+ modsList);
  List<User> changedUsers=new ArrayList<>();
  for (  String userName : modsList) {
    if (Helper.validateChannel(userName)) {
      User user=getUser(channel,userName);
      if (user.setModerator(true)) {
        userUpdated(user);
      }
      changedUsers.add(user);
    }
  }
  return changedUsers;
}

protected synchronized List < User > modsListReceived ( String channel , List < String > modsList ) { Map < String , User > usersToDemod = getUsersByChannel ( channel ) ; for ( User user : usersToDemod . values ( ) ) { user . setModerator ( false ) ; } LOGGER . info ( "Setting users as mod for " + channel + ": " + modsList ) ; List < User > changedUsers = new ArrayList < > ( ) ; for ( String userName : modsList ) { if ( Helper . validateChannel ( userName ) ) { User user = getUser ( channel , userName ) ; if ( user . setModerator ( true ) ) { userUpdated ( user ) ; } changedUsers . add ( user ) ; } } return changedUsers ; }
the list of mods received with channel context , set the containing names as mod . returns the changed users so they can be updated in the gui .
