jenkins-bot has submitted this change and it was merged. Change subject: Move around a load more logging, responses etc. ......................................................................
Move around a load more logging, responses etc. Change-Id: I5ec5e06b53716d822b106f2fbbfb37e876c3499a --- M src/relay.js 1 file changed, 15 insertions(+), 18 deletions(-) Approvals: Paladox: Looks good to me, approved jenkins-bot: Verified diff --git a/src/relay.js b/src/relay.js index c534981..dac448a 100644 --- a/src/relay.js +++ b/src/relay.js @@ -177,15 +177,13 @@ if (from_trusted) { console.log(from + ' => ' + to + ' ' + text); - logging.info('re-connecting to gerrit..'); - - ircClient.say(to, "re-connecting to gerrit"); - if (sshConn) { sshConn.end(); + logging.info('re-connecting to gerrit..'); + ircClient.say(to, "Ended SSH connection to Gerrit."); + } else { + ircClient.say(to, "No SSH connection to Gerrit."); } - - ircClient.say(to, "reconnected to gerrit"); } else { ircClient.say(to, "Permission is denied."); } @@ -195,32 +193,31 @@ if (from_trusted) { console.log(from + ' => ' + to + ' ' + text); - ircClient.say(to, "re-connecting to gerrit and irc."); + ircClient.say(to, "Re-connecting to Gerrit and IRC."); - logging.info('Disconnecting from irc.'); + logging.info('Disconnecting from IRC.'); ircClient.send('QUIT', "quit"); - logging.info('re-connecting to gerrit..'); - if (sshConn) { sshConn.end(); + ircClient.say(to, "Ended SSH connection to Gerrit."); + } else { + ircClient.say(to, "No SSH connection to Gerrit."); } - logging.info('re-connected to gerrit.'); + setTimeout(function(){ ircClient.say(to, "re-connected to Gerrit and IRC."); }, 17000); // TODO: wtf? - setTimeout(function(){ ircClient.say(to, "re-connected to gerrit and irc."); }, 17000); - - logging.info('re-connected to irc.'); + logging.info('Re-connecting to IRC.'); } else { ircClient.say(to, "Permission is denied."); } } - if (text.indexOf(ircClient.nick + ': ' + 'nick') === 0) { + if (text.indexOf(ircClient.nick + ': nick') === 0) { if (!from_trusted) { ircClient.say(to, "Permission is denied."); - } else if (config.nick.indexOf(ircClient.nick) === 0) { + } else if (config.nick === ircClient.nick) { console.log(from + ' => ' + to + ' ' + text); ircClient.say(to, "Nick is already " + ircClient.nick + " not changing the nick."); @@ -234,11 +231,11 @@ if (ircClient.pass) { ircClient.pass(config.password); } - logging.info('changed nick to' + ' ' + config.nick); + logging.info('Changed nick to ' + config.nick); } } - if (text.indexOf(ircClient.nick + ': ' + 'help') === 0) { + if (text.indexOf(ircClient.nick + ': help') === 0) { ircClient.say(to, "My current commands are: " + ircClient.nick + ": restart" + ", " + ircClient.nick + ": force-restart" + ", " + " and " + ircClient.nick + ": nick"); } } catch (err) {} -- To view, visit https://gerrit.wikimedia.org/r/321338 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5ec5e06b53716d822b106f2fbbfb37e876c3499a Gerrit-PatchSet: 1 Gerrit-Project: labs/tools/grrrit Gerrit-Branch: master Gerrit-Owner: Alex Monk <a...@wikimedia.org> Gerrit-Reviewer: Merlijn van Deen <valhall...@arctus.nl> Gerrit-Reviewer: Paladox <thomasmulhall...@yahoo.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits