Reply to XMPP when outgoing webhook fails

This commit is contained in:
nioc 2019-11-24 16:39:57 +01:00
parent 1973c060aa
commit a99008b984
3 changed files with 5 additions and 0 deletions

View file

@ -46,6 +46,7 @@
"username": "bot@domain-xmpp.ltd", "username": "bot@domain-xmpp.ltd",
"password": "botPass", "password": "botPass",
"resource": "botservice", "resource": "botservice",
"errorReply": "Oops, something went wrong :(",
"rooms": [ "rooms": [
{ {
"id": "roomname@conference.domain-xmpp.ltd", "id": "roomname@conference.domain-xmpp.ltd",

View file

@ -135,6 +135,9 @@ module.exports = (logger, config) => {
case 'outgoing_webhook': case 'outgoing_webhook':
logger.debug(`Call outgoing webhook: ${xmppHook.args[0]}`) logger.debug(`Call outgoing webhook: ${xmppHook.args[0]}`)
outgoing(logger, config, this, from.toString(), replyTo.toString(), message, type, xmppHook.args[0]) outgoing(logger, config, this, from.toString(), replyTo.toString(), message, type, xmppHook.args[0])
.catch(() => {
this.send(replyTo.toString(), config.xmpp.errorReply, type)
})
break break
default: default:
break break

View file

@ -46,6 +46,7 @@
"username": "bot@domain-xmpp.ltd", "username": "bot@domain-xmpp.ltd",
"password": "botPass", "password": "botPass",
"resource": "botservice", "resource": "botservice",
"errorReply": "Oops, something went wrong :(",
"rooms": [ "rooms": [
{ {
"id": "roomname@conference.domain-xmpp.ltd", "id": "roomname@conference.domain-xmpp.ltd",