<commit_before>import _ from 'lodash';

import React from 'react';
import { PureRenderMixin } from 'react/addons';

import memoize from 'memoizee';
import classNames from 'classnames';
import emojify from 'emojify.js';
import hljs from 'highlight.js';
import marked from 'marked';
import emojiCharacters from 'emoji-named-characters';
import Lightbox from 'jsonlylightbox';

import VisibilitySensor from 'react-visibility-sensor';

import AvatarItem from 'components/common/AvatarItem.react';

import DialogActionCreators from 'actions/DialogActionCreators';
import { MessageContentTypes } from 'constants/ActorAppConstants';

let lastMessageSenderId,
    lastMessageContentType;

var MessageItem = React.createClass({
  displayName: 'MessageItem',

  propTypes: {
    message: React.PropTypes.object.isRequired,
    newDay: React.PropTypes.bool,
    onVisibilityChange: React.PropTypes.func
  },

  mixins: [PureRenderMixin],

  onClick() {
    DialogActionCreators.selectDialogPeerUser(this.props.message.sender.peer.id);
  },

  onVisibilityChange(isVisible) {
    this.props.onVisibilityChange(this.props.message, isVisible);
  },

  render() {
    const message = this.props.message;
    const newDay = this.props.newDay;

    let header,
        visibilitySensor,
        leftBlock;

    let isSameSender = message.sender.peer.id === lastMessageSenderId &&
                       lastMessageContentType !== MessageContentTypes.SERVICE &&
                       !newDay;

    let messageClassName = classNames({
      'message': true,
      'row': true,
      'message--same-sender': isSameSender
    });

    if (isSameSender) {<commit_msg>fix(web): fix same sender service messages;<commit_after>import _ from 'lodash';

import React from 'react';
import { PureRenderMixin } from 'react/addons';

import memoize from 'memoizee';
import classNames from 'classnames';
import emojify from 'emojify.js';
import hljs from 'highlight.js';
import marked from 'marked';
import emojiCharacters from 'emoji-named-characters';
import Lightbox from 'jsonlylightbox';

import VisibilitySensor from 'react-visibility-sensor';

import AvatarItem from 'components/common/AvatarItem.react';

import DialogActionCreators from 'actions/DialogActionCreators';
import { MessageContentTypes } from 'constants/ActorAppConstants';

let lastMessageSenderId,
    lastMessageContentType;

var MessageItem = React.createClass({
  displayName: 'MessageItem',

  propTypes: {
    message: React.PropTypes.object.isRequired,
    newDay: React.PropTypes.bool,
    onVisibilityChange: React.PropTypes.func
  },

  mixins: [PureRenderMixin],

  onClick() {
    DialogActionCreators.selectDialogPeerUser(this.props.message.sender.peer.id);
  },

  onVisibilityChange(isVisible) {
    this.props.onVisibilityChange(this.props.message, isVisible);
  },

  render() {
    const message = this.props.message;
    const newDay = this.props.newDay;

    let header,
        visibilitySensor,
        leftBlock;

    let isSameSender = message.sender.peer.id === lastMessageSenderId &&
                       lastMessageContentType !== MessageContentTypes.SERVICE &&
                       message.content.content !== MessageContentTypes.SERVICE &&
                       !newDay;

    let messageClassName = classNames({
      'message': true,
      'row': true,
      'message--same-sender': isSameSender
    });

    if (isSameSender) {
{'fraction_non_alphanumeric': 0.1045828437132785, 'fraction_numerical': 0.0, 'mean_word_length': 3.822946175637394, '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': '6021747', 'n_tokens_mistral': 993, 'n_tokens_neox': 971, 'n_words': 219}