Implement DCC streaming

This commit is contained in:
Ken-Håvard Lieng 2020-05-20 07:21:12 +02:00
parent 973578bb49
commit e33b9f05e4
15 changed files with 407 additions and 218 deletions

View file

@ -134,6 +134,22 @@ export default function handleSocket({
}
},
dcc_send({ server, from, filename, url }) {
const serverName = getState().servers[server]?.name || server;
dispatch(
openModal('confirm', {
question: `${from} on ${serverName} is sending you: ${filename}`,
confirmation: 'Download',
onConfirm: () => {
const a = document.createElement('a');
a.href = url;
a.click();
}
})
);
},
_connected(connected) {
dispatch(setConnected(connected));
}