 _                        = require 'lodash'
 ChannelParticipantsModel = require './channelparticipants'
+videoConstants = require 'app/videocollaboration/constants'
 
 module.exports = class CollaborationChannelParticipantsModel extends ChannelParticipantsModel
 
   defaultState:
-    videoActive           : no
-    selectedParticipant   : null
-    talkingParticipants   : []
-    videoParticipants     : []
-    connectedParticipants : []
+    videoActive         : no
+    selectedParticipant : null
+    talkingParticipants : []
+    videoParticipants   : []
 
   constructor: (options = {}, data) ->
 



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

###
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


