Merge pull request #324 from thelounge/update-irc-fw

Update irc-framework
This commit is contained in:
Max-P 2016-05-12 03:25:54 -04:00
commit bbf7b8086f
6 changed files with 8 additions and 15 deletions

View file

@ -118,7 +118,7 @@ module.exports = {
// Format (function):
// {"irc.example.net": function(client, args, trusted) {
// // 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)

View file

@ -10,6 +10,7 @@
"type": "git",
"url": "https://github.com/thelounge/lounge.git"
},
"homepage": "https://thelounge.github.io/",
"scripts": {
"start": "node index",
"build": "npm run build:grunt && npm run build:handlebars",
@ -41,7 +42,7 @@
"commander": "2.9.0",
"event-stream": "3.3.2",
"express": "4.13.4",
"irc-framework": "1.0.10",
"irc-framework": "2.0.0",
"lodash": "4.11.2",
"mkdirp": "0.5.1",
"moment": "2.13.0",

View file

@ -1,4 +1,5 @@
var _ = require("lodash");
var package = require("../package.json");
var Chan = require("./models/chan");
var crypto = require("crypto");
var userLog = require("./userLog");
@ -182,6 +183,7 @@ Client.prototype.connect = function(args) {
} else {
webirc = {
password: config.webirc[network.host],
username: package.name,
address: args.ip,
hostname: args.hostname
};
@ -198,6 +200,7 @@ Client.prototype.connect = function(args) {
"znc.in/self-message",
]);
network.irc.connect({
version: package.name + " " + package.version + " -- " + package.homepage,
host: network.host,
port: network.port,
nick: nick,

View file

@ -15,7 +15,7 @@ exports.input = function(network, chan, cmd, args) {
text = text || args.join(" ");
irc.say(chan.name, "\u0001ACTION " + text + "\u0001");
irc.action(chan.name, text);
if (!network.irc.network.cap.isEnabled("echo-message")) {
irc.emit("action", {

View file

@ -1,4 +1,3 @@
var pkg = require(process.cwd() + "/package.json");
var Msg = require("../../models/msg");
module.exports = function(irc, network) {
@ -22,9 +21,6 @@ module.exports = function(irc, network) {
irc.on("ctcp request", function(data) {
switch (data.type) {
case "VERSION":
irc.ctcpResponse(data.nick, "VERSION", pkg.name + " " + pkg.version);
break;
case "PING":
var split = data.message.split(" ");
if (split.length === 2) {

View file

@ -3,14 +3,7 @@ var Msg = require("../../models/msg");
module.exports = function(irc, network) {
var client = this;
// TODO: remove later
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);
irc.on("irc error", function(data) {
var text = data.error;
if (data.reason) {
text = data.reason + " (" + text + ")";