   isMember       = -> 'member' in roles
   canListMembers = -> 'list members' in permissions
   isPrivateGroup = -> not isKoding() and isGroup()
-  extractName    = (data) -> data.name or data.profile.nickname
 
 
   constructor:(options = {}, data)->


  createTab: (data) ->

    name      = extractName data
    type      = data.typeConstant
    channelId = data.id

    @tabs.addPane pane = new MessagePane {name, type, channelId}, data


  sidebarItemClicked: (item) ->

    data = item.getData()
    pane = @tabs.getPaneByName "#{data.id}"

    if pane and pane is @tabs.getActivePane()
    then pane.refresh()
