Changes for irc-framework update

This commit is contained in:
Pavel Djundik 2020-05-11 22:39:17 +03:00
parent 761d482572
commit 4becb152bb
3 changed files with 8 additions and 11 deletions

View File

@ -173,8 +173,10 @@ Network.prototype.createIrcFramework = function (client) {
enable_echomessage: true,
enable_setname: true,
auto_reconnect: true,
auto_reconnect_wait: 10000 + Math.floor(Math.random() * 1000), // If multiple users are connected to the same network, randomize their reconnections a little
auto_reconnect_max_retries: 360, // At least one hour (plus timeouts) worth of reconnections
// Exponential backoff maxes out at 300 seconds after 9 reconnects,
// it will keep trying for well over an hour (plus the timeouts)
auto_reconnect_max_retries: 30,
});
this.setIrcFrameworkOptions(client);

View File

@ -178,14 +178,9 @@ module.exports = function (irc, network) {
network.channels[0].pushMessage(
client,
new Msg({
text:
"Disconnected from the network. Reconnecting in " +
Math.round(data.wait / 1000) +
" seconds… (Attempt " +
data.attempt +
" of " +
data.max_retries +
")",
text: `Disconnected from the network. Reconnecting in ${Math.round(
data.wait / 1000
)} seconds (Attempt ${data.attempt})`,
}),
true
);

View File

@ -8,7 +8,7 @@ const pkg = require("../../../package.json");
const ctcpResponses = {
CLIENTINFO: () =>
Object.getOwnPropertyNames(ctcpResponses) // TODO: This is currently handled by irc-framework
Object.getOwnPropertyNames(ctcpResponses)
.filter((key) => key !== "CLIENTINFO" && typeof ctcpResponses[key] === "function")
.join(" "),
PING: ({message}) => message.substring(5),