 
 
 ###*
- * Orders given state's connected participants in a way that publishing users
+ * Orders given state's video participants in a way that publishing users
  * come first.
  *
  * @param {object} state

_                        = require 'lodash'
ChannelParticipantsModel = require './channelparticipants'

module.exports = class CollaborationChannelParticipantsModel extends ChannelParticipantsModel

  defaultState:
    videoActive           : no
    selectedParticipant   : null
    talkingParticipants   : []
    videoParticipants     : []
    connectedParticipants : []

  constructor: (options = {}, data) ->


###
getOrderedVideoParticipants = (state) ->

  participants = state.videoParticipants
  { PARTICIPANT_STATUS_PUBLISHING } = videoConstants

  # _.partition returns 2 arrays from 1. First array will be result of given
  # predicate function, 2nd array will be the remaining elements of original
  # array.
  [publishings, nonpublishings] = _.partition participants, (p) ->
    p.status is PARTICIPANT_STATUS_PUBLISHING

  filterList = publishings.concat nonpublishings


