Commit c8f40d02ab01f58cbcd7b38d76ca0253ebbffcaa

Authored by Adhidarma Hadiwinoto
1 parent a0c7bdbd28
Exists in master

ignore if sender == from

Showing 2 changed files with 11 additions and 2 deletions Side-by-side Diff

... ... @@ -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  
... ... @@ -18,6 +18,7 @@ partner=xxx
18 18 allow_response_from=xxx
19 19 pin=xxx
20 20 request_pattern="[remoteProduct].[destination].[pin]"
  21 +keepalive_message=SAL [pin]
21 22  
22 23 [expresso]
23 24 listen_port=19602