Commit c8f40d02ab01f58cbcd7b38d76ca0253ebbffcaa
1 parent
a0c7bdbd28
Exists in
master
ignore if sender == from
Showing 2 changed files with 11 additions and 2 deletions Side-by-side Diff
adaptor-xmpp.js
... | ... | @@ -13,7 +13,12 @@ function onOnline(data) { |
13 | 13 | } |
14 | 14 | |
15 | 15 | function onPM(sender, msg) { |
16 | - logger.verbose('Got a message', {from: sender, msg: msg}) | |
16 | + if (destination.toLowerCase() == username.replace(/\/.*/, '').toLowerCase()) { | |
17 | + return; | |
18 | + } | |
19 | + | |
20 | + logger.verbose('Got a message', {from: sender, msg: msg}); | |
21 | + | |
17 | 22 | if (callbacks.onPM) { |
18 | 23 | callbacks.onPM(sender, msg); |
19 | 24 | } |
... | ... | @@ -46,7 +51,10 @@ function init(_username, _password, _logger, _callbacks) { |
46 | 51 | } |
47 | 52 | |
48 | 53 | function sendMessage(destination, msg) { |
49 | - logger.verbose('Sending message', {from: username, destination: destination, msg: msg}); | |
54 | + if (destination.toLowerCase() != username.replace(/\/.*/, '').toLowerCase()) { | |
55 | + logger.verbose('Sending message', {from: username, destination: destination, msg: msg}); | |
56 | + } | |
57 | + | |
50 | 58 | xmpp.send(destination, msg); |
51 | 59 | } |
52 | 60 |