Store file upload history on server
This commit is contained in:
+34
-1
@@ -238,6 +238,22 @@ export default class RoomClient
|
||||
});
|
||||
}
|
||||
|
||||
getFileHistory()
|
||||
{
|
||||
logger.debug('getFileHistory()');
|
||||
|
||||
return this._protoo.send('file-history', {})
|
||||
.catch((error) =>
|
||||
{
|
||||
logger.error('getFileHistory() | failed: %o', error);
|
||||
|
||||
this._dispatch(requestActions.notify({
|
||||
type: 'error',
|
||||
text: 'Could not get file history'
|
||||
}));
|
||||
})
|
||||
}
|
||||
|
||||
muteMic()
|
||||
{
|
||||
logger.debug('muteMic()');
|
||||
@@ -1177,6 +1193,22 @@ export default class RoomClient
|
||||
break;
|
||||
}
|
||||
|
||||
case 'file-history-receive':
|
||||
{
|
||||
accept();
|
||||
|
||||
const files = request.data.fileHistory;
|
||||
|
||||
if (files.length > 0)
|
||||
{
|
||||
logger.debug('Got files history');
|
||||
|
||||
this._dispatch(stateActions.addFileHistory(files));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
logger.error('unknown protoo method "%s"', request.method);
|
||||
@@ -1314,7 +1346,8 @@ export default class RoomClient
|
||||
this._dispatch(stateActions.removeAllNotifications());
|
||||
|
||||
this.getChatHistory();
|
||||
|
||||
this.getFileHistory();
|
||||
|
||||
this._dispatch(requestActions.notify(
|
||||
{
|
||||
text : 'You are in the room',
|
||||
|
||||
@@ -8,6 +8,9 @@ const sharing = (state = [], action) =>
|
||||
case 'ADD_FILE':
|
||||
return [ ...state, action.payload ];
|
||||
|
||||
case 'ADD_FILE_HISTORY':
|
||||
return [ ...action.payload.fileHistory, ...state ];
|
||||
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -449,6 +449,14 @@ export const addFile = (payload) =>
|
||||
};
|
||||
};
|
||||
|
||||
export const addFileHistory = (fileHistory) =>
|
||||
{
|
||||
return {
|
||||
type: 'ADD_FILE_HISTORY',
|
||||
payload: { fileHistory }
|
||||
};
|
||||
};
|
||||
|
||||
export const setPicture = (picture) =>
|
||||
({
|
||||
type : 'SET_PICTURE',
|
||||
|
||||
Reference in New Issue
Block a user