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