<commit_before>define(function (require, exports, module) {
    "use strict";
    var invariant = require("modules/invariant");
    var extend = require("extend");
    var eventEmitter = require("modules/events/eventEmitter");
    var serializable = require("modules/serialization/serializable");
    var model = require("mixins/model");
    var TypeFilter = require("models/filters/TypeFilter");

    function Dialog() {
        this._defineEvent("changed");

        this.profile = null;
        this.name = null;
        this.messages = [];
        this.contact = null;
        this.unreadCount = 0;

        this.typeFilter = new TypeFilter("receiver", "dialog");
        this.typeFilter.on("filtered", this._processMessage, this);
        this.typeFilter.on("unfiltered", this._onMessage, this);
    }

    extend(Dialog.prototype, eventEmitter, serializable, model, {
        setProfile: function (profile) {
            this.profile = profile;
        },

        init: function (args) {
            invariant(args.name, "Can i haz args.name?");
            this.name = args.name;
            this._onChanged();
        },

        setContact: function (contact, skipChanged) {
            if (this.contact) {
                return;
            }
            this.contact = contact;
            contact.tlConnection.on("message", this.processMessage, this);
            if (!skipChanged) {
                this._onChanged();
            }
        },

        sendMessage: function (message) {
            var msg = {
                text: message,
                sender: this.profile.name
            };
            this._pushMessage(extend({}, msg, {
                isMine: true
            }));
            this.typeFilter.unfilter(msg);
            this._onChanged();
        },

        processMessage: function (message) {
            this.typeFilter.filter(message);
        },

        processInvite: function (invite) {
            var message = {};
            message.type = "tlgr-invite";
            message.sender = invite.contact.name;
            message.inviteId = invite.id;
            message.unread = true;
            message.accepted = null;
            message.accept = (function () {
                this.accepted = true;
                invite.contact.acceptInvite(message.inviteId);
            }).bind(message);
            message.reject = (function () {
                this.accepted = false;
                this.contact.rejectInvite(this.inviteId);
            }).bind(message);
            this._pushMessage(message);
        },

        _processMessage: function (message) {<commit_msg>fix reject invite<commit_after>define(function (require, exports, module) {
    "use strict";
    var invariant = require("modules/invariant");
    var extend = require("extend");
    var eventEmitter = require("modules/events/eventEmitter");
    var serializable = require("modules/serialization/serializable");
    var model = require("mixins/model");
    var TypeFilter = require("models/filters/TypeFilter");

    function Dialog() {
        this._defineEvent("changed");

        this.profile = null;
        this.name = null;
        this.messages = [];
        this.contact = null;
        this.unreadCount = 0;

        this.typeFilter = new TypeFilter("receiver", "dialog");
        this.typeFilter.on("filtered", this._processMessage, this);
        this.typeFilter.on("unfiltered", this._onMessage, this);
    }

    extend(Dialog.prototype, eventEmitter, serializable, model, {
        setProfile: function (profile) {
            this.profile = profile;
        },

        init: function (args) {
            invariant(args.name, "Can i haz args.name?");
            this.name = args.name;
            this._onChanged();
        },

        setContact: function (contact, skipChanged) {
            if (this.contact) {
                return;
            }
            this.contact = contact;
            contact.tlConnection.on("message", this.processMessage, this);
            if (!skipChanged) {
                this._onChanged();
            }
        },

        sendMessage: function (message) {
            var msg = {
                text: message,
                sender: this.profile.name
            };
            this._pushMessage(extend({}, msg, {
                isMine: true
            }));
            this.typeFilter.unfilter(msg);
            this._onChanged();
        },

        processMessage: function (message) {
            this.typeFilter.filter(message);
        },

        processInvite: function (invite) {
            var message = {};
            message.type = "tlgr-invite";
            message.sender = invite.contact.name;
            message.inviteId = invite.id;
            message.unread = true;
            message.accepted = null;
            message.accept = (function () {
                this.accepted = true;
                invite.contact.acceptInvite(message.inviteId);
            }).bind(message);
            message.reject = (function () {
                this.accepted = false;
                invite.contact.rejectInvite(this.inviteId);
            }).bind(message);
            this._pushMessage(message);
        },

        _processMessage: function (message) {
{'fraction_non_alphanumeric': 0.12006079027355623, 'fraction_numerical': 0.00037993920972644377, 'mean_word_length': 1.7464788732394365, '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': '2314561', 'n_tokens_mistral': 1367, 'n_tokens_neox': 1331, 'n_words': 264}