Re-connect XMPP when disconnected #2

Merged
raucao merged 4 commits from feature/1-reconnect_xmpp into master 2020-11-27 11:22:32 +00:00
Showing only changes of commit 82313c72ea - Show all commits

View File

@ -3,6 +3,7 @@ const xmpp = require('simple-xmpp');
const hubotRooms = process.env.HUBOT_IRC_ROOMS.split(',');
const xmppRooms = process.env.HUBOT_WORMHOLE_XMPP_ROOMS.split(',');
const xmppNickname = process.env.HUBOT_WORMHOLE_XMPP_NICKNAME;
const xmppConfig = {
jid: process.env.HUBOT_WORMHOLE_XMPP_JID,
@ -16,7 +17,7 @@ module.exports = function (robot) {
xmpp.on('online', function(data) {
robot.logger.info('XMPP connected with JID: ' + data.jid.toString());
raucao marked this conversation as resolved
Review

Is this supposed to use the hardcoded name "wormholedev"?

Is this supposed to use the hardcoded name "wormholedev"?
Review

Good catch. Thanks!

Good catch. Thanks!
xmppRooms.forEach(room => xmpp.join(`${room}/wormholedev`));
xmppRooms.forEach(room => xmpp.join(`${room}/${xmppNickname}`));
});
xmpp.on('close', function() {