<commit_before>/*global app, $*/
"use strict";

var HumanModel = require('human-model');

module.exports = HumanModel.define({
    initialize: function () {
        var self = this;
        $(window).blur(function () {
            self.focused = false;
        });
        $(window).focus(function () {
            self.focused = true;
            self.markActive();
        });
        if (window.macgap) {
            document.addEventListener('sleep', function () {
                clearTimeout(this.idleTimer);
                self.markInactive();
            }, true);
        }

        this.markActive();
    },
    session: {
        focused: ['bool', true, true],
        active: ['bool', true, false],
        connected: ['bool', true, false],
        hasConnected: ['bool', true, false],
        idleTimeout: ['number', true, 600000],
        idleSince: 'date',<commit_msg>Reset unread count for active contact on focus.<commit_after>/*global app, $, me*/
"use strict";

var HumanModel = require('human-model');

module.exports = HumanModel.define({
    initialize: function () {
        var self = this;
        $(window).blur(function () {
            self.focused = false;
        });
        $(window).focus(function () {
            self.focused = true;
            if (me._activeContact) {
                me.setActiveContact(me._activeContact);
            }
            self.markActive();
        });
        if (window.macgap) {
            document.addEventListener('sleep', function () {
                clearTimeout(this.idleTimer);
                console.log('went to sleep');
                self.markInactive();
            }, true);
        }

        this.markActive();
    },
    session: {
        focused: ['bool', true, true],
        active: ['bool', true, false],
        connected: ['bool', true, false],
        hasConnected: ['bool', true, false],
        idleTimeout: ['number', true, 600000],
        idleSince: 'date',
{'fraction_non_alphanumeric': 0.15109749872383868, 'fraction_numerical': 0.006125574272588055, 'mean_word_length': 1.8405797101449275, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1747939', 'n_tokens_mistral': 541, 'n_tokens_neox': 519, 'n_words': 117}