<commit_before>## this is the contructor for the global object that when initialized
## executes all neccesary operations to get this train moving.
Parley = (window.Parley ||= {})

Parley.initalizers = []

Parley.onInit = (fn) ->
  @initalizers.push(fn)

class Parley.app

  constructor: ->
    @current_users = []
    @open_conversations = []
    @conversations = []


    ## listen for persistent conversations from the server on load.
    ## will be sent in one at a time from redis on load.
    @server.on 'persistent_convo', @load_persistent_convo

    ## insert script for google plus signin
    do ->
      var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true
      po.src = 'https://apis.google.com/js/client:plusone.js'
      var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s)

    ## runs each init function
    init(this) for init in Parley.initializers


  server: io.connect('wss://' + window.location.hostname)


    initializers.push(func)


  load_persistent_convo: (convo_key, messages) ->
    ## takes convo_key and converts to convo_partners for conversation creation
    convo_members = convo_key.split(',')
    for id in convo_members
      if id isnt @app.me.image_url
        convo_partners += id

    ## create new conversation object from persistent conversation info
    convo = new Conversation(convo_partners, messages)
    @conversations.push(convo)

<commit_msg>add loading of online users on login<commit_after>## this is the contructor for the global object that when initialized
## executes all neccesary operations to get this train moving.
Parley = (window.Parley ||= {})

Parley.initalizers = []

Parley.onInit = (fn) ->
  @initalizers.push(fn)

class Parley.app

  constructor: ->
    @current_users = []
    @open_conversations = []
    @conversations = []


    ## listen for persistent conversations from the server on load.
    ## will be sent in one at a time from redis on load.
    @server.on 'persistent_convo', @load_persistent_convo

    ## listens for current users array from server
    @server.on 'current_users', @load_current_users

    ## insert script for google plus signin
    do ->
      var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true
      po.src = 'https://apis.google.com/js/client:plusone.js'
      var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s)

    ## runs each init function
    init(this) for init in Parley.initializers


  server: io.connect('wss://' + window.location.hostname)


    initializers.push(func)


  load_persistent_convo: (convo_key, messages) ->
    ## takes convo_key and converts to convo_partners for conversation creation
    convo_members = convo_key.split(',')
    for id in convo_members
      if id isnt @app.me.image_url
        convo_partners += id

    ## create new conversation object from persistent conversation info
    convo = new Conversation(convo_partners, messages)
    @conversations.push(convo)



  load_current_users: (logged_on) ->
    ## recieves current users from server on login
    @current_users = logged_on
    for user in @current_users
      if user.image_url is @me.image_url
        @current_users.splice(i,1)
{'fraction_non_alphanumeric': 0.10256410256410256, 'fraction_numerical': 0.0009157509157509158, 'mean_word_length': 3.489041095890411, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, 'https://': 2, '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': '6312540', 'n_tokens_mistral': 1020, 'n_tokens_neox': 992, 'n_words': 292}