2017-11-20 22:18:00 +00:00
|
|
|
import * as types from './actionsTypes';
|
|
|
|
|
|
|
|
|
|
|
|
export function removeUserTyping(username) {
|
|
|
|
return {
|
|
|
|
type: types.ROOM.REMOVE_USER_TYPING,
|
|
|
|
username
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-11-21 17:09:22 +00:00
|
|
|
export function someoneTyping(data) {
|
2017-11-20 22:18:00 +00:00
|
|
|
return {
|
2017-11-21 17:09:22 +00:00
|
|
|
type: types.ROOM.SOMEONE_TYPING,
|
2017-11-20 22:18:00 +00:00
|
|
|
...data
|
|
|
|
};
|
|
|
|
}
|
2017-11-21 16:55:32 +00:00
|
|
|
|
2017-11-20 22:18:00 +00:00
|
|
|
export function addUserTyping(username) {
|
|
|
|
return {
|
|
|
|
type: types.ROOM.ADD_USER_TYPING,
|
|
|
|
username
|
|
|
|
};
|
|
|
|
}
|
2017-11-21 16:55:32 +00:00
|
|
|
|
|
|
|
export function openRoom(room) {
|
|
|
|
return {
|
|
|
|
type: types.ROOM.OPEN,
|
|
|
|
room
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-01-15 18:44:20 +00:00
|
|
|
export function closeRoom() {
|
|
|
|
return {
|
|
|
|
type: types.ROOM.CLOSE
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-03-23 16:49:51 +00:00
|
|
|
export function leaveRoom(rid) {
|
|
|
|
return {
|
|
|
|
type: types.ROOM.LEAVE,
|
|
|
|
rid
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-03-29 17:55:37 +00:00
|
|
|
export function eraseRoom(rid) {
|
|
|
|
return {
|
|
|
|
type: types.ROOM.ERASE,
|
|
|
|
rid
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-11-21 17:09:22 +00:00
|
|
|
export function userTyping(status = true) {
|
2017-11-21 16:55:32 +00:00
|
|
|
return {
|
2017-11-21 17:09:22 +00:00
|
|
|
type: types.ROOM.USER_TYPING,
|
2017-11-21 16:55:32 +00:00
|
|
|
status
|
|
|
|
};
|
|
|
|
}
|
2018-01-15 18:44:20 +00:00
|
|
|
|
|
|
|
export function roomMessageReceived(message) {
|
|
|
|
return {
|
|
|
|
type: types.ROOM.MESSAGE_RECEIVED,
|
|
|
|
message
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export function setLastOpen(date = new Date()) {
|
|
|
|
return {
|
|
|
|
type: types.ROOM.SET_LAST_OPEN,
|
|
|
|
date
|
|
|
|
};
|
|
|
|
}
|
2018-02-08 14:08:50 +00:00
|
|
|
|
|
|
|
export function layoutAnimation() {
|
|
|
|
return {
|
|
|
|
type: types.ROOM.LAYOUT_ANIMATION
|
|
|
|
};
|
|
|
|
}
|