Update irc-framework
This commit is contained in:
parent
b13767d3a6
commit
ac5e96cddf
@ -118,7 +118,7 @@ module.exports = {
|
|||||||
// Format (function):
|
// Format (function):
|
||||||
// {"irc.example.net": function(client, args, trusted) {
|
// {"irc.example.net": function(client, args, trusted) {
|
||||||
// // here, we return a webirc object fed directly to `irc-framework`
|
// // here, we return a webirc object fed directly to `irc-framework`
|
||||||
// return {password: "hunter1", address: args.ip, hostname: "webirc/"+args.hostname};
|
// return {username: "thelounge", password: "hunter1", address: args.ip, hostname: "webirc/"+args.hostname};
|
||||||
// }}
|
// }}
|
||||||
//
|
//
|
||||||
// @type string | function(client, args):object(webirc)
|
// @type string | function(client, args):object(webirc)
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/thelounge/lounge.git"
|
"url": "https://github.com/thelounge/lounge.git"
|
||||||
},
|
},
|
||||||
|
"homepage": "https://thelounge.github.io/",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node index",
|
"start": "node index",
|
||||||
"build": "npm run build:grunt && npm run build:handlebars",
|
"build": "npm run build:grunt && npm run build:handlebars",
|
||||||
@ -41,7 +42,7 @@
|
|||||||
"commander": "2.9.0",
|
"commander": "2.9.0",
|
||||||
"event-stream": "3.3.2",
|
"event-stream": "3.3.2",
|
||||||
"express": "4.13.4",
|
"express": "4.13.4",
|
||||||
"irc-framework": "1.0.10",
|
"irc-framework": "2.0.0",
|
||||||
"lodash": "4.11.2",
|
"lodash": "4.11.2",
|
||||||
"mkdirp": "0.5.1",
|
"mkdirp": "0.5.1",
|
||||||
"moment": "2.13.0",
|
"moment": "2.13.0",
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
var _ = require("lodash");
|
var _ = require("lodash");
|
||||||
|
var package = require("../package.json");
|
||||||
var Chan = require("./models/chan");
|
var Chan = require("./models/chan");
|
||||||
var crypto = require("crypto");
|
var crypto = require("crypto");
|
||||||
var userLog = require("./userLog");
|
var userLog = require("./userLog");
|
||||||
@ -182,6 +183,7 @@ Client.prototype.connect = function(args) {
|
|||||||
} else {
|
} else {
|
||||||
webirc = {
|
webirc = {
|
||||||
password: config.webirc[network.host],
|
password: config.webirc[network.host],
|
||||||
|
username: package.name,
|
||||||
address: args.ip,
|
address: args.ip,
|
||||||
hostname: args.hostname
|
hostname: args.hostname
|
||||||
};
|
};
|
||||||
@ -198,6 +200,7 @@ Client.prototype.connect = function(args) {
|
|||||||
"znc.in/self-message",
|
"znc.in/self-message",
|
||||||
]);
|
]);
|
||||||
network.irc.connect({
|
network.irc.connect({
|
||||||
|
version: package.name + " " + package.version + " -- " + package.homepage,
|
||||||
host: network.host,
|
host: network.host,
|
||||||
port: network.port,
|
port: network.port,
|
||||||
nick: nick,
|
nick: nick,
|
||||||
|
@ -15,7 +15,7 @@ exports.input = function(network, chan, cmd, args) {
|
|||||||
|
|
||||||
text = text || args.join(" ");
|
text = text || args.join(" ");
|
||||||
|
|
||||||
irc.say(chan.name, "\u0001ACTION " + text + "\u0001");
|
irc.action(chan.name, text);
|
||||||
|
|
||||||
if (!network.irc.network.cap.isEnabled("echo-message")) {
|
if (!network.irc.network.cap.isEnabled("echo-message")) {
|
||||||
irc.emit("action", {
|
irc.emit("action", {
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
var pkg = require(process.cwd() + "/package.json");
|
|
||||||
var Msg = require("../../models/msg");
|
var Msg = require("../../models/msg");
|
||||||
|
|
||||||
module.exports = function(irc, network) {
|
module.exports = function(irc, network) {
|
||||||
@ -22,9 +21,6 @@ module.exports = function(irc, network) {
|
|||||||
|
|
||||||
irc.on("ctcp request", function(data) {
|
irc.on("ctcp request", function(data) {
|
||||||
switch (data.type) {
|
switch (data.type) {
|
||||||
case "VERSION":
|
|
||||||
irc.ctcpResponse(data.nick, "VERSION", pkg.name + " " + pkg.version);
|
|
||||||
break;
|
|
||||||
case "PING":
|
case "PING":
|
||||||
var split = data.message.split(" ");
|
var split = data.message.split(" ");
|
||||||
if (split.length === 2) {
|
if (split.length === 2) {
|
||||||
|
@ -3,14 +3,7 @@ var Msg = require("../../models/msg");
|
|||||||
module.exports = function(irc, network) {
|
module.exports = function(irc, network) {
|
||||||
var client = this;
|
var client = this;
|
||||||
|
|
||||||
// TODO: remove later
|
irc.on("irc error", function(data) {
|
||||||
irc.on("irc_error", function(data) {
|
|
||||||
log.debug("Got an irc_error");
|
|
||||||
irc.emit("error", data);
|
|
||||||
});
|
|
||||||
|
|
||||||
irc.on("error", function(data) {
|
|
||||||
log.debug("error", data);
|
|
||||||
var text = data.error;
|
var text = data.error;
|
||||||
if (data.reason) {
|
if (data.reason) {
|
||||||
text = data.reason + " (" + text + ")";
|
text = data.reason + " (" + text + ")";
|
||||||
|
Loading…
Reference in New Issue
Block a user