mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
Revert changes in gun to solve peer.id undefined. Don't need this change now because we are not using the peer.id in the subscriptions. Maybe will add this in the future.
This commit is contained in:
parent
dd3d4c3066
commit
a6f12af8da
15
gun.js
15
gun.js
@ -2119,10 +2119,10 @@
|
||||
mesh.say({dam: '?'}, opt.peers[tmp] = peer);
|
||||
}
|
||||
if(!tmp.hied){ ctx.on(tmp.hied = 'hi', peer) }
|
||||
// tmp = peer.queue; peer.queue = [];
|
||||
// Type.obj.map(tmp, function(msg){
|
||||
// mesh.say(msg, peer);
|
||||
// });
|
||||
tmp = peer.queue; peer.queue = [];
|
||||
Type.obj.map(tmp, function(msg){
|
||||
mesh.say(msg, peer);
|
||||
});
|
||||
}
|
||||
mesh.bye = function(peer){
|
||||
Type.obj.del(opt.peers, peer.id); // assume if peer.url then reconnect
|
||||
@ -2132,12 +2132,7 @@
|
||||
mesh.hear['!'] = function(msg, peer){ opt.log('Error:', msg.err) }
|
||||
mesh.hear['?'] = function(msg, peer){
|
||||
if(!msg.pid){
|
||||
mesh.say({dam: '?', pid: opt.pid, '@': msg['#']}, peer)
|
||||
var tmp = peer.queue; peer.queue = [];
|
||||
Type.obj.map(tmp, function(msg){
|
||||
mesh.say(msg, peer);
|
||||
});
|
||||
return;
|
||||
return mesh.say({dam: '?', pid: opt.pid, '@': msg['#']}, peer);
|
||||
}
|
||||
peer.id = peer.id || msg.pid;
|
||||
mesh.hi(peer);
|
||||
|
@ -193,10 +193,10 @@ function Mesh(ctx){
|
||||
mesh.say({dam: '?'}, opt.peers[tmp] = peer);
|
||||
}
|
||||
if(!tmp.hied){ ctx.on(tmp.hied = 'hi', peer) }
|
||||
// tmp = peer.queue; peer.queue = [];
|
||||
// Type.obj.map(tmp, function(msg){
|
||||
// mesh.say(msg, peer);
|
||||
// });
|
||||
tmp = peer.queue; peer.queue = [];
|
||||
Type.obj.map(tmp, function(msg){
|
||||
mesh.say(msg, peer);
|
||||
});
|
||||
}
|
||||
mesh.bye = function(peer){
|
||||
Type.obj.del(opt.peers, peer.id); // assume if peer.url then reconnect
|
||||
@ -206,12 +206,7 @@ function Mesh(ctx){
|
||||
mesh.hear['!'] = function(msg, peer){ opt.log('Error:', msg.err) }
|
||||
mesh.hear['?'] = function(msg, peer){
|
||||
if(!msg.pid){
|
||||
mesh.say({dam: '?', pid: opt.pid, '@': msg['#']}, peer)
|
||||
var tmp = peer.queue; peer.queue = [];
|
||||
Type.obj.map(tmp, function(msg){
|
||||
mesh.say(msg, peer);
|
||||
});
|
||||
return;
|
||||
return mesh.say({dam: '?', pid: opt.pid, '@': msg['#']}, peer);
|
||||
}
|
||||
peer.id = peer.id || msg.pid;
|
||||
mesh.hi(peer);
|
||||
|
Loading…
x
Reference in New Issue
Block a user