Compare View
Commits (3)
Changes
Showing 3 changed files Side-by-side Diff
lib/http-listener.js
... | ... | @@ -57,7 +57,7 @@ function mainHandler(req, res) { |
57 | 57 | return; |
58 | 58 | } |
59 | 59 | |
60 | - logger.info(`Saving ${req.body.is_outgoing ? 'outgoing' : 'incoming' } message history`); | |
60 | + logger.info(`Saving ${req.body.is_outgoing || req.query.is_outgoing ? 'outgoing' : 'incoming' } message history`); | |
61 | 61 | |
62 | 62 | messagesArchive.insert( |
63 | 63 | { |
... | ... | @@ -69,8 +69,16 @@ function mainHandler(req, res) { |
69 | 69 | ( req.body.is_outgoing || req.query.is_outgoing ) ? messagesArchive.DIRECTION_OUTGOING : messagesArchive.DIRECTION_INCOMING |
70 | 70 | ); |
71 | 71 | |
72 | - if (req.body.do_not_forward_to_core || req.query.do_not_forward_to_core || req.body.is_outgoing || req.query.is_outgoing) { | |
73 | - logger.verbose('Ignoring message', { from: req.body.from || req.query.from, msg: req.body.msg || req.query.msg, do_not_forward_to_core: req.body.do_not_forward_to_core || req.query.do_not_forward_to_core }); | |
72 | + if ( | |
73 | + req.body.do_not_forward_to_core || req.query.do_not_forward_to_core | |
74 | + || req.body.is_outgoing || req.query.is_outgoing | |
75 | + ) { | |
76 | + logger.verbose( 'Ignoring message', { | |
77 | + from: req.body.from || req.query.from, | |
78 | + msg: req.body.msg || req.query.msg, | |
79 | + do_not_forward_to_core: req.body.do_not_forward_to_core || req.query.do_not_forward_to_core | |
80 | + }); | |
81 | + | |
74 | 82 | res.end('OK'); |
75 | 83 | return; |
76 | 84 | } |
package-lock.json