Send the 25 last messages for each channel to the client on load
This commit is contained in:
parent
c840d51e16
commit
eedc687f18
26 changed files with 300 additions and 268 deletions
|
@ -5,10 +5,13 @@ import * as actions from '../actions';
|
|||
|
||||
const Tab = Record({
|
||||
server: null,
|
||||
channel: null,
|
||||
user: null
|
||||
name: null
|
||||
});
|
||||
|
||||
Tab.prototype.isChannel = function isChannel() {
|
||||
return this.name && this.name.charAt(0) === '#';
|
||||
};
|
||||
|
||||
const State = Record({
|
||||
selected: new Tab(),
|
||||
history: List()
|
||||
|
@ -24,13 +27,13 @@ export default createReducer(new State(), {
|
|||
|
||||
[actions.PART](state, action) {
|
||||
return state.set('history', state.history.filter(tab =>
|
||||
!(tab.server === action.server && tab.channel === action.channels[0])
|
||||
!(tab.server === action.server && tab.name === action.channels[0])
|
||||
));
|
||||
},
|
||||
|
||||
[actions.CLOSE_PRIVATE_CHAT](state, action) {
|
||||
return state.set('history', state.history.filter(tab =>
|
||||
!(tab.server === action.server && tab.user === action.nick)
|
||||
!(tab.server === action.server && tab.name === action.nick)
|
||||
));
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue