Send the 25 last messages for each channel to the client on load

This commit is contained in:
Ken-Håvard Lieng 2017-04-20 01:51:55 +02:00
parent c840d51e16
commit eedc687f18
26 changed files with 300 additions and 268 deletions

View file

@ -1,12 +1,7 @@
import React, { PureComponent } from 'react';
export default class Message extends PureComponent {
handleSenderClick = () => {
const { message, openPrivateChat, select } = this.props;
openPrivateChat(message.server, message.from);
select(message.server, message.from, true);
};
handleNickClick = () => this.props.onNickClick(this.props.message);
render() {
const { message } = this.props;
@ -21,7 +16,7 @@ export default class Message extends PureComponent {
<p className={className} style={style}>
<span className="message-time">{message.time}</span>
{message.from &&
<span className="message-sender" onClick={this.handleSenderClick}>
<span className="message-sender" onClick={this.handleNickClick}>
{' '}{message.from}
</span>
}{' '}{message.content}