From 296fe9543ac10defd05d9deeb52e5b8f9546a547 Mon Sep 17 00:00:00 2001 From: cha0s Date: Mon, 14 Dec 2020 12:18:00 -0600 Subject: [PATCH] feat: edit/remove --- app/.neutrinorc.js | 7 + app/package.json | 2 + .../react/components/chat/messages/index.jsx | 3 + .../messages/message/moderation/index.jsx | 23 +- app/src/react/components/dispatcher.jsx | 5 + app/yarn.lock | 542 ++++++++++++++++-- packages/chat/src/client/effects.js | 6 + packages/chat/src/client/index.js | 4 +- packages/chat/src/client/state.js | 6 +- packages/chat/src/index.js | 2 + packages/chat/src/packets/message-edit.js | 30 + .../chat/src/packets/message-edit.server.js | 32 ++ packages/chat/src/replace-message.js | 7 +- packages/chat/src/state.js | 1 + 14 files changed, 620 insertions(+), 50 deletions(-) create mode 100644 packages/chat/src/packets/message-edit.js create mode 100644 packages/chat/src/packets/message-edit.server.js diff --git a/app/.neutrinorc.js b/app/.neutrinorc.js index d993083..cb5ed4b 100644 --- a/app/.neutrinorc.js +++ b/app/.neutrinorc.js @@ -2,6 +2,7 @@ require('dotenv/config'); const airbnb = require('@neutrinojs/airbnb'); const clean = require('@neutrinojs/clean'); +const copy = require('@neutrinojs/copy'); const mocha = require('@neutrinojs/mocha'); const node = require('@neutrinojs/node'); const {EnvironmentPlugin} = require('webpack'); @@ -21,6 +22,12 @@ module.exports = { clean({ cleanOnceBeforeBuildPatterns: ['**/*.hot-update.*'], }), + copy({ + patterns: ['flakes.png'].map((path) => ({ + from: `src/assets/${path}`, + to: 'assets', + })), + }), mocha(), node(), (neutrino) => { diff --git a/app/package.json b/app/package.json index 9cbb35d..5fd6fb2 100644 --- a/app/package.json +++ b/app/package.json @@ -26,6 +26,7 @@ "@reddichat/app": "^1.0.0", "@reddichat/chat": "^1.0.0", "@reddichat/core": "^1.0.0", + "@reddichat/fun": "^1.0.0", "@reddichat/state": "^1.0.0", "@reddichat/user": "^1.0.0", "@reduxjs/toolkit": "^1.5.0", @@ -48,6 +49,7 @@ "devDependencies": { "@neutrinojs/airbnb": "^9.1.0", "@neutrinojs/clean": "^9.1.0", + "@neutrinojs/copy": "^9.1.0", "@neutrinojs/mocha": "^9.1.0", "@neutrinojs/node": "^9.1.0", "babel-plugin-webpack-alias": "^2.1.2", diff --git a/app/src/react/components/chat/messages/index.jsx b/app/src/react/components/chat/messages/index.jsx index 623655e..97c9ce6 100644 --- a/app/src/react/components/chat/messages/index.jsx +++ b/app/src/react/components/chat/messages/index.jsx @@ -32,6 +32,9 @@ export default function Messages() { if (-1 !== blocked.indexOf(message.owner)) { return null; } + if (!message.message) { + return null; + } const $message = ( isModOfSelector(state, renderChannel(channel))); const socket = useSocket(); const actions = []; + if (isMod || isAdmin) { + actions.push(['🗑️', 'Remove', () => { + dispatch(submitMessageEdit({uuid, edit: ''})); + }]); + } if (isAdmin && (id === owner || 0 === owner)) { actions.push(['👑', 'Toggle admin distinction', () => { dispatch(submitMessageDistinction({uuid, distinction: ADMIN})); @@ -40,7 +53,7 @@ export default function Moderation(props) { socket.send(['MessageSiteBan', uuid]); }]); } - if (isMod && !isAnonymous) { + if (isMod) { actions.push(['🚫', 'Channel ban', () => { socket.send(['MessageChannelBan', uuid]); }]); diff --git a/app/src/react/components/dispatcher.jsx b/app/src/react/components/dispatcher.jsx index 08f5eab..cec58d9 100644 --- a/app/src/react/components/dispatcher.jsx +++ b/app/src/react/components/dispatcher.jsx @@ -3,6 +3,7 @@ import {useDispatch, useSelector} from 'react-redux'; import {useSocketPacket} from '@latus/socket/client'; import { addMessage, + editMessage, joined, left, toggleMessageDistinction, @@ -49,6 +50,10 @@ export default function Dispatcher() { dispatch(toggleMessageDistinction(packet.data)); break; } + case 'MessageEdit': { + dispatch(editMessage(packet.data)); + break; + } case 'Join': { dispatch(joined(packet.data)); break; diff --git a/app/yarn.lock b/app/yarn.lock index fc9d3a9..9c8420b 100644 --- a/app/yarn.lock +++ b/app/yarn.lock @@ -924,8 +924,8 @@ "@latus/governor@^1.0.0": version "1.0.0" - resolved "https://npm.i12e.cha0s.io/@latus%2fgovernor/-/governor-1.0.0.tgz#4043027c7173cb2558fc00ba40f5dca25e676d86" - integrity sha512-QXeyWZvVmddstX9bHindqMMfl9jAKX+LvOq/47Zq9pqe5b5Cl/rxYKlUH2gwVbEH99I4wrXonltxg+hy4GK8/w== + resolved "https://npm.i12e.cha0s.io/@latus%2fgovernor/-/governor-1.0.0.tgz#48b38131f287604d14b5be81a1f83a66d5a005ce" + integrity sha512-tzQ3kmrw3Vj7fXR8C36xqMVBQYCcnLqKOV6kR+oCryifiCcL0i7RAtGWg6VyN1zXfLQHatLI8yOY3bBBEiVZRQ== dependencies: "@latus/db" "^1.0.0" "@latus/redis" "^1.0.0" @@ -935,8 +935,8 @@ "@latus/http@^1.0.0": version "1.0.0" - resolved "https://npm.i12e.cha0s.io/@latus%2fhttp/-/http-1.0.0.tgz#22ffe8d3fa4eedd89836a0d82fa448e22b1db1ab" - integrity sha512-jkq2wjwX+1s2m7sb5rEhSTCgZXZiOw+A/pT0Iin7YxXQ9al03WJvF+a64pO7ZNxhL7DNgnUzs117VXNcx5B7Dg== + resolved "https://npm.i12e.cha0s.io/@latus%2fhttp/-/http-1.0.0.tgz#74eab385182f6af4a1bdc266c35a4c18207aafb6" + integrity sha512-OyVuXnkyEP6UOpIfNLo5XMWrzEc/VDOZWdf9wYDXEkSNfw3OMwp5xyC47KtLT+ZS0vUetCFbI5xvSgiMzthk6g== dependencies: "@latus/core" "1.0.0" "@neutrinojs/web" "^9.1.0" @@ -985,22 +985,23 @@ "@latus/socket@^1.0.0": version "1.0.0" - resolved "https://npm.i12e.cha0s.io/@latus%2fsocket/-/socket-1.0.0.tgz#c08c05888e7944a04ae4686f5866d1220b3a5066" - integrity sha512-v+e8AE7ACOIKKQXIBV0GEO+N4jKmEdLebM79NM45kVjJtkmRJUZkKB+r3uh3PLuuJu5IW01DkE8FgDDgl6J7iA== + resolved "https://npm.i12e.cha0s.io/@latus%2fsocket/-/socket-1.0.0.tgz#485f1689c72aed2267b71a85d00240f6e532e9bf" + integrity sha512-7tEUVmYXhFnvRiPMlJqYitkHVqaqCKS0iPWGdSvm97VT4x5oQzxovz0szDUpWMR5DtmtODvf1ahHmXkfeLoWeQ== dependencies: "@latus/core" "^1.0.0" "@latus/http" "^1.0.0" "@latus/react" "^1.0.0" buffer "^6.0.3" debug "4.3.1" + proxy-addr "^2.0.6" schemapack "^1.4.2" socket.io "2.3.0" socket.io-client "2.3.0" "@latus/user@^1.0.0": version "1.0.0" - resolved "https://npm.i12e.cha0s.io/@latus%2fuser/-/user-1.0.0.tgz#61d452686dd66880fa5ed58a02cb5822c9aa8420" - integrity sha512-BoZJS8NG9K51p99P0T5DEn24wwNIrwTOEo69VuhsnnhsghMsU6Ug2ybbkTyERuxOGzJg3Rcoeruapx5vzNtJXA== + resolved "https://npm.i12e.cha0s.io/@latus%2fuser/-/user-1.0.0.tgz#354210687e52a2d52dc88f216035f3c8ec240376" + integrity sha512-zyCKsyE9eP6WHf0TmuKNwFPUX48Gn0AdzcPJVg3YO85h9VHKKV8zZ/hoYzGzJ7G7WDfxr3GfrGvqC/i2jM08PQ== dependencies: "@latus/db" "^1.0.0" "@latus/socket" "^1.0.0" @@ -1044,6 +1045,13 @@ "@babel/core" "^7.11.4" babel-loader "^8.1.0" +"@neutrinojs/copy@^9.1.0": + version "9.4.0" + resolved "https://npm.i12e.cha0s.io/@neutrinojs%2fcopy/-/copy-9.4.0.tgz#258b72297c2feac32d3fc756175fa539c0543d62" + integrity sha512-8Ki7aFHZV+3FNHTDNPfIfOHYVAVDVrv1GGiyHwEGpXEjYIioSVT9KlWXanJpNEJZ2MkEduhljL7mcM5+5yBRcg== + dependencies: + copy-webpack-plugin "^5.1.1" + "@neutrinojs/dev-server@9.4.0": version "9.4.0" resolved "https://npm.i12e.cha0s.io/@neutrinojs%2fdev-server/-/dev-server-9.4.0.tgz#6598c6f320ce8bf3cdeae6e2be9224779965b649" @@ -1166,6 +1174,318 @@ babel-merge "^3.0.0" deepmerge "^1.5.2" +"@pixi/accessibility@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2faccessibility/-/accessibility-5.3.3.tgz#b7bab17e3cf5eb5f511471df943155a4eadf0c6e" + integrity sha512-wC/enJtw5CrdWnu6l5u3VN9UIZPumNSNXlGez2BULY0osiLTywHJPdHpmXMz2YPXw75GsEBzkEvK4LTtnTp21A== + dependencies: + "@pixi/core" "5.3.3" + "@pixi/display" "5.3.3" + "@pixi/utils" "5.3.3" + +"@pixi/app@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2fapp/-/app-5.3.3.tgz#6357e2e5acc1ed118b7f94c1179cef55ce6ed59c" + integrity sha512-OkO7Kq3N+FPRshVmApuiHKBpobic56VYbLVCMYPy6rjV0hc5ctkchKGFyouJuPt/rHeI6FrqZ0TaON1TShnKiA== + dependencies: + "@pixi/core" "5.3.3" + "@pixi/display" "5.3.3" + +"@pixi/constants@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2fconstants/-/constants-5.3.3.tgz#faaed2d0ce364d67fe3e69ac97e9db1f6ad6c041" + integrity sha512-IybgxzLlEPm7ihp70cLNKc3IPyqkFuW+idk9Zw2St+OayJTw5ctCnLAg9cducwIVHjPYTvN46BYDa+n0KRWZYw== + +"@pixi/core@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2fcore/-/core-5.3.3.tgz#4b973ee3d18f6324d63311e8a00a68ecb1996532" + integrity sha512-taw50LnzV+TQVMx5HQA2ZJgF9wuhZ6DeoXHW2KkevYB0ekKYnEO2VMMiRDMcmchtyvHclJebzjeHZLGqDtKDgw== + dependencies: + "@pixi/constants" "5.3.3" + "@pixi/math" "5.3.3" + "@pixi/runner" "5.3.3" + "@pixi/settings" "5.3.3" + "@pixi/ticker" "5.3.3" + "@pixi/utils" "5.3.3" + +"@pixi/display@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2fdisplay/-/display-5.3.3.tgz#14646b35b80b8586316be3495e3c0e7fa610f499" + integrity sha512-dPm7Vk2BH9byu6RHBYsI9MtjUU8x1HNm/PIi6lIlxANhTjWnhxwfvmrGE7ZcRLThTenNdDVlZ2ke2XAXP98UgA== + dependencies: + "@pixi/math" "5.3.3" + "@pixi/settings" "5.3.3" + "@pixi/utils" "5.3.3" + +"@pixi/extract@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2fextract/-/extract-5.3.3.tgz#5ab8e2977823d0ea75db003e45d6c6d72bc2b642" + integrity sha512-CE0GA+tEBPurpaXER2B1aq1sdumKLtCqE/Mms6fYUkIKF9D0Ogw9rqo79QCL9XkLMexa7xVeC3KPPiXW5wrOaA== + dependencies: + "@pixi/core" "5.3.3" + "@pixi/math" "5.3.3" + "@pixi/utils" "5.3.3" + +"@pixi/filter-alpha@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2ffilter-alpha/-/filter-alpha-5.3.3.tgz#2d3e10e8f42f787a5115e81b13265839b2162797" + integrity sha512-AxyHLnvO892va9raZbMMtMtEGDVqO8SvEHHNnCjTBEZ67kVKy0HEYXFOBA6nJZ6BiTgGp9js+7kevi11tfqnJQ== + dependencies: + "@pixi/core" "5.3.3" + +"@pixi/filter-blur@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2ffilter-blur/-/filter-blur-5.3.3.tgz#c530e40038dec1725a399753ac97faa3418559cf" + integrity sha512-vLN1DL6PQXo4p7j/32PZIf+lhcBVfb9hdphSmtbxlAlpbhMWI52n3YUkeInwHs7Ev08NyhI/UhNWHqjN/lAM3w== + dependencies: + "@pixi/core" "5.3.3" + "@pixi/settings" "5.3.3" + +"@pixi/filter-color-matrix@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2ffilter-color-matrix/-/filter-color-matrix-5.3.3.tgz#c1ecf83a44f68d78b5436b920b459c5222f373a5" + integrity sha512-HFr+vth5ZHHEFJYcjtWZ+O0s7Z2YWJyDyxr+nTd5Q8AT7gMDTVehpNVrm7ByaCKeEovOZzZI6A347+WmHcNpGg== + dependencies: + "@pixi/core" "5.3.3" + +"@pixi/filter-displacement@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2ffilter-displacement/-/filter-displacement-5.3.3.tgz#f25193f738b90cc75cd04bbbcd0aefe9ea037af1" + integrity sha512-kvrKMgqW4ELg+yT2p5vmu6h/IER/L8GD1PWyXovnzpI8RG7k8l136F9VvA3wkB6sYuNcXiDtqMtRQy5e6O4+rw== + dependencies: + "@pixi/core" "5.3.3" + "@pixi/math" "5.3.3" + +"@pixi/filter-fxaa@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2ffilter-fxaa/-/filter-fxaa-5.3.3.tgz#c7701631d60f485b6ec1052f71afb0637ca5f0b8" + integrity sha512-p4vKdBwaoGRNZcoHz2ET8hBF1SoWvy9xU2B3Ci32+c0dg89ZUdGTEW0zimUHi2gMdU+2v/T0lqZ9NC9B6WVYAg== + dependencies: + "@pixi/core" "5.3.3" + +"@pixi/filter-noise@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2ffilter-noise/-/filter-noise-5.3.3.tgz#5d821d9f83f97d83d4be52f3ecc7e2d06ff1c084" + integrity sha512-HCky3XPk6BYGXTS7d9/FnAHnqq7Rwm5Rlj2XtWW3JItXGCScEBII227xYwrJu5Ke84tpVlDXK4W1/BevZ1AwlQ== + dependencies: + "@pixi/core" "5.3.3" + +"@pixi/graphics@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2fgraphics/-/graphics-5.3.3.tgz#cfaf5a0a94a811f7359c20875547c14095f1ecec" + integrity sha512-1bn9Jptg3JXgVOw0SrEMdmjSwkTBYDm6fPnPnh4goF3yDozh0xEqmXobVtCgy2fulMfHRzIfbgtRxrBf2mkCAg== + dependencies: + "@pixi/constants" "5.3.3" + "@pixi/core" "5.3.3" + "@pixi/display" "5.3.3" + "@pixi/math" "5.3.3" + "@pixi/sprite" "5.3.3" + "@pixi/utils" "5.3.3" + +"@pixi/interaction@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2finteraction/-/interaction-5.3.3.tgz#07348e7d25b8e67473ed54f679ebe84ab9ee0400" + integrity sha512-Tjuw4XwmrG1fhGzfn5oGspRJT2OtlH+6V7AHscH0v5Ht1Kvk6aKjNncZuSCXllhGGlIuMu3Nn9WPvDEIvW3JNw== + dependencies: + "@pixi/core" "5.3.3" + "@pixi/display" "5.3.3" + "@pixi/math" "5.3.3" + "@pixi/ticker" "5.3.3" + "@pixi/utils" "5.3.3" + +"@pixi/loaders@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2floaders/-/loaders-5.3.3.tgz#d415f25f9af64d97810e459caa2c0aca4b6a1b7c" + integrity sha512-wj0DzniApfDoZA/buMmO/CgCB7Q7SsESForHh7wSd7UC8rrCmz5prUTEICmJGhdHpBuVB7KDPtwaaLtr9Q/kQg== + dependencies: + "@pixi/core" "5.3.3" + "@pixi/utils" "5.3.3" + resource-loader "^3.0.1" + +"@pixi/math@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2fmath/-/math-5.3.3.tgz#5d40d36fa1701e195083adb84bddf2f6420c2f4c" + integrity sha512-k5C3kQpxlGm2AdBJEUjjW2l2YlSvTKf+54vNOjD4UcEfRoDevC5p4Zg49q3UAu855lrs5qw49AbkrFKsQvPIRA== + +"@pixi/mesh-extras@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2fmesh-extras/-/mesh-extras-5.3.3.tgz#99c712fdb1b0a9db66fd95a76de26361a7055ab4" + integrity sha512-V2hARC7nUPaTEFxd+B8GDkSMrMZ38S8/IInqtYzGUy6FtFs7IYKty9Rz/G665eN7ThIq8tZrOVZOl6JRBtEC8A== + dependencies: + "@pixi/constants" "5.3.3" + "@pixi/core" "5.3.3" + "@pixi/math" "5.3.3" + "@pixi/mesh" "5.3.3" + "@pixi/utils" "5.3.3" + +"@pixi/mesh@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2fmesh/-/mesh-5.3.3.tgz#f0adf0362c18e6e7646b7abaccec47d304cbb405" + integrity sha512-q8w70oAFNdArzOHVnsn7ban68NmO5S5TMg6qSez4A8te6cebMRQsNrT/0dQ/nZcG7ACFK4jiYfbXRQivO+jgVA== + dependencies: + "@pixi/constants" "5.3.3" + "@pixi/core" "5.3.3" + "@pixi/display" "5.3.3" + "@pixi/math" "5.3.3" + "@pixi/settings" "5.3.3" + "@pixi/utils" "5.3.3" + +"@pixi/mixin-cache-as-bitmap@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2fmixin-cache-as-bitmap/-/mixin-cache-as-bitmap-5.3.3.tgz#cac6a2ecf3b72fbae58ab3657998360ddbda7382" + integrity sha512-P1mo3HKDWS8IZLgaP8gujiy4We4vRcxJH6EvQAevf+GsBzdjKfcGgkKzVb9HlyQvsXML5gpTOJuw5eKgRTxSQA== + dependencies: + "@pixi/core" "5.3.3" + "@pixi/display" "5.3.3" + "@pixi/math" "5.3.3" + "@pixi/settings" "5.3.3" + "@pixi/sprite" "5.3.3" + "@pixi/utils" "5.3.3" + +"@pixi/mixin-get-child-by-name@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2fmixin-get-child-by-name/-/mixin-get-child-by-name-5.3.3.tgz#828dc9a7beae603648ebe2ccb67517c7137bff19" + integrity sha512-CksDZ5ZG4/tHZfDOwSuznANduasJg5JR89X3D6E9DVYx4CLVE3G2K1sbeiOJNXfGIKy30UoSD7Y7IFmUzLxp/g== + dependencies: + "@pixi/display" "5.3.3" + +"@pixi/mixin-get-global-position@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2fmixin-get-global-position/-/mixin-get-global-position-5.3.3.tgz#5700b03794e5b21f61c015aeda733c3cb625fc75" + integrity sha512-M3faQYDW/ISa1+lhVkjHXRALJ33BMzLN+7x9ucx8VeCmUWvcaLlRo3CaxZsgiR+52Fii5WHl/PF/cMzdkRMF9g== + dependencies: + "@pixi/display" "5.3.3" + "@pixi/math" "5.3.3" + +"@pixi/particles@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2fparticles/-/particles-5.3.3.tgz#3e9d2d317d6cd11a3736830dfbd4cc0c3a1082c8" + integrity sha512-t+lG8iGNYyS6ujKvC9qQjKzyxvjxqbFxvB6hkXcOKR98JWM2726ZguHouFlIbOzOxYAGoeuHIWSDlnQNvnVE2g== + dependencies: + "@pixi/constants" "5.3.3" + "@pixi/core" "5.3.3" + "@pixi/display" "5.3.3" + "@pixi/math" "5.3.3" + "@pixi/utils" "5.3.3" + +"@pixi/polyfill@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2fpolyfill/-/polyfill-5.3.3.tgz#4d0050b0bb75a7b51841f7bfec4c29243a605be7" + integrity sha512-gmx67A6VmwKllxfIMQWzMUNJ8wJfWPT5FlUR0SoPastdTB/SfbgbyQBgKLZHqgmc6LOh2CrOLhN423lNiAroeA== + dependencies: + es6-promise-polyfill "^1.2.0" + object-assign "^4.1.1" + +"@pixi/prepare@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2fprepare/-/prepare-5.3.3.tgz#a3466ecf5256a5c3fb9b86a555db17cc72d54c87" + integrity sha512-DPsKWfYJ97J67YCjPU6uvU+LBdw+64O9LG9vmzfChmYXom5VMQF9yUC6ZoYTHUPmH31iilqzGeMlPUTobnqSog== + dependencies: + "@pixi/core" "5.3.3" + "@pixi/display" "5.3.3" + "@pixi/graphics" "5.3.3" + "@pixi/settings" "5.3.3" + "@pixi/text" "5.3.3" + "@pixi/ticker" "5.3.3" + +"@pixi/runner@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2frunner/-/runner-5.3.3.tgz#79fb35b12620d7724c65f4a7aa507190ea825ac0" + integrity sha512-7eLZxxT+PwxuwzcRL1egrnEdLHwD41yFb24pMSo6XM86ppP1tdBjrv5+pLDnUuDEfNjZQxx07FAlZY+sMKANmw== + +"@pixi/settings@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2fsettings/-/settings-5.3.3.tgz#3ff5f8afc8376d12c7627be043ec317eba139dcd" + integrity sha512-1MYJokqpPUtvYEX0BVi0Pq2Xi6KGmWDV5hlQnTXY9NGv6tmqrPYvIb/uHFaDyVUWmrqsFL3xZ4W5zMo+c/dwVA== + dependencies: + ismobilejs "^1.1.0" + +"@pixi/sprite-animated@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2fsprite-animated/-/sprite-animated-5.3.3.tgz#f24949ae04aeff9ff44e22544bc8b7f336d5209e" + integrity sha512-nG5j8veJ/cFXQTgzafPLkZqaHKbuaHcIj+ZYN1I2f31Y85/pfr2PQQLHbGr+3441wOYkEHht9nHhmZHWlOOZ0Q== + dependencies: + "@pixi/core" "5.3.3" + "@pixi/sprite" "5.3.3" + "@pixi/ticker" "5.3.3" + +"@pixi/sprite-tiling@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2fsprite-tiling/-/sprite-tiling-5.3.3.tgz#d7306256b7bf6f13c181ea4a2d95905f5ae69b9d" + integrity sha512-+Xk9AUh82rpArtrnZkw+9aJchrmHZ8QkpjsPRJcgPFHx3WEfABIkT6QEoYbRKiYH34OgO7ZOUXy9hcGPHnxjvw== + dependencies: + "@pixi/constants" "5.3.3" + "@pixi/core" "5.3.3" + "@pixi/display" "5.3.3" + "@pixi/math" "5.3.3" + "@pixi/sprite" "5.3.3" + "@pixi/utils" "5.3.3" + +"@pixi/sprite@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2fsprite/-/sprite-5.3.3.tgz#1681d5fd0a725581bfee3c9c2c490537bf8d21ea" + integrity sha512-qo7DG0oWS1uIBqfxw2jZPn34RCR6gQ+IjZRBpFxZPKPB1cL359scZmDBqBbQ4bd4rJ/6QXQfzUdGhXfQJtc9oQ== + dependencies: + "@pixi/constants" "5.3.3" + "@pixi/core" "5.3.3" + "@pixi/display" "5.3.3" + "@pixi/math" "5.3.3" + "@pixi/settings" "5.3.3" + "@pixi/utils" "5.3.3" + +"@pixi/spritesheet@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2fspritesheet/-/spritesheet-5.3.3.tgz#e307400d0afe4aa6e1d8d756a519e391706b5f35" + integrity sha512-pTkOCTL8jsmyAguCgcbz03UPYu+3buRkgua1g/vGyeoZBN2eJ04iSXdB0pfPrsPisxkvThGHyU23UqEDYVtXRQ== + dependencies: + "@pixi/core" "5.3.3" + "@pixi/loaders" "5.3.3" + "@pixi/math" "5.3.3" + "@pixi/utils" "5.3.3" + +"@pixi/text-bitmap@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2ftext-bitmap/-/text-bitmap-5.3.3.tgz#0d658473d6e02ce598f779c207c42333741e15bd" + integrity sha512-QRRdEAFBwmRctp8PCPii5WUPM57T1I3r/EwyTvFCCDubOYOZu4aX/iFpCKZMl5GIphDFaGp8mNvbl+BwjUmBCA== + dependencies: + "@pixi/core" "5.3.3" + "@pixi/display" "5.3.3" + "@pixi/loaders" "5.3.3" + "@pixi/math" "5.3.3" + "@pixi/mesh" "5.3.3" + "@pixi/settings" "5.3.3" + "@pixi/text" "5.3.3" + "@pixi/utils" "5.3.3" + +"@pixi/text@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2ftext/-/text-5.3.3.tgz#d6fc00c52bc054450ae43e2d5c6f7cedcee9ecd2" + integrity sha512-juinZC2yFXnzucWWxSdty9nfIIOAq2WA8DD2k40YL+7Y5L52/ggkgnokeQ2lrTb1BvTfx6YVNlvAsKonUek0Og== + dependencies: + "@pixi/core" "5.3.3" + "@pixi/math" "5.3.3" + "@pixi/settings" "5.3.3" + "@pixi/sprite" "5.3.3" + "@pixi/utils" "5.3.3" + +"@pixi/ticker@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2fticker/-/ticker-5.3.3.tgz#a8766d8417879fffd7507175de869805aee25eb2" + integrity sha512-p5F/dwJGwfZWUg5cCPqOnEx5iYGW+huQlZZtrTKKd1KoVehFsrzHeRBOEp4d584jsOmBf7fjJaUTyzsFn0YtOQ== + dependencies: + "@pixi/settings" "5.3.3" + +"@pixi/utils@5.3.3": + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/@pixi%2futils/-/utils-5.3.3.tgz#525321f3bb00e3e001e341020a3edee94cc0d00a" + integrity sha512-GDP2h1Mph9Uei4zmJjzDK6GZ5S9O2A09VySVfWyKgWwP3SQ/Ss0bGYm4sE6+u1NMSz1WCrLgu66H82XuXs2Cbg== + dependencies: + "@pixi/constants" "5.3.3" + "@pixi/settings" "5.3.3" + earcut "^2.1.5" + eventemitter3 "^3.1.0" + url "^0.11.0" + "@reddichat/app@^1.0.0": version "1.0.0" resolved "https://npm.i12e.cha0s.io/@reddichat%2fapp/-/app-1.0.0.tgz#2ab024c5232685dc5f1725742e267b9fb1a7359f" @@ -1178,12 +1498,13 @@ "@reddichat/chat@^1.0.0": version "1.0.0" - resolved "https://npm.i12e.cha0s.io/@reddichat%2fchat/-/chat-1.0.0.tgz#986824a532a4325c5dcca3874aa76331573c2420" - integrity sha512-Qk+bP/FDaup2r3thTfKuxjZ1xSvWRW0l8lwFi0MN22hrgzgiby+7iSB87Z5BiYcmHY9gPO3FzsbzK5kkNOIRVg== + resolved "https://npm.i12e.cha0s.io/@reddichat%2fchat/-/chat-1.0.0.tgz#18f61bcbd6d93184fed6e7b20e4710b754a6949c" + integrity sha512-0Q3Rq+HX+mPslAaJeMMPcvwADU/CewE14pwzXjLtwZfyGTcE1G02sxypXWQCcIc2kJ9RA9LdU8U7kikPOo7YPA== dependencies: "@latus/core" "^1.0.0" "@latus/db" "^1.0.0" "@latus/governor" "^1.0.0" + "@latus/redis" "^1.0.0" "@latus/socket" "^1.0.0" "@reddichat/core" "^1.0.0" "@reddichat/state" "^1.0.0" @@ -1196,11 +1517,19 @@ "@reddichat/core@^1.0.0": version "1.0.0" - resolved "https://npm.i12e.cha0s.io/@reddichat%2fcore/-/core-1.0.0.tgz#f8f7b5350bbfb985697144681e6f8509545be745" - integrity sha512-1f03IIacxnzYrkCJZlQRrBX2BPiHjGdeo+PCOxgfqbmgp3xUANdfGY4G2hXzNy+WNE8+pH4xdZ6UEXqtFq9cmw== + resolved "https://npm.i12e.cha0s.io/@reddichat%2fcore/-/core-1.0.0.tgz#dd398b01525f529af0bb9918d34d7be82e65b882" + integrity sha512-GsO4dCx0Gn+xKpu04Y1rdmTAj1PdoAyte9+U50wJzvCfOB4LsvnpuNwHM9XKbolWbMehKk26bHC+3xqulf/qIg== dependencies: debug "4.3.1" +"@reddichat/fun@^1.0.0": + version "1.0.0" + resolved "https://npm.i12e.cha0s.io/@reddichat%2ffun/-/fun-1.0.0.tgz#5eb02712148bd5f39073e33743f4d7113c216df1" + integrity sha512-mV7xbBDj46rLLBhqstDJPi03B513Sc4ZNe6HjkRL893caPgn4M2HGG3n+zMX3OT4c+WRhpocWGsQfgc4Nuv2NA== + dependencies: + debug "4.3.1" + pixi.js "^5.3.3" + "@reddichat/state@^1.0.0": version "1.0.0" resolved "https://npm.i12e.cha0s.io/@reddichat%2fstate/-/state-1.0.0.tgz#5af14ce8e4c35b2c5c09861fac81e4d2932b0452" @@ -1219,8 +1548,8 @@ "@reddichat/user@^1.0.0": version "1.0.0" - resolved "https://npm.i12e.cha0s.io/@reddichat%2fuser/-/user-1.0.0.tgz#9353960a9584729332b190fef17fbe2d749f066b" - integrity sha512-RX31yM8zJEiD56wadGEuIozmfyrW06ni6wAFFByH8B6XDcYrTeC9WYKgAVACzBY1Wb/bKykm8dmIWVr6s2lKJg== + resolved "https://npm.i12e.cha0s.io/@reddichat%2fuser/-/user-1.0.0.tgz#4fae0dbe063bdd0fba36cca79016e90810b1c100" + integrity sha512-PTjsWZ3fcdSz9w7yINpwsQGEJl1Izsn4n3WGjdjeEbkQZSyg4j7srHARzzD2eO+QxO/j1f2BiSAkE7WTcFHa+A== dependencies: "@latus/db" "^1.0.0" "@latus/socket" "^1.0.0" @@ -1278,9 +1607,9 @@ integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== "@types/node@*": - version "14.14.12" - resolved "https://npm.i12e.cha0s.io/@types%2fnode/-/node-14.14.12.tgz#0b1d86f8c40141091285dea02e4940df73bba43f" - integrity sha512-ASH8OPHMNlkdjrEdmoILmzFfsJICvhBsFfAum4aKZ/9U4B6M6tTmTPh+f3ttWdD74CEGV5XvXWkbyfSdXaTd7g== + version "14.14.13" + resolved "https://npm.i12e.cha0s.io/@types%2fnode/-/node-14.14.13.tgz#9e425079799322113ae8477297ae6ef51b8e0cdf" + integrity sha512-vbxr0VZ8exFMMAjCW8rJwaya0dMCDyYW2ZRdTyjtrCvJoENMpdUHOT/eTzvgyA5ZnqRZ/sI0NwqAxNHKYokLJQ== "@types/source-list-map@*": version "0.1.2" @@ -2207,7 +2536,7 @@ bytes@3.1.0: resolved "https://npm.i12e.cha0s.io/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== -cacache@^12.0.2: +cacache@^12.0.2, cacache@^12.0.3: version "12.0.4" resolved "https://npm.i12e.cha0s.io/cacache/-/cacache-12.0.4.tgz#668bcbd105aeb5f1d92fe25570ec9525c8faa40c" integrity sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ== @@ -2315,9 +2644,9 @@ camelcase@^5.0.0, camelcase@^5.3.1: integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== caniuse-lite@^1.0.30001165: - version "1.0.30001165" - resolved "https://npm.i12e.cha0s.io/caniuse-lite/-/caniuse-lite-1.0.30001165.tgz#32955490d2f60290bb186bb754f2981917fa744f" - integrity sha512-8cEsSMwXfx7lWSUMA2s08z9dIgsnR5NAqjXP23stdsU3AUWkCr/rr4s4OFtHXn5XXr6+7kam3QFVoYyXNPdJPA== + version "1.0.30001166" + resolved "https://npm.i12e.cha0s.io/caniuse-lite/-/caniuse-lite-1.0.30001166.tgz#ca73e8747acfd16a4fd6c4b784f1b995f9698cf8" + integrity sha512-nCL4LzYK7F4mL0TjEMeYavafOGnBa98vTudH5c8lW9izUjnB99InG6pmC1ElAI1p0GlyZajv4ltUdFXvOHIl1A== caseless@~0.12.0: version "0.12.0" @@ -2709,6 +3038,24 @@ copy-descriptor@^0.1.0: resolved "https://npm.i12e.cha0s.io/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= +copy-webpack-plugin@^5.1.1: + version "5.1.2" + resolved "https://npm.i12e.cha0s.io/copy-webpack-plugin/-/copy-webpack-plugin-5.1.2.tgz#8a889e1dcafa6c91c6cd4be1ad158f1d3823bae2" + integrity sha512-Uh7crJAco3AjBvgAy9Z75CjK8IG+gxaErro71THQ+vv/bl4HaQcpkexAY8KVW/T6D2W2IRr+couF/knIRkZMIQ== + dependencies: + cacache "^12.0.3" + find-cache-dir "^2.1.0" + glob-parent "^3.1.0" + globby "^7.1.1" + is-glob "^4.0.1" + loader-utils "^1.2.3" + minimatch "^3.0.4" + normalize-path "^3.0.0" + p-limit "^2.2.1" + schema-utils "^1.0.0" + serialize-javascript "^4.0.0" + webpack-log "^2.0.0" + core-js-compat@^3.8.0: version "3.8.1" resolved "https://npm.i12e.cha0s.io/core-js-compat/-/core-js-compat-3.8.1.tgz#8d1ddd341d660ba6194cbe0ce60f4c794c87a36e" @@ -3067,6 +3414,13 @@ diffie-hellman@^5.0.0: miller-rabin "^4.0.0" randombytes "^2.0.0" +dir-glob@^2.0.0: + version "2.2.2" + resolved "https://npm.i12e.cha0s.io/dir-glob/-/dir-glob-2.2.2.tgz#fa09f0694153c8918b18ba0deafae94769fc50c4" + integrity sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw== + dependencies: + path-type "^3.0.0" + dns-equal@^1.0.0: version "1.0.0" resolved "https://npm.i12e.cha0s.io/dns-equal/-/dns-equal-1.0.0.tgz#b39e7f1da6eb0a75ba9c17324b34753c47e0654d" @@ -3232,6 +3586,11 @@ duplexify@^3.4.2, duplexify@^3.6.0: readable-stream "^2.0.0" stream-shift "^1.0.0" +earcut@^2.1.5: + version "2.2.2" + resolved "https://npm.i12e.cha0s.io/earcut/-/earcut-2.2.2.tgz#41b0bc35f63e0fe80da7cddff28511e7e2e80d11" + integrity sha512-eZoZPPJcUHnfRZ0PjLvx2qBordSiO8ofC3vt+qACLM95u+4DovnbYNpQtJh0DNsWj8RnxrQytD4WA8gj5cRIaQ== + ecc-jsbn@~0.1.1: version "0.1.2" resolved "https://npm.i12e.cha0s.io/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" @@ -3246,9 +3605,9 @@ ee-first@1.1.1: integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= electron-to-chromium@^1.3.621: - version "1.3.622" - resolved "https://npm.i12e.cha0s.io/electron-to-chromium/-/electron-to-chromium-1.3.622.tgz#9726bd2e67a5462154750ce9701ca6af07d07877" - integrity sha512-AJT0Fm1W0uZlMVVkkJrcCVvczDuF8tPm3bwzQf5WO8AaASB2hwTRP7B8pU5rqjireH+ib6am8+hH5/QkXzzYKw== + version "1.3.625" + resolved "https://npm.i12e.cha0s.io/electron-to-chromium/-/electron-to-chromium-1.3.625.tgz#a7bd18da4dc732c180b2e95e0e296c0bf22f3bd6" + integrity sha512-CsLk/r0C9dAzVPa9QF74HIXduxaucsaRfqiOYvIv2PRhvyC6EOqc/KbpgToQuDVgPf3sNAFZi3iBu4vpGOwGag== elliptic@^6.5.3: version "6.5.3" @@ -3426,6 +3785,11 @@ es-to-primitive@^1.2.1: is-date-object "^1.0.1" is-symbol "^1.0.2" +es6-promise-polyfill@^1.2.0: + version "1.2.0" + resolved "https://npm.i12e.cha0s.io/es6-promise-polyfill/-/es6-promise-polyfill-1.2.0.tgz#f38925f23cb3e3e8ce6cda8ff774fcebbb090cde" + integrity sha1-84kl8jyz4+jObNqP93T867sJDN4= + es6-templates@^0.2.3: version "0.2.3" resolved "https://npm.i12e.cha0s.io/es6-templates/-/es6-templates-0.2.3.tgz#5cb9ac9fb1ded6eb1239342b81d792bbb4078ee4" @@ -3704,6 +4068,11 @@ etag@~1.8.1: resolved "https://npm.i12e.cha0s.io/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= +eventemitter3@^3.1.0: + version "3.1.2" + resolved "https://npm.i12e.cha0s.io/eventemitter3/-/eventemitter3-3.1.2.tgz#2d3d48f9c346698fce83a85d7d664e98535df6e7" + integrity sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q== + eventemitter3@^4.0.0: version "4.0.7" resolved "https://npm.i12e.cha0s.io/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" @@ -4047,9 +4416,9 @@ flush-write-stream@^1.0.0: readable-stream "^2.3.6" follow-redirects@^1.0.0: - version "1.13.0" - resolved "https://npm.i12e.cha0s.io/follow-redirects/-/follow-redirects-1.13.0.tgz#b42e8d93a2a7eea5ed88633676d6597bc8e384db" - integrity sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA== + version "1.13.1" + resolved "https://npm.i12e.cha0s.io/follow-redirects/-/follow-redirects-1.13.1.tgz#5f69b813376cee4fd0474a3aba835df04ab763b7" + integrity sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg== for-in@^1.0.2: version "1.0.2" @@ -4326,6 +4695,18 @@ globby@^6.1.0: pify "^2.0.0" pinkie-promise "^2.0.0" +globby@^7.1.1: + version "7.1.1" + resolved "https://npm.i12e.cha0s.io/globby/-/globby-7.1.1.tgz#fb2ccff9401f8600945dfada97440cca972b8680" + integrity sha1-+yzP+UAfhgCUXfral0QMypcrhoA= + dependencies: + array-union "^1.0.1" + dir-glob "^2.0.0" + glob "^7.1.2" + ignore "^3.3.5" + pify "^3.0.0" + slash "^1.0.0" + globule@^1.0.0: version "1.3.2" resolved "https://npm.i12e.cha0s.io/globule/-/globule-1.3.2.tgz#d8bdd9e9e4eef8f96e245999a5dee7eb5d8529c4" @@ -4508,9 +4889,9 @@ hpack.js@^2.1.6: wbuf "^1.1.0" html-entities@^1.2.0, html-entities@^1.3.1: - version "1.3.1" - resolved "https://npm.i12e.cha0s.io/html-entities/-/html-entities-1.3.1.tgz#fb9a1a4b5b14c5daba82d3e34c6ae4fe701a0e44" - integrity sha512-rhE/4Z3hIhzHAUKbW8jVcCyuT5oJCXXqhN/6mXXVCpzTmvJnoH2HL/bt3EZ6p55jbFJBeAe1ZNpL5BugLujxNA== + version "1.3.3" + resolved "https://npm.i12e.cha0s.io/html-entities/-/html-entities-1.3.3.tgz#3dca638a43ee7de316fc23067398491152ad4736" + integrity sha512-/VulV3SYni1taM7a4RMdceqzJWR39gpZHjBwUnsCFKWV/GJkD14CJ5F7eWcZozmHJK0/f/H5U3b3SiPkuvxMgg== html-loader@^0.5.5: version "0.5.5" @@ -4709,6 +5090,11 @@ ignore-walk@^3.0.1: dependencies: minimatch "^3.0.4" +ignore@^3.3.5: + version "3.3.10" + resolved "https://npm.i12e.cha0s.io/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" + integrity sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug== + ignore@^4.0.6: version "4.0.6" resolved "https://npm.i12e.cha0s.io/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" @@ -4813,9 +5199,9 @@ inherits@2.0.3: integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= ini@^1.3.4, ini@^1.3.5, ini@~1.3.0: - version "1.3.7" - resolved "https://npm.i12e.cha0s.io/ini/-/ini-1.3.7.tgz#a09363e1911972ea16d7a8851005d84cf09a9a84" - integrity sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ== + version "1.3.8" + resolved "https://npm.i12e.cha0s.io/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" + integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== inquirer@^7.0.0: version "7.3.3" @@ -5180,6 +5566,11 @@ isexe@^2.0.0: resolved "https://npm.i12e.cha0s.io/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= +ismobilejs@^1.1.0: + version "1.1.1" + resolved "https://npm.i12e.cha0s.io/ismobilejs/-/ismobilejs-1.1.1.tgz#c56ca0ae8e52b24ca0f22ba5ef3215a2ddbbaa0e" + integrity sha512-VaFW53yt8QO61k2WJui0dHf4SlL8lxBofUuUmwBo0ljPk0Drz2TiuDW4jo3wDcv41qy/SxrJ+VAzJ/qYqsmzRw== + isobject@^2.0.0: version "2.1.0" resolved "https://npm.i12e.cha0s.io/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" @@ -5758,6 +6149,11 @@ mini-css-extract-plugin@^0.11.0: schema-utils "^1.0.0" webpack-sources "^1.1.0" +mini-signals@^1.2.0: + version "1.2.0" + resolved "https://npm.i12e.cha0s.io/mini-signals/-/mini-signals-1.2.0.tgz#45b08013c5fae51a24aa1a935cd317c9ed721d74" + integrity sha1-RbCAE8X65RokqhqTXNMXye1yHXQ= + minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" resolved "https://npm.i12e.cha0s.io/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" @@ -6434,7 +6830,7 @@ p-limit@^1.1.0: dependencies: p-try "^1.0.0" -p-limit@^2.0.0, p-limit@^2.2.0: +p-limit@^2.0.0, p-limit@^2.2.0, p-limit@^2.2.1: version "2.3.0" resolved "https://npm.i12e.cha0s.io/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== @@ -6563,6 +6959,11 @@ parse-passwd@^1.0.0: resolved "https://npm.i12e.cha0s.io/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" integrity sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY= +parse-uri@^1.0.0: + version "1.0.3" + resolved "https://npm.i12e.cha0s.io/parse-uri/-/parse-uri-1.0.3.tgz#f3c24a74907a4e357c1741e96ca9faadecfd6db5" + integrity sha512-upMnGxNcm+45So85HoguwZTVZI9u11i36DdxJfGF2HYWS2eh3TIx7+/tTi7qrEq15qzGkVhsKjesau+kCk48pA== + parseqs@0.0.5: version "0.0.5" resolved "https://npm.i12e.cha0s.io/parseqs/-/parseqs-0.0.5.tgz#d5208a3738e46766e291ba2ea173684921a8b89d" @@ -6741,6 +7142,13 @@ path-type@^2.0.0: dependencies: pify "^2.0.0" +path-type@^3.0.0: + version "3.0.0" + resolved "https://npm.i12e.cha0s.io/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" + integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== + dependencies: + pify "^3.0.0" + pause@0.0.1: version "0.0.1" resolved "https://npm.i12e.cha0s.io/pause/-/pause-0.0.1.tgz#1d408b3fdb76923b9543d96fb4c9dfd535d9cb5d" @@ -6772,6 +7180,11 @@ pify@^2.0.0: resolved "https://npm.i12e.cha0s.io/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= +pify@^3.0.0: + version "3.0.0" + resolved "https://npm.i12e.cha0s.io/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= + pify@^4.0.1: version "4.0.1" resolved "https://npm.i12e.cha0s.io/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" @@ -6796,6 +7209,46 @@ pirates@^4.0.0: dependencies: node-modules-regexp "^1.0.0" +pixi.js@^5.3.3: + version "5.3.3" + resolved "https://npm.i12e.cha0s.io/pixi.js/-/pixi.js-5.3.3.tgz#6e326a52542f4acd97ea3f8593cb0aeae502df9a" + integrity sha512-uFQOXXyPMAVVayDebSFBS1AFfPT6QYNuz9Vu11yI2/k1DAef/rbYoJpSMM6SeB6dezDJPtIAaXXNxdaYzbe+kg== + dependencies: + "@pixi/accessibility" "5.3.3" + "@pixi/app" "5.3.3" + "@pixi/constants" "5.3.3" + "@pixi/core" "5.3.3" + "@pixi/display" "5.3.3" + "@pixi/extract" "5.3.3" + "@pixi/filter-alpha" "5.3.3" + "@pixi/filter-blur" "5.3.3" + "@pixi/filter-color-matrix" "5.3.3" + "@pixi/filter-displacement" "5.3.3" + "@pixi/filter-fxaa" "5.3.3" + "@pixi/filter-noise" "5.3.3" + "@pixi/graphics" "5.3.3" + "@pixi/interaction" "5.3.3" + "@pixi/loaders" "5.3.3" + "@pixi/math" "5.3.3" + "@pixi/mesh" "5.3.3" + "@pixi/mesh-extras" "5.3.3" + "@pixi/mixin-cache-as-bitmap" "5.3.3" + "@pixi/mixin-get-child-by-name" "5.3.3" + "@pixi/mixin-get-global-position" "5.3.3" + "@pixi/particles" "5.3.3" + "@pixi/polyfill" "5.3.3" + "@pixi/prepare" "5.3.3" + "@pixi/runner" "5.3.3" + "@pixi/settings" "5.3.3" + "@pixi/sprite" "5.3.3" + "@pixi/sprite-animated" "5.3.3" + "@pixi/sprite-tiling" "5.3.3" + "@pixi/spritesheet" "5.3.3" + "@pixi/text" "5.3.3" + "@pixi/text-bitmap" "5.3.3" + "@pixi/ticker" "5.3.3" + "@pixi/utils" "5.3.3" + pkg-dir@^2.0.0: version "2.0.0" resolved "https://npm.i12e.cha0s.io/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" @@ -6963,7 +7416,7 @@ prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2: object-assign "^4.1.1" react-is "^16.8.1" -proxy-addr@~2.0.5: +proxy-addr@^2.0.6, proxy-addr@~2.0.5: version "2.0.6" resolved "https://npm.i12e.cha0s.io/proxy-addr/-/proxy-addr-2.0.6.tgz#fdc2336505447d3f2f2c638ed272caf614bbb2bf" integrity sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw== @@ -7102,9 +7555,9 @@ range-parser@^1.2.1, range-parser@~1.2.1: integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== rate-limiter-flexible@^2.1.13: - version "2.1.13" - resolved "https://npm.i12e.cha0s.io/rate-limiter-flexible/-/rate-limiter-flexible-2.1.13.tgz#2fcbb786921518beb8aba44b44fe04a7c141db2b" - integrity sha512-EDzvV/ee/rCBKNL5Jw0Rr0rjneT/L4zLGgVS9xB6ShfVMkV5iviWKr+2tjzgBg5kd9by5F08C9DfXfH6v/kz3w== + version "2.1.14" + resolved "https://npm.i12e.cha0s.io/rate-limiter-flexible/-/rate-limiter-flexible-2.1.14.tgz#f103116f9b09030a18dbf433c25c0d5cd908365d" + integrity sha512-YeTTEsP0eDKONwVLIP62XLmQyXOYKuXJOnMECwmaJFiUNa6uudcz9YMTXxzf5uvmnfvOknM2lKj4k2p/INm4HA== raw-body@2.4.0: version "2.4.0" @@ -7602,6 +8055,14 @@ resolve@^1.10.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.17.0, resolve@^1.1 is-core-module "^2.1.0" path-parse "^1.0.6" +resource-loader@^3.0.1: + version "3.0.1" + resolved "https://npm.i12e.cha0s.io/resource-loader/-/resource-loader-3.0.1.tgz#33355bb5421e2994f59454bbc7f6dbff8df06d47" + integrity sha512-fBuCRbEHdLCI1eglzQhUv9Rrdcmqkydr1r6uHE2cYHvRBrcLXeSmbE/qI/urFt8rPr/IGxir3BUwM5kUK8XoyA== + dependencies: + mini-signals "^1.2.0" + parse-uri "^1.0.0" + restore-cursor@^3.1.0: version "3.1.0" resolved "https://npm.i12e.cha0s.io/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" @@ -7968,6 +8429,11 @@ signal-exit@^3.0.0, signal-exit@^3.0.2: resolved "https://npm.i12e.cha0s.io/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== +slash@^1.0.0: + version "1.0.0" + resolved "https://npm.i12e.cha0s.io/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + integrity sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= + slice-ansi@^2.1.0: version "2.1.0" resolved "https://npm.i12e.cha0s.io/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" diff --git a/packages/chat/src/client/effects.js b/packages/chat/src/client/effects.js index 8efe8a2..f2469ab 100644 --- a/packages/chat/src/client/effects.js +++ b/packages/chat/src/client/effects.js @@ -13,6 +13,7 @@ import { import { addMessage, confirmMessage, + editMessage, join, leave, rejectMessage, @@ -20,6 +21,7 @@ import { submitLeave, submitMessage, submitMessageDistinction, + submitMessageEdit, toggleMessageDistinction, } from './state'; @@ -107,5 +109,9 @@ export default ({config: {'%socket': socket}}) => { dispatch(toggleMessageDistinction(payload)); await socket.send(['MessageDistinction', payload]); }, + [submitMessageEdit]: async ({dispatch}, {payload}) => { + dispatch(editMessage(payload)); + await socket.send(['MessageEdit', payload]); + }, }); }; diff --git a/packages/chat/src/client/index.js b/packages/chat/src/client/index.js index 04b308a..92fbe89 100644 --- a/packages/chat/src/client/index.js +++ b/packages/chat/src/client/index.js @@ -5,6 +5,7 @@ import Message from '../packets/message'; import MessageSiteBan from '../packets/message-site-ban'; import MessageChannelBan from '../packets/message-channel-ban'; import MessageDistinction from '../packets/message-distinction'; +import MessageEdit from '../packets/message-edit'; import chat from './state'; @@ -18,9 +19,10 @@ export default { Join: Join(latus), Leave: Leave(latus), Message: Message(latus), + MessageDistinction: MessageDistinction(latus), + MessageEdit: MessageEdit(latus), MessageChannelBan: MessageChannelBan(latus), MessageSiteBan: MessageSiteBan(latus), - MessageDistinction: MessageDistinction(latus), }), // eslint-disable-next-line global-require '@reddichat/state/effects': (latus) => require('./effects').default(latus), diff --git a/packages/chat/src/client/state.js b/packages/chat/src/client/state.js index e54595d..39b628d 100644 --- a/packages/chat/src/client/state.js +++ b/packages/chat/src/client/state.js @@ -77,8 +77,8 @@ const slice = createSlice({ const index = channel.messages.findIndex((uuid) => uuid === previous); channel.messages[index] = current; }, - editMessage: ({messages}, {payload: {uuid, message}}) => { - messages[uuid].message = message; + editMessage: ({messages}, {payload: {uuid, edit}}) => { + messages[uuid].message = edit; }, inputText: ({input}, {payload: {channel, text}}) => { const rendered = renderChannel(channel); @@ -121,6 +121,7 @@ const slice = createSlice({ submitLeave: () => {}, submitMessage: () => {}, submitMessageDistinction: () => {}, + submitMessageEdit: () => {}, toggleMessageDistinction: ({messages}, {payload: {distinction, uuid}}) => { const message = messages[uuid]; if (!message) { @@ -151,6 +152,7 @@ export const { submitLeave, submitMessage, submitMessageDistinction, + submitMessageEdit, toggleMessageDistinction, } = slice.actions; diff --git a/packages/chat/src/index.js b/packages/chat/src/index.js index 7332d78..fdf3422 100644 --- a/packages/chat/src/index.js +++ b/packages/chat/src/index.js @@ -14,6 +14,7 @@ import Join from './packets/join.server'; import Leave from './packets/leave.server'; import Message from './packets/message.server'; import MessageDistinction from './packets/message-distinction.server'; +import MessageEdit from './packets/message-edit.server'; import MessageChannelBan from './packets/message-channel-ban.server'; import MessageSiteBan from './packets/message-site-ban.server'; @@ -69,6 +70,7 @@ export default { Leave: Leave(latus), Message: Message(latus), MessageDistinction: MessageDistinction(latus), + MessageEdit: MessageEdit(latus), MessageChannelBan: MessageChannelBan(latus), MessageSiteBan: MessageSiteBan(latus), }), diff --git a/packages/chat/src/packets/message-edit.js b/packages/chat/src/packets/message-edit.js new file mode 100644 index 0000000..5ac87b9 --- /dev/null +++ b/packages/chat/src/packets/message-edit.js @@ -0,0 +1,30 @@ +import {Packet, ValidationError} from '@latus/socket/packets'; +import {validate} from 'uuid'; + +export default () => class MessageEdit extends Packet { + + static get data() { + return { + edit: 'string', + uuid: 'string', + }; + } + + static limit = { + points: 10, + duration: 15, + }; + + static async validate({data: {edit, uuid}}, {req: {user}}) { + if (edit.length > 512) { + throw new ValidationError({code: 413, reason: '> 512 bytes'}); + } + if (!validate(uuid)) { + throw new ValidationError({code: 400, reason: 'malformed'}); + } + if (!user) { + throw new ValidationError({code: 403, reason: 'unauthorized'}); + } + } + +}; diff --git a/packages/chat/src/packets/message-edit.server.js b/packages/chat/src/packets/message-edit.server.js new file mode 100644 index 0000000..0baa543 --- /dev/null +++ b/packages/chat/src/packets/message-edit.server.js @@ -0,0 +1,32 @@ +import {ValidationError} from '@latus/socket/packets'; +import {renderChannel} from '@reddichat/core'; + +import messageChannel from '../message-channel'; +import replaceMessage from '../replace-message'; +import MessageEdit from './message-edit'; + +export default (latus) => class MessageEditServer extends MessageEdit() { + + static async respond({data: {edit, uuid}}, socket) { + const {req} = socket; + await replaceMessage(req, uuid, (msg) => ({...msg, message: edit})); + const channel = await messageChannel(latus, uuid); + if (!channel) { + return; + } + socket + .to(renderChannel(channel)) + .send(['MessageEdit', {uuid, edit}]); + } + + static async validate(packet, socket) { + super.validate(packet, socket); + const {data: {uuid}} = packet; + const {req} = socket; + const {user} = req; + if (!user.isAdmin || !user.isModOf(await messageChannel(latus, uuid))) { + throw new ValidationError({code: 400, reason: 'unauthorized'}); + } + } + +}; diff --git a/packages/chat/src/replace-message.js b/packages/chat/src/replace-message.js index 85662f4..af4ae95 100644 --- a/packages/chat/src/replace-message.js +++ b/packages/chat/src/replace-message.js @@ -10,8 +10,7 @@ const replaceMessage = async (req, uuid, fn) => { return Promise.resolve(); } const message = fn(JSON.parse(await get(key))); - return new Promise((resolve, reject) => pubClient - .multi() + return new Promise((r, e) => pubClient .eval( [ "local ttl = redis.call('ttl', ARGV[1])", @@ -22,8 +21,8 @@ const replaceMessage = async (req, uuid, fn) => { 0, key, JSON.stringify(message), - ) - .exec((error) => (error ? reject(error) : resolve(message)))); + (error) => (error ? e(error) : r(message)), + )); }; export default replaceMessage; diff --git a/packages/chat/src/state.js b/packages/chat/src/state.js index 938a2c4..962ad83 100644 --- a/packages/chat/src/state.js +++ b/packages/chat/src/state.js @@ -51,6 +51,7 @@ export const channelState = async (req, latus, channel) => { ...JSON.parse(reply), uuid: messageKeys[i].split(':')[2], })) + .filter(({message}) => !!message) .sort((l, r) => l.timestamp - r.timestamp); const users = new Set(await channelUsers(req, channel)); users.add(channelIsAnonymous(channel) ? 0 : req.userId);