Skip to content

Commit

Permalink
Merge pull request thelounge#324 from thelounge/update-irc-fw
Browse files Browse the repository at this point in the history
Update irc-framework
  • Loading branch information
maxpoulin64 committed May 12, 2016
2 parents e13c352 + e81ad6e commit 53fa9cd
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 15 deletions.
2 changes: 1 addition & 1 deletion defaults/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions src/client.js
Original file line number Diff line number Diff line change
@@ -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");
Expand Down Expand Up @@ -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
};
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/inputs/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -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", {
Expand Down
4 changes: 0 additions & 4 deletions src/plugins/irc-events/ctcp.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
var pkg = require(process.cwd() + "/package.json");
var Msg = require("../../models/msg");

module.exports = function(irc, network) {
Expand All @@ -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) {
Expand Down
9 changes: 1 addition & 8 deletions src/plugins/irc-events/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 + ")";
Expand Down

0 comments on commit 53fa9cd

Please sign in to comment.