From ce766fa1db1a6c3cc83f588373c927ffa04733ba Mon Sep 17 00:00:00 2001 From: marzavec Date: Sun, 25 Mar 2018 14:16:02 -0700 Subject: Rolled client back to legacy & synced prod modules --- client/client.js | 20 +++--- client/index.html | 69 +------------------ client/structure.css | 137 ------------------------------------- server/src/commands/core/invite.js | 1 + server/src/commands/mod/ban.js | 1 - server/src/commands/mod/kick.js | 2 +- 6 files changed, 15 insertions(+), 215 deletions(-) delete mode 100644 client/structure.css diff --git a/client/client.js b/client/client.js index e8c3b79..254480d 100644 --- a/client/client.js +++ b/client/client.js @@ -19,14 +19,13 @@ var frontpage = [ "Whitespace is preserved, so source code can be pasted verbatim.", "Surround LaTeX with a dollar sign for inline style $\\zeta(2) = \\pi^2/6$, and two dollars for display. $$\\int_0^1 \\int_0^1 \\frac{1}{1-xy} dx dy = \\frac{\\pi^2}{6}$$", "", - "GitHub: https://github.com/AndrewBelt/hack.chat", - "Android apps: https://goo.gl/UkbKYy https://goo.gl/qasdSu https://goo.gl/fGQFQN", + "Current Github: https://github.com/hack-chat includes server and client source along with other resources", "", - "Server and web client released under the MIT open source license.", - "No message history is retained on the hack.chat server.", + "Legacy GitHub: https://github.com/AndrewBelt/hack.chat", + "Android apps: https://goo.gl/UkbKYy https://goo.gl/qasdSu https://goo.gl/fGQFQN", "", - "[03/03/2018] Please note that the server is currently undergoing changes, expect random downtime or disconnections!", - "[03/03/2018] Hack.chat is now under new management by the core community; @raf924 @bacon @wwandrew @Rut @_0x17 @M4GNV5 @MinusGix @nanotech", + "Server and web client released under the WTFPL and MIT open source license.", + "No message history is retained on the hack.chat server." ].join("\n") function $(query) {return document.querySelector(query)} @@ -60,8 +59,13 @@ window.setInterval(function() { function join(channel) { - - ws = new WebSocket('ws://127.0.0.1:6060') + if (document.domain == 'hack.chat') { + // For https://hack.chat/ + ws = new WebSocket('wss://hack.chat/chat-ws') + } else { + // for local installs + ws = new WebSocket('ws://' + document.domain + ':6060') + } var wasConnected = false diff --git a/client/index.html b/client/index.html index 3b56bd5..d71c62d 100644 --- a/client/index.html +++ b/client/index.html @@ -1,68 +1 @@ - - - - - - - - - - - hack.chat - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- - - - - - +hack.chat
\ No newline at end of file diff --git a/client/structure.css b/client/structure.css deleted file mode 100644 index 18abc33..0000000 --- a/client/structure.css +++ /dev/null @@ -1,137 +0,0 @@ -body { - padding: 0; - margin: 0; - overflow-y: scroll; -} -body, -input, -textarea { - font-family: 'DejaVu Sans Mono', monospace; - font-size: 12px; -} -input[type="checkbox"] { - margin: 0; - margin-right: 1em; -} -label { - vertical-align: 3px; -} -input, -textarea { - background: none; - border: none; - outline: none; - resize: none; -} -h4 { - font-size: 12px; - margin: 1em 0; - font-weight: bold; -} -pre { - tab-size: 2; - white-space: pre-wrap; - word-wrap: break-word; - tab-size: 4; - -moz-tab-size: 4; -} -a { - color: inherit; - text-decoration: none; - cursor: pointer; -} -a:hover { - text-decoration: underline; -} -ul { - padding-left: 0; -} -ul li { - list-style: inside; -} -.hidden { - display: none; -} -.container { - max-width: 600px; - margin: 0 auto; -} -.messages { - border-left: 1px solid; -} -#messages { - padding-top: 2em; -} -.message { - padding-bottom: 1em; -} -.nick { - float: left; - width: 16em; - margin-left: -17em; - margin-right: 1em; - text-align: right; - white-space: nowrap; - overflow: hidden; -} -.trip { - font-size: 10px; -} -.text { - margin: 0; - margin-left: 1em; -} -.text p { - margin: 0; -} -#footer { - position: fixed; - bottom: 0; - width: 100%; -} -#chatform { - border-top: 1px solid; -} -#chatinput { - width: 100%; - padding: 1em; - box-sizing: border-box; -} -#sidebar { - position: fixed; - top: 0; - bottom: 0; - right: 0; - padding: 1em; - border-left: solid 1px; - overflow-y: auto; -} -#sidebar-content { - width: 180px; -} -@media only screen and (max-width: 600px) { - .messages { - border: none; - } - #messages { - padding: 0.5em; - } - .message { - padding-bottom: 0.5em; - } - .nick { - margin: 0; - float: none; - text-align: left; - display: inline; - } - .text { - display: inline; - } - #sidebar { - top: 0.5em; - bottom: auto; - right: 0.5em; - border: none; - } -} diff --git a/server/src/commands/core/invite.js b/server/src/commands/core/invite.js index 5889562..a6412e1 100644 --- a/server/src/commands/core/invite.js +++ b/server/src/commands/core/invite.js @@ -36,6 +36,7 @@ exports.run = async (core, server, socket, data) => { let payload = { cmd: 'info', + invite: channel, text: `${socket.nick} invited you to ?${channel}` }; let inviteSent = server.broadcast( payload, { channel: socket.channel, nick: data.nick }); diff --git a/server/src/commands/mod/ban.js b/server/src/commands/mod/ban.js index 19f297a..409217a 100644 --- a/server/src/commands/mod/ban.js +++ b/server/src/commands/mod/ban.js @@ -37,7 +37,6 @@ exports.run = async (core, server, socket, data) => { return; } - // TODO unban by hash let clientHash = server.getSocketHash(badClient); server._police.arrest(badClient.remoteAddress, clientHash); diff --git a/server/src/commands/mod/kick.js b/server/src/commands/mod/kick.js index f51d576..1958ef3 100644 --- a/server/src/commands/mod/kick.js +++ b/server/src/commands/mod/kick.js @@ -52,7 +52,7 @@ exports.run = async (core, server, socket, data) => { server.broadcast({ cmd: 'info', text: `Kicked ${targetNick}` - }, { channel: socket.channel }); + }, { channel: socket.channel, uType: 'user' }); // inform mods with where they were sent server.broadcast({ -- cgit v1.2.1