Remember network and channels

This commit is contained in:
Mattias Erming 2014-10-12 01:59:01 +02:00
parent 5b1820ca2e
commit 152395d303
5 changed files with 5 additions and 0 deletions

View File

@ -10,6 +10,7 @@ module.exports = function(network, chan, cmd, args) {
var quitMessage = args[0] ? args.join(" ") : ""; var quitMessage = args[0] ? args.join(" ") : "";
client.networks = _.without(client.networks, network); client.networks = _.without(client.networks, network);
client.save();
client.emit("quit", { client.emit("quit", {
network: network.id network: network.id
}); });

View File

@ -12,6 +12,7 @@ module.exports = function(irc, network) {
name: data.channel name: data.channel
}); });
network.channels.push(chan); network.channels.push(chan);
client.save();
client.emit("join", { client.emit("join", {
network: network.id, network: network.id,
chan: chan chan: chan

View File

@ -17,6 +17,7 @@ module.exports = function(irc, network) {
msg: msg msg: msg
}); });
self = true; self = true;
client.save();
client.emit("nick", { client.emit("nick", {
network: network.id, network: network.id,
nick: nick nick: nick

View File

@ -11,6 +11,7 @@ module.exports = function(irc, network) {
var from = data.nick; var from = data.nick;
if (from == irc.me) { if (from == irc.me) {
network.channels = _.without(network.channels, chan); network.channels = _.without(network.channels, chan);
client.save();
client.emit("part", { client.emit("part", {
chan: chan.id chan: chan.id
}); });

View File

@ -15,6 +15,7 @@ module.exports = function(irc, network) {
chan: lobby.id, chan: lobby.id,
msg: msg msg: msg
}); });
client.save();
client.emit("nick", { client.emit("nick", {
network: network.id, network: network.id,
nick: nick nick: nick