diff options
author | obscuren <geffobscura@gmail.com> | 2015-02-03 23:16:05 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-02-03 23:16:05 +0800 |
commit | 7bd2fbe2b1445c26190008d21ad52dc5c364765c (patch) | |
tree | 88553917d6be4a51f4a9dd87f35ce31782319ee1 /cmd/mist/assets/examples/whisper.html | |
parent | 623469cb6c6cdb6ff84dc2cb7d4409e9d7cf3f65 (diff) | |
download | go-tangerine-7bd2fbe2b1445c26190008d21ad52dc5c364765c.tar.gz go-tangerine-7bd2fbe2b1445c26190008d21ad52dc5c364765c.tar.zst go-tangerine-7bd2fbe2b1445c26190008d21ad52dc5c364765c.zip |
Fixed whisper "to" filtering. Closes #283
Diffstat (limited to 'cmd/mist/assets/examples/whisper.html')
-rw-r--r-- | cmd/mist/assets/examples/whisper.html | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd/mist/assets/examples/whisper.html b/cmd/mist/assets/examples/whisper.html index 6a7143eef..ad568f783 100644 --- a/cmd/mist/assets/examples/whisper.html +++ b/cmd/mist/assets/examples/whisper.html @@ -10,6 +10,7 @@ <h1>Whisper test</h1> <button onclick="test()">Send</button> +<button onclick="test2()">Private send</button> <table width="100%" id="table"> <tr> @@ -44,10 +45,19 @@ document.querySelector("#table").innerHTML += "<tr><td colspan='2'>"+JSON.stringify(message)+"</td></tr>"; }); + var selfWatch = shh.watch({to: id, topics: ["test"]}) + selfWatch.arrived(function(message) { + document.querySelector("#table").innerHTML += "<tr><td>To me</td><td>"+JSON.stringify(message)+"</td></tr>"; + }); + function test() { shh.post({topics: ["test"], payload: web3.fromAscii("test it")}); count(); + } + function test2() { + shh.post({to: id, topics: ["test"], payload: web3.fromAscii("Private")}); + count(); } function count() { |