Compare View
Commits (2)
Changes
Showing 3 changed files Side-by-side Diff
gateway/advice-push-server.js
... | ... | @@ -8,7 +8,7 @@ const config = require('../config'); |
8 | 8 | const logger = require('../logger'); |
9 | 9 | const matrix = require('../matrix'); |
10 | 10 | |
11 | -if (!config || !config.push_server || !!config.push_server.apikey || !config.push_server.advice_port) return; | |
11 | +if (!config || !config.push_server || !!config.push_server.apikey || !config.push_server.advice || !config.push_server.advice.url || !config.push_server.advice.port) return; | |
12 | 12 | |
13 | 13 | const app = express(); |
14 | 14 | |
... | ... | @@ -17,8 +17,8 @@ let partner = null; |
17 | 17 | function setPartner(_partner) { |
18 | 18 | partner = _partner; |
19 | 19 | |
20 | - app.listen(config.push_server.advice_port, function () { | |
21 | - logger.info('Advice server listening', {port: config.push_server.advice_port}); | |
20 | + app.listen(config.push_server.advice.port, function () { | |
21 | + logger.info('Advice server listening', {port: config.push_server.advice.port}); | |
22 | 22 | }); |
23 | 23 | } |
24 | 24 |
gateway/pull.js
... | ... | @@ -129,6 +129,14 @@ function report(data) { |
129 | 129 | return; |
130 | 130 | } |
131 | 131 | |
132 | + if (config && config.push_server && config.push_server.apikey && config.push_server.advice && config.push_server.advice.url && config.push_server.advice.port) { | |
133 | + if (!data.misc) { | |
134 | + data.misc = {}; | |
135 | + } | |
136 | + | |
137 | + data.misc.advice_url = config.push_server.advice.url; | |
138 | + } | |
139 | + | |
132 | 140 | let options = { |
133 | 141 | url: core_pull_report_url, |
134 | 142 | form: { |