mirror of
https://github.com/amark/gun.git
synced 2025-06-08 07:06:44 +00:00
commit
547adab000
@ -3,10 +3,10 @@ var Gun = (typeof window !== "undefined")? window.Gun : require('../gun');
|
||||
Gun.on('opt', function(root){
|
||||
this.to.next(root);
|
||||
if(root.once){ return }
|
||||
console.log("WARNING: `lib/bye` is out of date!");
|
||||
root.on('in', function(msg){
|
||||
if(!msg.peer || !msg.BYE){ return this.to.next(msg) }
|
||||
var peer = msg.peer();
|
||||
//Msg did not have a peer property saved before, so nothing ever went further
|
||||
if(!msg.mesh || !msg.BYE){ return this.to.next(msg) }
|
||||
var peer = msg.mesh.via;
|
||||
(peer.bye = peer.bye || []).push(msg.BYE);
|
||||
})
|
||||
root.on('bye', function(peer){
|
||||
|
Loading…
x
Reference in New Issue
Block a user