mirror of
https://github.com/darkwire/darkwire.io.git
synced 2025-07-19 02:59:57 +00:00
Actual configurable port
This commit is contained in:
parent
6273e21b22
commit
59ee6ca56f
@ -11,7 +11,7 @@ import fs from 'fs';
|
||||
import Room from './room';
|
||||
|
||||
const $CONFIG = {
|
||||
port: 3000
|
||||
port: process.env.port || 3000
|
||||
}
|
||||
|
||||
const app = express();
|
||||
|
@ -106,7 +106,7 @@ $(function() {
|
||||
}
|
||||
|
||||
// Adds the visual chat message to the message list
|
||||
function addChatMessage (data, options) {
|
||||
function addChatMessage (data, options, dataType) {
|
||||
if (!data.message.trim().length) return;
|
||||
|
||||
// Don't fade the message in if there is an 'X was typing'
|
||||
@ -121,8 +121,10 @@ $(function() {
|
||||
.text(data.username)
|
||||
.css('color', getUsernameColor(data.username));
|
||||
let $messageBodyDiv = $('<span class="messageBody">');
|
||||
|
||||
if (options.file) {
|
||||
// TODO: Ask client if accept/reject attachment
|
||||
// If reject, destroy object in memory
|
||||
// If accept, render image or content dispose
|
||||
if (dataType.file) {
|
||||
let image = new Image();
|
||||
image.src = `data:image/png;base64,${data.message}`;
|
||||
$messageBodyDiv.html(image);
|
||||
@ -308,7 +310,7 @@ $(function() {
|
||||
// username: data.username,
|
||||
// message: file
|
||||
// }
|
||||
addChatMessage(data, {file: true})
|
||||
addChatMessage(data, false, {file: true})
|
||||
} else {
|
||||
addChatMessage(data);
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ class Room {
|
||||
id: socket.user.id,
|
||||
message: data.message,
|
||||
messageType: data.messageType,
|
||||
data: data.data,
|
||||
vector: data.vector,
|
||||
secretKeys: data.secretKeys,
|
||||
signature: data.signature
|
||||
|
Loading…
x
Reference in New Issue
Block a user