diff options
| author | Code WvS <code-wvs@quantentunnel.de> | 2015-03-08 15:06:06 +0100 |
|---|---|---|
| committer | Code WvS <code-wvs@quantentunnel.de> | 2015-03-08 15:06:06 +0100 |
| commit | 3f071db43ffa36f914db19be6f2d2191b597545d (patch) | |
| tree | 8b8e83a3942d03bd632f8c056db10c44b69bc8ee /threads.js | |
| parent | 44dcfed5c067caaf953892c26106f6b6f7843c89 (diff) | |
| parent | 692486e3778a0b678151a671d4aa999e0536859f (diff) | |
| download | snap-yow-3f071db43ffa36f914db19be6f2d2191b597545d.tar.gz snap-yow-3f071db43ffa36f914db19be6f2d2191b597545d.zip | |
Merge branch 'p2p' into gh-pages
Diffstat (limited to 'threads.js')
| -rw-r--r-- | threads.js | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -1299,16 +1299,22 @@ Process.prototype.doRemoveTemporaries = function () { Process.prototype.sendPeerMessage = function (message, peer) { var myself = this; + var stage = this.homeContext.receiver.parentThatIsA(StageMorph), + ide = this.homeContext.receiver.parentThatIsA(IDE_Morph); + console.log(peer, stage.peerId); if (peer instanceof List) { peer.asArray().forEach(function (singlePeer) { myself.sendPeerMessage(message, singlePeer); }); return; } + if (peer == stage.peerId) { + console.log('hello self!'); + stage.newPeerMessage(message, peer); + return; + } - var stage = this.homeContext.receiver.parentThatIsA(StageMorph), - ide = this.homeContext.receiver.parentThatIsA(IDE_Morph); var connection = stage.peer.connect(peer, {reliable: true}); connection.on('open', function () { var data; |
