summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@nomic.retiolum>2014-03-17 03:55:57 +0100
committertv <tv@nomic.retiolum>2014-03-17 03:55:57 +0100
commit0f36ae9aedc1c2d87a32bfa51ab1b1d6cf2e7979 (patch)
tree189f1cfc561d8766d73903e2fe3c90f47cfcec3d
parentac8e7d1197d6c6466980fdf82ed8536c81cb612e (diff)
parent43764e34447da5abf8da71c0e795ce07d20dc1c7 (diff)
Merge remote-tracking branch 'Lassulus/master'
-rw-r--r--news/newsbot.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/news/newsbot.js b/news/newsbot.js
index a598f118..73441ad0 100644
--- a/news/newsbot.js
+++ b/news/newsbot.js
@@ -70,13 +70,13 @@ function main () {
function create_feedbot (nick, uri, channels) {
var client = new IRC.Client(irc_server, nick, {
channels: channels,
+ autoRejoin: false,
})
slaves[nick] = {
client: client,
nick: nick,
uri: uri,
- channels: channels,
}
// say text in every joined channel
@@ -95,6 +95,10 @@ function create_feedbot (nick, uri, channels) {
client.once('registered', loop_feedparser)
client.once('registered', deaf_myself)
+ client.on('invite', function (channel, from, message) {
+ client.join(channel, null)
+ })
+
client.on('error', function (error) {
console.log('Error:', error)
})
@@ -237,7 +241,7 @@ methods.save = function (params, callback) {
return [
slave.nick,
slave.uri,
- slave.channels.join(' '),
+ Object.keys(slave.client.chans).join(' '),
].join('|')
}).join('\n') + '\n'
return FS.writeFile(feeds_file, feeds, function (error) {