<commit_before>var ioClient = require('socket.io-client')
  , inherits = require('util').inherits
  , EventEmitter = require('events').EventEmitter
  , uriToBuffer = require('data-uri-to-buffer')

module.exports = function(server) {
  return new MeatspaceProxy(server)
}

var socketOptions = { 'max reconnection attempts': 1000 }

inherits(MeatspaceProxy, EventEmitter)
function MeatspaceProxy(server) {
  EventEmitter.call(this)
  this.socket = ioClient(server, socketOptions)
  this.connected = false
  this.awaiting = new IdMap()
  this.partials = new PartialMediaMap()
  this.dropping = new PartialDropMap()
  this.lastMessageTime = 0

  var self = this
  this.socket.on('connect', function() {
    self.connected = true
    self.emit('connect')

    self.socket.emit('join', 'webm')
    self.socket.emit('join', 'mp4')
  }).on('connect_error', function(err) {
    self.emit('connect_error', err)
  }).on('connect_timeout', function() {
    self.emit('connect_timeout')
  }).on('disconnect', function() {
    self.connected = false
    self.emit('disconnect')
  }).on('messageack', function(err, ackData) {
    if (err) return

    self.awaiting.inc(ackData.userId)
  }).on('message', function(chat) {
    // never replay messages we've already seen
    if (this.lastMessageTime > chat.created) return

    self.onMessage(chat)
  }).on('active', function(data) {<commit_msg>Fix meatspace-proxies handling of previously seen messages,  don't utilize meatspace backscroll to avoid replaying meatspace versions of seatcamp messages.<commit_after>var ioClient = require('socket.io-client')
  , inherits = require('util').inherits
  , EventEmitter = require('events').EventEmitter
  , uriToBuffer = require('data-uri-to-buffer')

module.exports = function(server) {
  return new MeatspaceProxy(server)
}

var socketOptions = { 'max reconnection attempts': 1000 }

inherits(MeatspaceProxy, EventEmitter)
function MeatspaceProxy(server) {
  EventEmitter.call(this)
  this.socket = ioClient(server, socketOptions)
  this.connected = false
  this.awaiting = new IdMap()
  this.partials = new PartialMediaMap()
  this.dropping = new PartialDropMap()
  this.lastMessageTime = Date.now()

  var self = this
  this.socket.on('connect', function() {
    self.connected = true
    self.emit('connect')

    self.socket.emit('join', 'webm')
    self.socket.emit('join', 'mp4')
  }).on('connect_error', function(err) {
    self.emit('connect_error', err)
  }).on('connect_timeout', function() {
    self.emit('connect_timeout')
  }).on('disconnect', function() {
    self.connected = false
    self.emit('disconnect')
  }).on('messageack', function(err, ackData) {
    if (err) return

    self.awaiting.inc(ackData.userId)
  }).on('message', function(chat) {
    // never replay messages we've already seen
    if (self.lastMessageTime > chat.created) return

    self.onMessage(chat)
  }).on('active', function(data) {
{'fraction_non_alphanumeric': 0.14619883040935672, 'fraction_numerical': 0.003783969728242174, 'mean_word_length': 4.435514018691589, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1422052', 'n_tokens_mistral': 918, 'n_tokens_neox': 904, 'n_words': 192}