diff options
Diffstat (limited to 'cmd')
-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() { |