<commit_before>import {
  RPL_LISTSTART,
  RPL_LIST,
  RPL_LISTEND
} from '../replies'

export default function list ({ user, server, parameters: [ channels ] }) {
  const mask = server.mask()

  channels = channels ? channels.split(',') : Object.keys(server.channels)

  user.send(mask, RPL_LISTSTART, [ user.nickname, 'Channel', 'Users  Name' ])

  channels
    .map(server.findChannel, server)
    .forEach((chan) => {
      user.send(mask, RPL_LIST,
                [ user.nickname, chan.name, chan.users.length, chan.topic || '' ])
    })

  user.send(mask, RPL_LISTEND, [ user.nickname, 'End of /LIST' ])
}<commit_msg>/LIST: hide private and secret channels<commit_after>import {
  RPL_LISTSTART,
  RPL_LIST,
  RPL_LISTEND
} from '../replies'

export default function list ({ user, server, parameters: [ channels ] }) {
  const mask = server.mask()

  channels = channels ? channels.split(',') : Object.keys(server.channels)

  user.send(mask, RPL_LISTSTART, [ user.nickname, 'Channel', 'Users  Name' ])

  channels
    .map(server.findChannel, server)
    .filter((chan) => !chan.isSecret() || chan.hasUser(user))
    .forEach((chan) => {
      let response = [ user.nickname, chan.name, chan.users.length, chan.topic || '' ]
      if (chan.isPrivate() && !chan.hasUser(user)) {
        response = [ user.nickname, 'Prv', chan.users.length, '' ]
      }
      user.send(mask, RPL_LIST, response)
    })

  user.send(mask, RPL_LISTEND, [ user.nickname, 'End of /LIST' ])
}
{'fraction_non_alphanumeric': 0.16441136671177267, 'fraction_numerical': 0.0, 'mean_word_length': 3.4017857142857144, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5070447', 'n_tokens_mistral': 518, 'n_tokens_neox': 501, 'n_words': 104}