Added time to messages
This commit is contained in:
parent
65c31c6050
commit
959298524c
12
main.js
12
main.js
|
@ -103,7 +103,8 @@ getrows_sqlite3("messages", function(data)
|
||||||
// Push all the messages to the chats
|
// Push all the messages to the chats
|
||||||
chats[data.channel].messages.push({
|
chats[data.channel].messages.push({
|
||||||
message: data.message,
|
message: data.message,
|
||||||
from: data.from
|
from: data.from,
|
||||||
|
date: data.date
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -561,13 +562,15 @@ var server = net.createServer(function(socket)
|
||||||
sqlite3_insertData("messages", {
|
sqlite3_insertData("messages", {
|
||||||
channel: data.channel,
|
channel: data.channel,
|
||||||
message: data.message,
|
message: data.message,
|
||||||
from: sock.username
|
from: sock.username,
|
||||||
|
date: data.date
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add it to the channel
|
// Add it to the channel
|
||||||
chats[data.channel].messages.push({
|
chats[data.channel].messages.push({
|
||||||
message: data.message,
|
message: data.message,
|
||||||
from: sock.username
|
from: sock.username,
|
||||||
|
date: data.date
|
||||||
});
|
});
|
||||||
|
|
||||||
// Send it to all the connected clients
|
// Send it to all the connected clients
|
||||||
|
@ -581,7 +584,8 @@ var server = net.createServer(function(socket)
|
||||||
mode: "new_message",
|
mode: "new_message",
|
||||||
message: data.message,
|
message: data.message,
|
||||||
channel: data.channel,
|
channel: data.channel,
|
||||||
from: sock.username
|
from: sock.username,
|
||||||
|
date: data.date
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue