Merge pull request #739 from toyoko-we/fix

bye.js fix (support new mesh)
This commit is contained in:
Mark Nadal 2019-04-22 14:13:42 -07:00 committed by GitHub
commit 98a1290cbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,8 +5,8 @@ Gun.on('opt', function(root){
if(root.once){ return }
root.on('in', function(msg){
//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;
if(!msg._ || !msg.BYE){ return this.to.next(msg) }
var peer = msg._.via;
(peer.bye = peer.bye || []).push(msg.BYE);
})
root.on('bye', function(peer){