From db5fe00b604611be24b8ce7a930dc43c07bd221d Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Tue, 15 Mar 2016 11:59:36 +0200 Subject: [PATCH] A couple of fixes after rebasing and updating framework --- src/models/msg.js | 6 +++--- src/plugins/inputs/action.js | 2 +- src/plugins/inputs/msg.js | 10 +--------- src/plugins/inputs/notice.js | 2 +- test/plugins/link.js | 2 +- test/util.js | 2 +- 6 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/models/msg.js b/src/models/msg.js index d0c8a0db..00fbf04b 100644 --- a/src/models/msg.js +++ b/src/models/msg.js @@ -32,9 +32,9 @@ function Msg(attr) { self: false }, attr)); - if (attr.time > 0) { - attr.time = new Date(attr.time); + if (this.time > 0) { + this.time = new Date(this.time); } else { - attr.time = new Date(); + this.time = new Date(); } } diff --git a/src/plugins/inputs/action.js b/src/plugins/inputs/action.js index 34c8036a..4f8376ce 100644 --- a/src/plugins/inputs/action.js +++ b/src/plugins/inputs/action.js @@ -19,7 +19,7 @@ exports.input = function(network, chan, cmd, args) { irc.emit("action", { nick: irc.user.nick, target: chan.name, - msg: text + message: text }); break; } diff --git a/src/plugins/inputs/msg.js b/src/plugins/inputs/msg.js index 4afaa5c4..1e98d886 100644 --- a/src/plugins/inputs/msg.js +++ b/src/plugins/inputs/msg.js @@ -1,16 +1,8 @@ var _ = require("lodash"); -<<<<<<< fbbb3d20d287243d2c3c5525d86801f54f903603 exports.commands = ["msg", "say"]; exports.input = function(network, chan, cmd, args) { -======= -module.exports = function(network, chan, cmd, args) { - if (cmd !== "say" && cmd !== "msg") { - return; - } - ->>>>>>> Update commands if (args.length === 0 || args[0] === "") { return true; } @@ -34,7 +26,7 @@ module.exports = function(network, chan, cmd, args) { irc.emit("privmsg", { nick: irc.user.nick, target: channel.name, - msg: msg + message: msg }); } diff --git a/src/plugins/inputs/notice.js b/src/plugins/inputs/notice.js index ca0a5e6c..e16cb74b 100644 --- a/src/plugins/inputs/notice.js +++ b/src/plugins/inputs/notice.js @@ -20,7 +20,7 @@ exports.input = function(network, chan, cmd, args) { irc.emit("notice", { nick: irc.user.nick, target: targetChan.name, - msg: message + message: message }); return true; diff --git a/test/plugins/link.js b/test/plugins/link.js index e6ad0a94..278a2713 100644 --- a/test/plugins/link.js +++ b/test/plugins/link.js @@ -26,7 +26,7 @@ describe("Link plugin", function() { }); this.irc.createMessage({ - msg: "http://localhost:9002/basic" + message: "http://localhost:9002/basic" }); this.irc.once("toggle", function(data) { diff --git a/test/util.js b/test/util.js index 07478867..aea080bb 100644 --- a/test/util.js +++ b/test/util.js @@ -15,7 +15,7 @@ util.inherits(MockClient, EventEmitter); MockClient.prototype.createMessage = function(opts) { var message = _.extend({ - msg: "dummy message", + message: "dummy message", nick: "test-user", target: "#test-channel" }, opts);