Add support for IRCv3 server-time

This commit is contained in:
Pavel Djundik 2016-03-12 11:36:55 +02:00 committed by Maxime Poulin
parent 7baf5f0f81
commit 516ccd965f
9 changed files with 14 additions and 1 deletions

View File

@ -28,8 +28,13 @@ function Msg(attr) {
from: "",
id: id++,
text: "",
time: new Date(),
type: Msg.Type.MESSAGE,
self: false
}, attr));
if (attr.time > 0) {
attr.time = new Date(attr.time);
} else {
attr.time = new Date();
}
}

View File

@ -24,6 +24,7 @@ module.exports = function(irc, network) {
chan: chan.id
});
var msg = new Msg({
time: data.time,
from: data.nick,
hostmask: data.ident + "@" + data.hostname,
type: Msg.Type.JOIN,

View File

@ -21,6 +21,7 @@ module.exports = function(irc, network) {
var msg = new Msg({
type: Msg.Type.KICK,
time: data.time,
mode: chan.getMode(data.nick),
from: data.nick,
target: data.kicked,

View File

@ -65,6 +65,7 @@ module.exports = function(irc, network) {
var msg = new Msg({
type: data.type,
time: data.time,
mode: chan.getMode(data.nick),
from: data.nick,
text: data.msg,

View File

@ -24,6 +24,7 @@ module.exports = function(irc, network) {
}
var msg = new Msg({
time: data.time,
type: Msg.Type.MODE,
mode: (targetChan.type !== Chan.Type.LOBBY && targetChan.getMode(data.nick)) || "",
from: data.nick,

View File

@ -34,6 +34,7 @@ module.exports = function(irc, network) {
chan: chan.id
});
var msg = new Msg({
time: data.time,
type: Msg.Type.NICK,
mode: chan.getMode(data.newnick),
nick: data.nick,

View File

@ -23,6 +23,7 @@ module.exports = function(irc, network) {
});
var msg = new Msg({
type: Msg.Type.PART,
time: data.time,
mode: (user && user.mode) || "",
text: data.message || "",
hostmask: data.ident + "@" + data.hostname,

View File

@ -15,6 +15,7 @@ module.exports = function(irc, network) {
chan: chan.id
});
var msg = new Msg({
time: data.time,
type: Msg.Type.QUIT,
mode: user.mode || "",
text: data.message || "",

View File

@ -10,6 +10,7 @@ module.exports = function(irc, network) {
}
var msg = new Msg({
time: data.time,
type: Msg.Type.TOPIC,
mode: (data.nick && chan.getMode(data.nick)) || "",
from: data.nick,